How To Integrate wsdl and xsd Files By Using wsdl.exe

How To Integrate wsdl and xsd Files By Using wsdl.exe

Dec 14

When you work inside platform independent teams, web services and service oriented approaches are valuable. Especially in telecommunication sector, systems are mostly constructed on Unix – Linux based OS platforms and Java, C,  C++, Perl based software products and services. But the world is converging to each other day by day, companies share their services with outside or corporate with other companies. Value Added Service (for example the business corporation between a telecom company and a finance company) are the most chosen way of making a difference.

In a world that has more broaden borders than it has never before changes the architectures and design types of software. Contract First Design comes into prominence inside this kind of world. Teams or companies that uses different types of platform and works for the same project goal, starts to design their systems as black boxes tries to identify communication methods and services that they will share with each other.

In xml web services world this means to prepare your wsdl file to describe what kind of functionality you share with outsiders and xsd files that provides necessary metadata to describe data that will transform through communication channel. These are boundaries of these two black box systems which are basically the fundamentals of successful integration project.

What is next then? Read more…

Then you will generate your services provider classes or service consumer proxy object. In Microsoft world developers uses wsdl.exe to create xml web services engaged with web services extensions or svcutil.exe for wcf based services.

Think about a scenario. A finance company sends the description files of their service for your consuming. This files are wsdl files and xsd files and the finance company implemented their service by using Java. No problem, if it does not include complex java dependent types it can easily be defined in xsd files.

The only thing you have to do is integrating these wsdl and xsd files with each other to create your appropriate proxy class. Put all these files together in a folder and for your generation configuration create an xml file. Xml file will define the relation between wsdl and xsd files and the type of generated class. Will it be a service provider or consumer class.

<wsdlParameters  xmlns="http://microsoft.com/webReference/">
  <nologo>true</nologo>
  <parsableerrors>true</parsableerrors>
  <sharetypes>false</sharetypes>
  <documents>
    <document>[FULLY QUALIFIED PATH OF YOUR LOCAL WSDL FILE]</document>
    <document>[FULLY QUALIFIED PATH OF YOUR LOCAL XSD FILE REFERENCED BY WSDL FILE]</document>
  </documents>
</wsdlParameters>

If you are trying to generate a service provider side of the project, you should simply specify a type block for your purpose like server which has been shown below. You should put this tags after documents block inside wsdlparameters block.

  <webReferenceOptions>
    <verbose>false</verbose>
    <style>server</style>
  </webReferenceOptions>

After the preparation of wsdl parameters files you can write this command prompt command to generate classes in your .net based programming language.

wsdl.exe /l:cs /parameters:[FULLY QULIFIED PATH OF YOUR PREPARED XML FILE]

Here /l parameter indicates the language as C#.  You may turn it to vb for Visual Basic.NET

Leave a Reply