views:

262

answers:

2

I have received few WSDLs and XSD defining a service that I need to consume for one of my project.

Now here is a similar structure:

*XSD_EMPDetails.xsd* - Define few of the EmployerDetails

*XSD_EMP.xsd* - has imported EmployerDetails xsd and some more attributes. (xsd import)

EMP.wsdl - imports XSD_EMP.xsd (xsd import)

EMPServcie.wsdl - imports EMP.wsdl. (wsdl import)

Now I need to consume EMPService.wsdl to call service. Not sure how to use XSD and how it works internally. Please provide me any reference or any help on this topic.

Note: Currently we are working on 2.0 with ASMX. Cannot use WCF.

+1  A: 

Just use WSDL.EXE and specify all the files on the command line. It will create all of the proxy classes for you, and you can then include them in your project.


First of all, try "WSDL /?" to see the options. I believe the command line you want would be:

WSDL EMPServcie.wsdl EMP.wsdl XSD_EMP.xsd XSD_EMPDetails.xsd
John Saunders
Thanks John. I have 4 files with me, with Import specified for file from some URL. Do I need to change URL to local directory. How do I do it?
noob.spt
Also, can you shed some more light on whats the whole purpose of XSD and how .net is taking care of it. The way I am seeing it (as I asked in my previous question http://stackoverflow.com/questions/1561877/whats-great-deal-about-asmx-services ) that it came back again to just using WSDL and generating proxy and calling some methods. May be if you can provide some reference discussing internal details. Thanks.
noob.spt
I don't believe that the URL is used at all. That's why you have to specify the files on the command line. XSD.EXE is used for several purposes, including reading a set of XML schemas and producing classes which, when serialized, will produce XML that validates against the schemas. WSDL.EXE does this, but also creates proxy types corresponding to the operations in the WSDL files.
John Saunders
A: 

You should avoid wsdl.exe and ASMX, and instead use svcutil.exe - this tool will generate WCF proxy classes for you.

Cheeso
Currently working on 2.0 with ASMX. Cannot use svcutil.exe
noob.spt