cancel
Showing results for 
Search instead for 
Did you mean: 

WSDL - s:any handling & string to structure

Former Member
0 Kudos

Hi,

We have a WSDL supplied to us by a partner, generated by Visual Studio. Helpfully it doesnt actually declare or include the XSD structures within the Type definitions. There are 2 scenarios (examples below) that I need to deal with.

1) They declare the xml as a string so this will need to be converted to a structure and passed to an appropriate MI. (in the BPE so that errors are handled).

2) They declare the structure as <s:any /> which is valid WSDL but not so helpful to XI as it doesnt know what to do with it.

If I define TheRequest and TheResponse from the WSDL in a Mapping then I can only see as far as TheRequestXML and TheResponseXML, no deeper. I can see no Node operation to map 1 field to a whole structure.

It would be possible to do this in XSLT or a Java Mapping but that seems like the wrong way of going about this as it cant be that uncommon an occurance.

The XSD does not have any visibility of the methods in the WSDL (TheRequest / TheRequestXML etc).

I can work around this by hacking the WSDL to include & use the types in the XSD explicitly, but that again seems wrong.


Namespace is defined 
xmlns:s="http://www.w3.org/2001/XMLSchema"
.....
<wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://www.somewhere.com/">
      <s:element name="TheRequest">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="TheRequestXML" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="TheResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="TheResponseXML">
              <s:complexType mixed="true">
                <s:sequence>
                  <s:any />
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
  </wsdl:types>

Thanks

James

Accepted Solutions (0)

Answers (1)

Answers (1)

udo_martens
Active Contributor
0 Kudos

Hi James,

i'm not clear with your question. Can you explain the technical part of the task - what do you want to do by forum people explizit?

Regards,

Udo

Former Member
0 Kudos

The message structure is defined in 2 parts:


WSDL
  +--> XSD

When someone calls the Soap Sender and sends over some data (a SOAP message) and this contains a structure like:


<some method>
 <some top level soap / wsdl node>
.... importing or including 
  <some top level xsd node>
   <rest of structure>
....

The maps then map any of the above nodes as the MI's use the top level soap methods. The problem is that unless the WSDL explicitly defines the Type from the XSD (rather than using s:any or just sticking it in a string) then the fields are not visible to any maps.

I agree it's not ideal, but hey I didnt design the WSDL

I just want to know how to handle these 2 scenarios and map the s:any and string to the (known) XSD structure so it may be used as normal in a further map.

Cheers

James

udo_martens
Active Contributor
0 Kudos

Hi James,

so you want to know, how to map a content into a namespace and how to serialize a xml message to a string?

Regards,

Udo

Former Member
0 Kudos

Sounds about right to me!

Cheers

udo_martens
Active Contributor
0 Kudos

Hi James,

you can do that with a XSLT stylesheet using <i>xsl:text</i> and the attribut <i>disable-output-escaping</i>.

For the namespace just build your root element including the namespace declaration and the prefic like (not tested):

<xsl:text disable-output-escaping="yes"><![CDATA[<pre><code></xsl:text>

Serialize with

<xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[

]]
>]]>

Regards,

Udo