Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WebServices/Windows App File Transfer

Status
Not open for further replies.

DanKon

Programmer
Aug 22, 2002
5
US
Hi All,

At this point, I'm relatively experienced with ASP.NET programming, however I've yet to use WebServices of any kind. A client of mine would like to have data exported from my web-based system so that the data can be utilized with a windows-based program on their local workstation.

Basically, I'd like to write a windows application to call a WebService on our server. This WebService would then generate the CSV files and put them in a ZIP file and stream this file to the windows application. Once the file download is complete, the windows application should simply unzip the file to a particular location.

I already have the code for creating the CSV file and zipping/unzipping the file. My question is how do I make a webservice "listen" for a request and stream the file, and how do I make a windows application generate the request and receive the file?

Hopefully someone has some resources they could point me to, or even better some sample code they'd be willing to share.

Thanks in advance,

Dan
 
Are you using .Net for the windows development?

If you are using .Net to create this windows application you will find it much easier as you can create an object in your webservice and you application can retireve the data in that exact object model. So there would be no reaso to zip (except for size).

Either way you need to us SOAP to do this.

Here is the code to do this from an ASP application calling a Webservice. The webservice returns a string which in your case could be the binary zip file.



dim objSoapClient
dim NewMessage

SET objSoapClient = Server.CreateObject("MSSOAP.SoapClient30")


objSoapClient.ClientProperty("ServerHTTPRequest") = True
' needs to be updated with the url of your Web Service WSDL and is
' followed by the Web Service name
Call objSoapClient.mssoapinit(" & application("WebService") & "/WebServices/Reports/Report.asmx?WSDL", "Report")


objSoapClient.ConnectorProperty("Timeout") = 900000

' use the SOAP object to call the Web Method Required

NewMessage = objSoapClient.Display("AGIMA Computing")

NewMessage is the returned string.


Here is the code on the other side.


<System.Web.Services.WebService(Namespace:=&quot; _
Public Class Report

<WebMethod()> _
Public Function Display(ByVal InString As String) As String

'Perform processing HERE (ie send back zip file)
Return InString

End Function


End Class


NOTE: You have to have SOAP v3 installed for this to work.

Let me know how you go.





AGIMA.net
 
Hey DanKon. What did you use to zip and unzip the file with? I used Dynazip in VB6, and I was going to get it for .net.

Did you get this to work?

Where do I get SOAP?
 
It does look pretty cool. Thanks. And please keep me informed on the SOAP thing. I need to do the same exact thing.

-Gary
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top