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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web Service XML Document

Status
Not open for further replies.

Elegabalus

Programmer
Jan 13, 2005
71
CA
This seems like a pretty straight forward question, but I can't seem to find any concrete info when I search.

I have a web service that I'd like to use to return an XML document to my clients.

I have to take into account that non-.NET clients may be consuming the service as well, so I can't just use a DataSet.

What is the best way to go here? What kind of object should I be returning to my client?

Any help is appreciated.
 
Actually I believe that you can return anything you want including a dataset. .Net will create the WSDL document for you and that will define the XML that any client can use .Net or otherwise. .Net Webservices serialize objects including datasets into XML for the client. If you don't believe me create a webservice that returns a dataset and look at the WSDL.







 
But that's mostly my problem: the WSDL contract generated when using a complex type is not very helpful to clients on the other end.

The dataset (and the XMLDocument, I've tried both) create a WSDL that does not contain any information on the actual structure of the response; i.e., it creates a section like:

Code:
<s:sequence>
    <s:any/>
</s:sequence>

I'm trying to create the web service from the contract, first, and create the code that matches the contract.

Any walkthroughs, or guides to help me do that would be appreciated.
 
I see...
Here's how we do it.

1) Create a Schema for the parameter and the response of the webservice
2) use xsd.exe to create the classes from your schema. You can fill these classes in your webservice. When the WSDL is created it will be well defined.
Example of using xsd.exe:
C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin\xsd.exe ..\CommonData.xsd ..\catalog\catalogdata.xsd ..\catalog\catalog.xsd /c /l:cs /n:AIS.WebService.Interface.Facade200602.Contract /o:../Classes


References
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top