Your service WSDL file is the contract between you and your web service clients. Whether you manually write the WSDL or let your framework automatically generate it for you - you want to make sure it is valid (otherwise you'l have no clients!).
There is more than one way to define the validity of a WSDL: Does it need to be valid according the WSDL XML schema? Does it need to comply to known best practices? Does it need to be parsed correctly by common soap stacks? There are different ways to test each of these requirements. Commercial tools, like XMLSpy, can help you with some. Today I'll show you a free alternative: the WSI test tool. WSI is the web services interoperability organization and it has defined the WSDL "basic profile" - a set of best practice recommendations for WSDLs. They have also published a tool that can tell you if your WSDL confirms to this profile and today I'll show you how to use it.
Update: WsiHero is A GUI utility to validate Wsdl / Soap using the latest WSI profile.
Step 1 - Download the WSI test tool
Go to the downloads page in the WSI site and download "Interoperability Testing Tools 1.1". It has a C# and a Java version - today we will use the C# one but using the Java is similar.
Step 2 - Extract the tool
Just extract the zip to some folder
Step 3 - Configure the test
Copy wsi-test-tools\cs\samples\analyzerConfig.xml to wsi-test-tools\cs\bin and open it with a text editor. Change the following values:
So take the value of the "targetNamespace" from here and put its value in the "namespace" attribute of the "wsdlElement" element in the configuration. Also take the value of the "name" element and put it in the "wsdlElement" element value. So the "wsdlElement" configuration may look like:
Note: If you have a few "wsdl:Binding" in your wsdl you should repeat this for each one.
Step 4 - Run the test
Open command line and go to the wsi-test-tools\cs\bin directory. Then run:
Step 5 - Analyze the results
The wsi-test-tools\cs\bin folder now contains a file report.xml. Open it in internet explorer to view the results.
Update: WsiHero is A GUI utility to validate Wsdl / Soap using the latest WSI profile. What's next? get this blog rss updates or register for mail updates!
0 comments:
Post a Comment