targetnamespace in wsdl and soap body
I'm new to sending SOAP requests. I use XMLspy and SOAPUi to construct the SOAP request. I'm happy what each will give. But I would like to understand how the targetnamespace in the wsdl is used to construct the SOAP request.
Can I use the messagename instead of the targetnamespace?
*----- snip of the WSDL ------*
.
.
<xsd:schema targetNamespace="SOAP_Requests" elementFormDefault="qualified">
<xsd:element name="Receive-SOAP-Request">
<xsd:complexType>
<xsd:all>
<xsd:element name="mydata" type="xsd:anyType" minOccurs="1">
<xsd:annotation>
<xsd:documentation>String formatted XML data</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>
.
.
</xsd:schema>
<wsdl:message name="SOAP_Requests_Receive-SOAP-Request-Request">
<wsdl:part name="parameters" element="ns2:Receive-SOAP-Request-Request"/>
</wsdl:message>
.
.
<wsdl:portType name="WorkflowPortType">
<wsdl:operation name="SOAP_Requests_Receive-SOAP-Request">
<wsdl:input message="tns:SOAP_Requests_Receive-SOAP-Request-Request"/>
<wsdl:output message="tns:SOAP_Requests_Receive-SOAP-Request-Response"/>
</wsdl:operation>
</wsdl:portType>
*----- SOAP that works ------*
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:myops.com:bmp:wflow" xmlns:oas="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:soap="SOAP_Requests">
<soapenv:Header>
.
</soapenv:Header>
<soapenv:Body>
<soap:Receive-SOAP-Request-Request>
<soap:mydata>
my data here
</soap:mydata>
</soap:Receive-SOAP-Request-Request>
</soapenv:Body>
</soapenv:Envelope>
*----- This construct will also work ------*
*----- but why does "xmldata" not have a prefix? ---*
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
.
.
<soapenv:Body>
<Receive-SOAP-Request-Request xmlns="SOAP_Requests">
<mydata>
my data here
</mydata>
</Receive-SOAP-Request-Request>
</soapenv:Body>
.
.
*----- questionable SOAP call ------*
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:oas="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<soapenv:Header>
.
.
</soapenv:Header>
<soapenv:Body>
<SOAP_Requests_Receive-SOAP-Request-Request xmlns="urn:myops.com:bmp:wflow">
<mydata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string">
my data here
</mydata>
.
.
</SOAP_Requests_Receive-SOAP-Request-Request>
</soapenv:Body>
</soapenv:Envelope>
|