[Warning: Long post. My actual questions are highlighted at end of the post]
I’m integrating webMethods with a set of .NET ASP webservices defined by a WSDL. The WSDL specifies ‘targetNamespace’ and ‘xmlns:tns’ attributes in the first line.
The one WSDL defines about 20 webservices. Here’s part of it defining a ‘GetOrder’ webservice with a ‘login’ string input:
<wsdl:definitions [b]xmlns:tns="http://tempuri.org/" targetNamespace="http://tempuri.org/" [/b] ...>
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
...
<s:element name="GetOrder">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="login" type="s:string" />
webMethods automatically generated 20-odd ‘webservice connectors’ from the WSDL - all have a ‘tns1’ namespace prefix in every document element. e.g. The ‘login’ element above was generated as ‘tns1:GetOrder/tns1:login’
When executing the webservice call (say, ‘GetOrder’), the remote webservice returns normal looking XML:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetOrderResponse xmlns="http://tempuri.org/">
<GetOrderResult>
<Header>
<IsHistoric>true</IsHistoric>
<CardNumber/>
However, webMethods then calls pub.soap.utils:getBody and maps the XML above to its datastructure with prefixes:
soapBody/
tns1:GetOrderResponse/
tns1:GetOrderResult/
tns1:Header/
tns1:IsHistoric="true"
tns1:CardNumber
Screenshot: [url]wmusers.com
So… it all works, but where do the ‘tns1’ prefixes come from?
The string ‘tns1’ is not in the original WSDL, nor in the webMethods ‘SOAP Developers Guide’ PDF.
Could the ‘tns1’ prefixes cause any maintenance problems in future?
Lets say I need to add new webservice calls defined in a new version of the WSDL. Will IS safely update existing webservice connectors and use the same ‘tns1’ prefix in documents?
UPDATE
I tested reimporting a WSDL into a folder where it had been imported previously. IS does not change the documents ( ‘ServiceSoap:doc’ folder), but generates new webservice connectors with ‘_1’ prefix (e.g. ‘ServiceSoap:GetOrder_1’).
Recommendations for B2B webservices in a Trading Networks environment
For example, do you normally log the results of a webservice call in Trading Networks? I was hoping to store the ‘normal looking’ SOAP response (as returned by the ‘GetOrder’ webservice) as a TN document for use in logging, resubmitting, etc. But unless I do some custom coding, I’ll have to define the TN document type as the tns1-prefix-happy webMethods structure returned by the webservice connector.