Hi Folks!
I am glad to be back…Been a good week. My landlord sent the boys around to my spot in Amsterdam, since I had taken him
to this organization that can reduce you rent if you feel they over charging and providing $%^ service. Naturally I won the case,
and he sent the boys around. I decided life is to short to mingle and jingle with rubbish, so I moved out of my shared apartment
and am loving my privacy! Waiting for the girl to visit, so in the mean time, lets BLOG!!!
I want you to sit on you chair and imagine all the Microsoft haters out there! How many customers did you deal with that
had a natural affinity to disliking anything you developed because the product started with some like M…….. .It is amazing,
imagine Microsoft made Mozilla FireFox and Mozilla made Internet Explorer. I bet those Penguin geek books would be boasting
just how better IE is compared to Mozilla Firefox.
Introduction
I had a difficult customer today, they refuse to use our web service, since it is not WS-I compliant. True to their word,
I check the report and indeed it failed. How can this be? Microsoft states their web services are compliant.
Well, in this part I am going to show you exactly how to make sure yours is compliant and then you can skip the bureaucrats
and carrying on Geeking.
To sum up, by default when you create a web service, the WSDL automatically generated will also have the SOAP 1.2 binding,
and this binding is not widely in use, so the best thing to do is disable it.
When you develop a web service, the following attribute is situated above the class name of the web service:
/// <summary> |
However, it is possible that the WS-I profile conformance report (What is that?) can fail it. Well, I noticed why the customer
refused to use our web service, this was due to them running the reporting against our SOAP 1.2 binding and not SOAP 1.1
binding, naturally you would expect people to use 1.1 since 1.2 is not De Facto yet. So to hide 1.2 binding, you can use the
following in the web.config. I will explain why SOAP 1.2 binding fails on the WSDL auto generated, even with a Microsoft Hello
World simple web service.
<system.web> |
To remove SOAP 1.2 bindings from the WSDL, all you need to do is insert the above code in your web.config.
WS-I Conformance Report
This article will provide a step by step approach to generating WS-I conformance reports on Windows XP systems.
Install Java
Download and Install from Sun Micro Systems, current release I used is Java 6 update 11
http://java.sun.com/javase/downloads/index.jsp
Install SOAPUI 2.5
Download Location: http://sourceforge.net/project/showfiles.php?group_id=136013&package_id=163662&release_id=641323
I use the soapUI-2.5-installer.exe
Interoperability Testing Tools 1.1
Download Location: http://www.ws-i.org/Testing/Tools/2005/06/WSI_Test_Java_Final_1.1.zip
You may be tempted to use the C# version, however, it is bugged. It will not work correctly with complex WSDL documents.
I find it ridiculous that the ws-i.org published critical conformance tools that are intrinsically flawed. I used the C# version of
the tools and it failed our WSDL on the basis that it could not validate the embedded schema! The java version is your safest bet,
but why they publish a flawed version? You can read more about this here:
http://www.ws-i.org/Testing/Tools/2004/02/Testing_Tools_1.00.01_Known_Issues.htm
When I install the tool, I unzip it to a folder location. Then you must create a environment variable for the location, afterwards
you must REBOOT the system.
Note that the folder locations for TEMP will be used to store temporary files from the SOAPUI tool, and this can be a handy
place to look for diagnostics.
Run SOAPUI
- Start SOAPUI
- Click on the file menu and select preferences
- Click WS-I Settings and ensure you settings are correct, here are mine, ensure they point to the java tool folder!
- Below is what the wsi-test-tools folder contains:
- Notice the README.TXT is using version WS-I Testing Tools V1.1. However when we generate the report using
SOAPUI, the xslt that is used to generate the report is bugged, it will always say that you used 1.0.0!
Now we in a position to generate the report. Fist we need to create a project and point it to the WSDL of the web service
we created in Part 1 of this blog series. By default Microsoft generates binding information for SOAP 1.1 and SOAP 1.2. So lets
create the project.
- Right click the projects in the left pain and click new project.
- We now point the project to the WSDL online or to a local WSDL file. I point it to a live URL.
- This was my URL I inserted:
http://10.0.1.225/Romiko.Audit.WebServices/AuditWebService.asmx?wsdl - Once this is done, the SOAPUI tool will automatically show the bindings on the left and so on.
Notice that the web service we developed has both SOAP 1.1 and SOAP 1.2 published!
As you can see above, SOAP 1.1 is just called AuditWebServiceSoap - Right Click the AuditWebServiceSoap binding and click Check WSI Compliance, not the 1.2 version!
- I get the following output on my machine:
Running WSI Analyzer for [AuditWebServiceSoap]
directory: C:\downloads\wsi-test-tools\java\bin
command: [cmd.exe, /C, Analyzer, -config, C:\DOCUME~1\romiko\LOCALS~1\Temp\wsi-analyzer-config30438.xml, -assertionDescription, true]
Conformance Analyzer Tool, Version: 1.0.0, Release Date: 2005-07-04
Copyright (C) 2002-2003 by The Web Services-Interoperability Organization and Certain of its Members. All Rights Reserved.
Use of this Material is governed by WS-I licenses included within the documentation.
verbose ……………….. true
Assertion Results:
type ………………… all
messageEntry …………. true
assertionDescription ….. true
failureMessage ……….. true
failureDetail ………… true
Report File:
replace ……………… true
location …………….. C:\DOCUME~1\romiko\LOCALS~1\Temp\wsi-report30436.xml
Style Sheet:
href ………………. ./../common/Profiles/SSBP10_BP11_TAD.xml
type ………………. text/xsl
alternate ………….. false
testAssertionsFile ……… ../../common/profiles/SSBP10_BP11_TAD.xml
WSDL Reference:
WSDL Element:
type ………………. binding
namespace ………….. http://romiko.audit.com
name ………………. AuditWebServiceSoap
wsdlURI ……………… C:\DOCUME~1\romiko\LOCALS~1\Temp\tempdir30437.tmp\AuditWebService_1.wsdl
Please wait while the specified artifacts are analyzed…
Processing BP2201 for entry reference ID [file:/C:/DOCUME~1/romiko/LOCALS~1/Temp/tempdir30437.tmp/AuditWebService_1.wsdl] …
Elapsed time: 15ms
Processing BP2700 for entry reference ID [file:/C:/DOCUME~1/romiko/LOCALS~1/Temp/tempdir30437.tmp/AuditWebService_1.wsdl] …
Elapsed time: 0ms
Processing BP2701 for entry reference ID [file:/C:/DOCUME~1/romiko/LOCALS~1/Temp/tempdir30437.tmp/AuditWebService_1.wsdl] …
Elapsed time: 16ms
Processing BP2703 for entry reference ID [file:/C:/DOCUME~1/romiko/LOCALS~1/Temp/tempdir30437.tmp/AuditWebService_1.wsdl] …
Elapsed time: 94ms
Processing BP2034 for entry reference ID [file:/C:/DOCUME~1/romiko/LOCALS~1/Temp/tempdir30437.tmp/AuditWebService_1.wsdl] …
Elapsed time: 0ms
Processing BP2018 for entry reference ID [file:/C:/DOCUME~1/romiko/LOCALS~1/Temp/tempdir30437.tmp/AuditWebService_1.wsdl] …
Elapsed time: 0ms
Processing BP2101 for entry reference ID [file:/C:/DOCUME~1/romiko/LOCALS~1/Temp/tempdir30437.tmp/AuditWebService_1.wsdl] …
Elapsed time: 0ms
Processing BP2103 for entry reference ID [file:/C:/DOCUME~1/romiko/LOCALS~1/Temp/tempdir30437.tmp/AuditWebService_1.wsdl] …
Elapsed time: 0ms
Processing BP2104 for entry reference ID [file:/C:/DOCUME~1/romiko/LOCALS~1/Temp/tempdir30437.tmp/AuditWebService_1.wsdl] …
Elapsed time: 0ms
Processing BP2105 for entry reference ID [file:/C:/DOCUME~1/romiko/LOCALS~1/Temp/tempdir30437.tmp/AuditWebService_1.wsdl] …
Elapsed time: 0ms
Processing BP2416 for entry reference ID [file:/C:/DOCUME~1/romiko/LOCALS~1/Temp/tempdir30437.tmp/AuditWebService_1.wsdl] …
Elapsed time: 0ms
Processing BP2417 for entry reference ID [file:/C:/DOCUME~1/romiko/LOCALS~1/Temp/tempdir30437.tmp/AuditWebService_1.wsdl] …
Elapsed time: 0ms
Processing BP2123 for entry reference ID [file:/C:/DOCUME~1/romiko/LOCALS~1/Temp/tempdir30437.tmp/AuditWebService_1.wsdl] …
Elapsed time: 0ms
Processing BP4200 for entry reference ID [file:/C:/DOCUME~1/romiko/LOCALS~1/Temp/tempdir30437.tmp/AuditWebService_1.wsdl] …
Elapsed time: 0ms
Processing BP4201 for entry reference ID [file:/C:/DOCUME~1/romiko/LOCALS~1/Temp/tempdir30437.tmp/AuditWebService_1.wsdl] …
Elapsed time: 0ms
Processing BP2202 for entry reference ID [file:/C:/DOCUME~1/romiko/LOCALS~1/Temp/tempdir30437.tmp/AuditWebService_1.wsdl-Types] …
Elapsed time: 0ms
Processing BP2102 for entry reference ID [file:/C:/DOCUME~1/romiko/LOCALS~1/Temp/tempdir30437.tmp/AuditWebService_1.wsdl-Types] …
Elapsed time: 0ms
Processing BP2011 for entry reference ID [file:/C:/DOCUME~1/romiko/LOCALS~1/Temp/tempdir30437.tmp/AuditWebService_1.wsdl-Types] …
Elapsed time: 0ms
Processing BP2107 for entry reference ID [file:/C:/DOCUME~1/romiko/LOCALS~1/Temp/tempdir30437.tmp/AuditWebService_1.wsdl-Types] …
Elapsed time: 0ms
Processing BP2108 for entry reference ID [file:/C:/DOCUME~1/romiko/LOCALS~1/Temp/tempdir30437.tmp/AuditWebService_1.wsdl-Types] …
Elapsed time: 0ms
Processing BP2110 for entry reference ID [file:/C:/DOCUME~1/romiko/LOCALS~1/Temp/tempdir30437.tmp/AuditWebService_1.wsdl-Types] …
Elapsed time: 0ms
Processing BP2122 for entry reference ID [file:/C:/DOCUME~1/romiko/LOCALS~1/Temp/tempdir30437.tmp/AuditWebService_1.wsdl-Types] …
Elapsed time: 0ms
Processing BP4202 for entry reference ID [file:/C:/DOCUME~1/romiko/LOCALS~1/Temp/tempdir30437.tmp/AuditWebService_1.wsdl-Types] …
Elapsed time: 0ms
Processing BP2020 for entry reference ID [{http://romiko.audit.com}AuditWebServiceSoap] …
Elapsed time: 0ms
Processing BP2021 for entry reference ID [{http://romiko.audit.com}AuditWebServiceSoap] …
Elapsed time: 0ms
Processing BP2402 for entry reference ID [{http://romiko.audit.com}AuditWebServiceSoap] …
Elapsed time: 0ms
Processing BP2022 for entry reference ID [{http://romiko.audit.com}AuditWebServiceSoap] …
Elapsed time: 0ms
Processing BP2032 for entry reference ID [{http://romiko.audit.com}AuditWebServiceSoap] …
Elapsed time: 0ms
Processing BP2404 for entry reference ID [{http://romiko.audit.com}AuditWebServiceSoap] …
Elapsed time: 0ms
Processing BP2012 for entry reference ID [{http://romiko.audit.com}AuditWebServiceSoap] …
Elapsed time: 0ms
Processing BP2406 for entry reference ID [{http://romiko.audit.com}AuditWebServiceSoap] …
Elapsed time: 0ms
Processing BP2019 for entry reference ID [{http://romiko.audit.com}AuditWebServiceSoap] …
Elapsed time: 0ms
Processing BP2013 for entry reference ID [{http://romiko.audit.com}AuditWebServiceSoap] …
Elapsed time: 0ms
Processing BP2017 for entry reference ID [{http://romiko.audit.com}AuditWebServiceSoap] …
Elapsed time: 0ms
Processing BP2111 for entry reference ID [{http://romiko.audit.com}AuditWebServiceSoap] …
Elapsed time: 0ms
Processing BP2112 for entry reference ID [{http://romiko.audit.com}AuditWebServiceSoap] …
Elapsed time: 0ms
Processing BP2113 for entry reference ID [{http://romiko.audit.com}AuditWebServiceSoap] …
Elapsed time: 0ms
Processing BP2117 for entry reference ID [{http://romiko.audit.com}AuditWebServiceSoap] …
Elapsed time: 0ms
Processing BP2118 for entry reference ID [{http://romiko.audit.com}AuditWebServiceSoap] …
Elapsed time: 0ms
Processing BP2114 for entry reference ID [{http://romiko.audit.com}AuditWebServiceSoap] …
Elapsed time: 15ms
Processing BP2119 for entry reference ID [{http://romiko.audit.com}AuditWebServiceSoap] …
Elapsed time: 0ms
Processing BP2120 for entry reference ID [{http://romiko.audit.com}AuditWebServiceSoap] …
Elapsed time: 0ms
Processing SSBP2209 for entry reference ID [{http://romiko.audit.com}AuditWebServiceSoap] …
Elapsed time: 0ms
Processing SSBP2403 for entry reference ID [{http://romiko.audit.com}AuditWebServiceSoap] …
Elapsed time: 0ms
Processing BP2010 for entry reference ID [{http://romiko.audit.com}AuditWebServiceSoap] …
Elapsed time: 0ms
Processing BP2208 for entry reference ID [AuditComplex] …
Elapsed time: 0ms
Processing BP2014 for entry reference ID [AuditComplex] …
Elapsed time: 0ms
Processing BP2208 for entry reference ID [AuditSimple] …
Elapsed time: 0ms
Processing BP2014 for entry reference ID [AuditSimple] …
Elapsed time: 0ms
Processing BP2115 for entry reference ID [{http://romiko.audit.com}AuditComplexSoapIn] …
Elapsed time: 0ms
Processing BP2116 for entry reference ID [{http://romiko.audit.com}AuditComplexSoapIn] …
Elapsed time: 0ms
Processing BP2115 for entry reference ID [{http://romiko.audit.com}AuditSimpleSoapIn] …
Elapsed time: 0ms
Processing BP2116 for entry reference ID [{http://romiko.audit.com}AuditSimpleSoapIn] …
Elapsed time: 0ms
Processing BP2115 for entry reference ID [{http://romiko.audit.com}AuditComplexSoapOut] …
Conformance report has been created.
Elapsed time: 0ms
Processing BP2116 for entry reference ID [{http://romiko.audit.com}AuditComplexSoapOut] …
Elapsed time: 0ms
Processing BP2115 for entry reference ID [{http://romiko.audit.com}AuditSimpleSoapOut] …
Elapsed time: 0ms
Processing BP2116 for entry reference ID [{http://romiko.audit.com}AuditSimpleSoapOut] …
Elapsed time: 0ms
- There is a couple of things to notice, first a xml version of the report and html version are created. The HTML version
is done by SOAPUI and the xml version by the WSI-TOOLS Analyzer.exe file. My xml report is located here:C:\DOCUME~1\romiko\LOCALS~1\Temp\wsi-report30436.xml
- The html report is located in c:\wsi-report30439.html on my machine. SOAPUI also shows the report, the summary result
of the report is a PASS. - Now lets do the same report for the SOAP 1.2 binding! It will fail, and this is a problem i guess with the way Microsoft
specified the style attribute. In Soap 1.2 it needs to be at the wsdl:binding level and not only the operation level. - If I look at the details of the report, this is what failed:
BP2402 FAILED. - What does this mean. Well, if we open this document in the WSI-Tools folder:
C:\downloads\wsi-test-tools\common\profiles\BasicProfile_1.1_TAD.xml
I get this:
<!– _________________BP2402___________________ –>
<testAssertion id="BP2402" entryType="binding" type="required" enabled="true">
<context>For a candidate wsdl:binding element</context>
<assertionDescription>The wsdl:binding element has a soapbind:binding child element.</assertionDescription>
<failureMessage>The wsdl:binding element does not use a soapbind:binding element as defined in section "3 SOAP Binding." of the WSDL 1.1 specification.</failureMessage>
<failureDetailDescription>wsdl:binding.</failureDetailDescription>
<additionalEntryTypeList/>
<prereqList>
<testAssertionID>BP2703</testAssertionID>
</prereqList>
<referenceList>
<reference profileID="BP11">R2401</reference>
</referenceList>
<comments/>
</testAssertion> - This shows that Microsoft’s SOAP 1.2 binding should never be run against a PROFILE 1.1 conformance, else you will get
problems. It seems that even building simple web services under SOAP 1.2 will fail conformance with the .NET Framework.
The failure here is:http://www.ws-i.org/Profiles/BasicProfile-1.0-2004-04-16.html
5.5.1 Use of SOAP Binding
The Profile limits the choice of bindings to the well defined and most commonly used SOAP binding.
MIME and HTTP GET/POST bindings are not permitted by the Profile.R2401 A
wsdl:binding
element in a DESCRIPTION MUST use WSDL SOAP Binding as defined in WSDL 1.1 Section 3.Note that this places a requirement on the construction of conformant
wsdl:binding
elements. It does not place a
requirement on descriptions as a whole; in particular, it does not preclude WSDL documents from containing
non-conformantwsdl:binding
elements. - I recently had a client who ran his conformance reports against our SOAP 1.2 binding, and it failed and we lost allot of
time rectifying the problem with them. In the end, the best solution is to just not publish it. - So, I edit my web,.config and to remove SOAP 1.2 binding, then when I recreate a project to the same web service, the
soap 1.2 binding will not be visible!
<?xml version="1.0"?>
<configuration>
<configSections>
</configSections>
<appSettings/>
<connectionStrings>
<add name="AuditDatabase" connectionString="Data Source=(local);Initial Catalog=Audit;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<compilation debug="true" />
<authentication mode="Windows" />
<trust level="Full" />
<webServices>
<protocols>
<remove name="HttpSoap12"/>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
</system.web>
</configuration> - Now I recreate the project in SOAPIO and voila, no more SOAP 1.2, and your customers cannot fail your reports 🙂
- Some other problems I notice with the SOAP 1.2 is the document style attribute only being defined on the Operation Level
and not the Binding level:
Notice style="document" is not defined on the wsdl:binding level. This is mentioned in the ws-i profile:http://www.ws-i.org/Profiles/BasicProfile-1.0-2004-04-16.html
R2705 A wsdl:binding in a DESCRIPTION MUST either be an rpc-literal binding or a document-literal binding.Hopefully Microsoft will notice this bug with the way the .NET libraries auto generate the WSDL. Also it wold be cool if
XSD.exe tool supports Imports, Includes
Generating the report with the command console.
You can also generate the report from the command console, however it is only xml report.
First you need an XML Configuration file and a path to the wsdl.
<?xml version="1.0" encoding="UTF-8"?> |
Here is my command run:
C:\downloads\wsi-test-tools\java\bin>dir Directory of C:\downloads\wsi-test-tools\java\bin 15-07-2005 15:29 <DIR> . C:\downloads\wsi-test-tools\java\bin>Analyzer -config C:\WSIReports\wsi-analyzer |
Output:
C:\downloads\wsi-test-tools\java\bin>Analyzer -config C:\WSIReports\wsi-analyzer verbose ……………….. true Please wait while the specified artifacts are analyzed… |
Here is the XML report:
<?xml version="1.0" encoding="UTF-8"?> <artifact type="discovery"> {http://schemas.xmlsoap.org/wsdl/mime/}content, |
Conclusion
This article has shown you how to test if your web service conforms to the WS-I Basic profile 1.1 standards. SOAP 1.2
and Microsoft’s WSDL does not conform, well so it seems, and maybe in the future this will be addressed with new wsi-tools
for SOAP 1.2, would be nice if Microsoft can get involved and get the C# version of the tool which is heavily bugged
working correctly for the ws-i org.
Also, SOAPUI is not needed to create a report, you can use the Analzyer command (The Java version, C# version is bugged).
Remove SOAP 1.2 bindings using the web.config. Do not trust all the tools out there, they have bugs!
You can download the tools on this site, except for Java.
- Uncategorized