Link to home
Start Free TrialLog in
Avatar of Khaki
Khaki

asked on

How to send an XML file/data from a windows service to a web service?

Hi,
 I am setting up a windows service that will send xml data to a web service on a timed interval.  The xml data is a dataset from the sql server.  What is the best way to transport this xml data to the web service?  Will I be using SOAP? Or just use WebMethods?

Lastly, how can I stream the xml data from windows service to the web service securely?  

I am new at this, so any help would be appreciated.  Furthe more, the transport method must be secured.  

Any suggestions, links, info, code,  would help.

Thanks,
 
K
Avatar of jnhorst
jnhorst

The security issue should be handled by the web service.  It should accept SOAP via the https protocol.  If you have control over the web service (meaning you are programming it), you can set that up or you can write up your own encryption before you send off the XML and then decrypt it in the web service.  But again, that is if you have control over the web service.

By your question about web methods, I am thinking you will be developing the web service.  If this is true, then yes, you would define a web method that would accept your dataset as its argument.  In the consuming application, you set a Web Reference with the URL for the web service and then call its web methods just like calling the methods of any other class.

If you are going to create the web service and need some code samples, post a comment accordingly and I'll try to gin something up for you.

John
Avatar of Khaki

ASKER

Hi John, Thanks for insight.  I think you got were I am going.  I will be writing both the client and the web service, so if you have any sample code, I would greatly appreciated it.  
 One more thing, do you have any sample SOAP working  https links or samples?  I just need something small, then I can get started on my own.

Thanks.

K
I don't, but you don't really need that.  ASP.NET abstracts the complexity of SOAP away from the developer quite nicely.  You create the webservice and ASP.NET takes care of creating the SOAP envelope.  On the consuming side, you set w "Web Reference" and ASP.NET creates the SOAP to call the web method and pass the dataset.

I'll gin up a real simple web service and explain how to do the same.  I'll post this (hopefully) by the end of the evening.

John
ASKER CERTIFIED SOLUTION
Avatar of jnhorst
jnhorst

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry, there is no "Web References" node.  Just References.  Right click and add a Web Reference.

John
Also, if you could bump up the points a little, that would be cool.  But that's up to you.

John
Avatar of Khaki

ASKER

good job. That will get me started.
Thanks.