У меня есть мыльный конверт, который возвращается из зашифрованной службы PHP RPC, которую я написал и которая объявляет пространство имен в корневом узле конверта SOAP. Однако я хочу, чтобы это пространство имен находилось в корневом узле полезной нагрузки xml в теле SOAP. В основном, я хочу это:
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://sample.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org
/soap/encoding/">
<SOAP-ENV:Body>
<ns1:ServiceResponse>
<outgoingVar1>true</outgoingVar1>
</ns1:ServiceResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
чтобы стать таким:
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org
/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-
ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ServiceResponse xmlns="http://sample.com">
<outgoingVar1>true</outgoingVar1>
</ServiceResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
и вот мой аннотированный (опущенные тривиальные объявления пространства имен) WSDL в его нынешнем виде:
<wsdl:definitions name="IJLSoapResponse" targetNamespace="http://casey.com" tns="http://casey.com" xmlns:samp="http://sample.com" ...>
<wsdl:types>
<xsd:schema targetNamespace="http://casey.com" ...>
<xsd:element name="incomingVar1" type="xsd:string" nillable="true"/>
<xsd:element name="incomingVar2" type="xsd:string" nillable="true"/>
</xsd:schema>
<xsd:schema targetNamespace="http://sample.com" ...>
<xsd:element name="outgoingVar1" type="xsd:boolean" nillable="true"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="ServiceInput">
<wsdl:part name="incomingVar1" element="tns:incomingVar1"/>
<wsdl:part name="incomingVar2" element="tns:incomingVar2"/>
</wsdl:message>
<wsdl:message name="ServiceOutput">
<wsdl:part name="outgoingVar1" element="samp:outgoingVar1"/>
</wsdl:message>
<wsdl:portType name="ServicePortType">
<wsdl:operation name="ServiceMessage" parameterOrder="incomingVar1 incomingVar2">
<wsdl:input name="ServiceMessageRequest" message="tns:ServiceInput"/>
<wsdl:output name="ServiceMessageResponse" message="tns:ServiceOutput"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ServiceBinding" type="tns:ServicePortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="ServiceMessage">
<soap:operation soapAction="http://casey.com/soap/Service"/>
<wsdl:input name="ServiceRequest">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://casey.com"/>
</wsdl:input>
<wsdl:output name="ServiceResponse">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://sample.com"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ServiceService">
<wsdl:port name="ServicePort" binding="tns:ServiceBinding">
<soap:address location="http://casey.com/soap/Service"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Есть ли в WSDL что-то, что можно изменить, чтобы принудительно включить это пространство имен в полезную нагрузку? Я пытался переместить его в нескольких разных местах безрезультатно. Спасибо за вашу помощь.
PS Если вы видите, что с WSDl что-то не так, поскольку он не проверяется или что-то подобное, просто не обращайте на него внимания ... оригинал проверяет / развертывает / работает нормально. Я больше беспокоюсь о том, где я могу разместить пространство имен. Спасибо!