tags:

views:

32

answers:

1

I'm using an ASP.NET web service with some large and complex structures. I can examine the WSDL and use it to generate code for my (Delphi) application. And it all works just fine.
I also have a (homemade) message viewer which captures the SOAP messages and will display it's content. I use it to capture the data sent to and from the server, which is then displayed on-screen in a separate form. That works just fine too.
But now I want to pretty-print the messages that are sent to and from the client. By using Altova's StyleVision I can simply map the XML to some HTML output. But StyleVision can't use the WSDL. (At least not the version I use.) So I need to extract a WSDL from the WSDL. Sounds simple enough...
The WSDL has three s:schema elements inside. By extracting them, merging them into one I almost have a working schema. Unfortunately, the schema has literally hundreds of different namespaces from 'q1' to 'q167' which I can't resolve. For some reason, the WSDL can resolve them! Example: type Client contains

<s:element xmlns:q5="http://schemas.example.com/wsdl/Example" minOccurs="1" maxOccurs="1" name="SexePartner" type="q5:Sexe" />
<s:element xmlns:q6="http://schemas.example.com/wsdl/Example" minOccurs="1" maxOccurs="1" name="Sexe" type="q6:Sexe" />

And type Sexe is defined as:

  <s:simpleType name="Sexe">
    <s:restriction base="s:string">
      <s:enumeration value="Man" />
      <s:enumeration value="Vrouw" />
    </s:restriction>
  </s:simpleType>

To fix this in the XSD, I can just strip away the q6: namespace but as I said, the WSDL is filled with hundreds of these strange namespaces so that's a lot of select&cut work.

I'm lazy, there should be an easier way... :-) (Especially since the WSDL is updated every two months, thus I need to update the XSD's. And yes, it has version checks.)