I need to call a webservice, and the provided WSDL uses document literal mode, and I’m struggling to implement this correctly. The documentation1 for xsoDocument
says:
During importing with the Service Builder the “Enable Special Handling for .NET wrapped parameters” options has to be set.
However I cannot find this option in the Service Builder (v9.6.113), and searches has not turned up anything useful. I’ve added a single parameter and result parameter of type XML but the generated SOAP message wraps the supplied XML in the parameter name, which is not what I want. Here’s what I want to end up with, structure-wise:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<EmmaStatus>
<!-- status data here -->
</EmmaStatus>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Here’s what I end up with currently:
<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:HNS="http://tempuri.org/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
</SOAP-ENV:Header>
<SOAP-ENV:Body xmlns:ro="http://tempuri.org/">
<v1:Status xmlns:v1="http://tempuri.org/">
<parameters>
<Status xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="XML_Status.xsd">
<!-- status data here -->
</Status>
</parameters>
</v1:Status>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Here’s the WSDL, I changed some namespaces but otherwise verbatim:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema" name="GoodsNumber"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
targetNamespace="http://goodsnumber.example.com"
xmlns:tns="http://goodsnumber.example.com">
<wsdl:types>
<xs:schema elementFormDefault="qualified">
<xs:import schemaLocation="XML_Status.xsd"/>
<xs:element name="InboundInterface___GoodsNumberResponse"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="InboundInterface___GoodsNumber">
<wsdl:part name="parameters" element="Status"/>
</wsdl:message>
<wsdl:message name="InboundInterface___GoodsNumberResponse">
<wsdl:part name="parameters" element="InboundInterface___GoodsNumberResponse"/>
</wsdl:message>
<wsdl:portType name="InboundInterface">
<wsdl:operation name="GoodsNumberResponse">
<wsdl:input message="tns:InboundInterface___GoodsNumber"/>
<wsdl:output message="tns:InboundInterface___GoodsNumberResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="InboundInterfaceBinding" type="tns:InboundInterface">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GoodsNumberResponse">
<soap:operation soapAction="http://goodsnumber.example.com" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="InboundInterface">
<wsdl:port name="InboundInterfacePort" binding="tns:InboundInterfaceBinding">
<soap:address location="http://localhost:8099/SOAP?service=InboundInterface"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
In the Service Builder I used the WSDL importer which gave me the operation with a single parameter named parameters
, which I set to type Xml
, no attributes.
Any tips?