views:

750

answers:

1
  1. You are given a WSDL and a sample soap message, is there a good tutorial or sample code in using that WSDL to consume a web service? Does the WSDL follow a certain format in order for which it can be consumed properly? I recall a web service in Java that I changed certain tags and attributes in order for this to work, is there a general convention for the formatting used in WSDLs?

  2. I think this might be harder than #1. You are given a WSDL and a sample soap message. Is there a way to use that given WSDL and not the WSDL generated by C# web service when exposing a web service? Is there a way to somehow "override" the WSDL of the web service to the given web service? Are there any conflicts in formatting and compatibility of the WSDL that ought to be considered?

A: 

The quickest and most painless approach is simply to use svcutil to generate the code representing the WSDL. At that point the code produced can be used as a client to query an existing service or you can define a class implemeting the service contact. Once you have the .NET classes the SOAP message example will just serve as documentation.

the default usage would be want you most likely want

svcutil myRemoteService.wsdl

which will generate a a file named [servicename].CS file and an output.config containing the necessary WCF client bindings.

Not sure what you mean by overriding the WSDL as it is the published contract that the service honors. So if you want to change method signatures or behavior it will no longer work as the change will no longer conform to the WSDL.

Tedford