Skip to Content
Technical Articles

Consuming Webservices with tag in WSDL using XSLT

<body><p> Have you

seen the blog <a href=”” target=”_top”>Consuming

Webservices with <ANY> tag in WSDL using ABAP</a>  where posted the ABAP solution of empty structures in .Net WEB

services? This blog shows another approach – XSLT mapping program.</p>

<p>The problem is in that fact that WSDL file generated with .Net WEB service

(MS Project server, MS SharePoint server, etc.) contains link</p><p> </p>

<table border=”0″ width=”100%” style=”background-color: #eeeeee”>

<tbody><tr> <td><pre><s:any namespace=” …  ” xmlns:s=”” /></pre></td></tr></tbody></table><p> </p><p>in element </p><p> </p>

<table border=”0″ width=”100%” style=”background-color: #eeeeee”>   <tbody><tr><td>

<pre><s:sequence  xmlns:s=”“> … </s:sequence></pre>


<p> </p><p>of message type definition. Here target is in “namespace”

attribute. Using this WSDL in SAP XI/PI, you will get a message without fields

in message mapping. At runtime there will be only one element with whole

message into it as its value. </p><p> </p>

<p>You can modify WSDL copying this structure in “sequence” element

of cause but to my mind it is not right way.</p><p> </p>


ABAP is not suitable in some cases, especially when you haven’t got OSS key.</p>

<p>I have

solved this problem using XSLT.   </p>

<p>So, I got a

response from MS Project’s WEB service like this:</p><p> </p>

<table border=”0″ width=”100%” style=”background-color: #eeeeee”>   <tbody><tr><td>

<pre> <?xml version=”1.0″ encoding=”UTF-8″?><br /> <ReadProjectListResponse xmlns=”“><br /> <ReadProjectListResult><br /> <xs:schema … > … </xs:schema><br /> <diffgr:diffgram xmlns:msdata=”urn:schemas-microsoft-com:xml-msdata” xmlns:diffgr=”urn:schemas-microsoft-com:xml-diffgram-v1″><br /> <ProjectDataSet xmlns=”“><br />     <Project diffgr:id=”Project1″ msdata:rowOrder=”0″ diffgr:hasChanges=”inserted”><br />        <PROJ_UID>674457db-7ff1-4e24-81b3-b41d5594f27f</PROJ_UID><br />        <PROJ_NAME>Project1</PROJ_NAME><br />     </Project><br />     <Project diffgr:id=”Project2″ msdata:rowOrder=”1″ diffgr:hasChanges=”inserted”><br />        <PROJ_UID>3dc33ef5-c796-4b01-8707-3b1f225f741c</PROJ_UID><br />        <PROJ_NAME>Project2</PROJ_NAME><br />     </Project><br /></ProjectDataSet><br /></diffgr:diffgram><br /></ReadProjectListResult><br /></ReadProjectListResponse></pre>


<p>          </p><p>In this

message I want to get a list of  Projects UIDs (<PROJ_UID>). </p>

<p>First step was “cut” redundant namespaces using <a href=”” target=”_blank”>XMLAnonymizerBean

module</a></p><p> </p>

<p><img  /></body>

You must be Logged on to comment or reply to a post.