Hello !

Could someone please explain to me the following ? Please !!!

All the request examples from Apache SOAP use different namespaces for the first subelement
to the SOAP body and the parameter elements.


My SOAP request sent to a MS SOAP server failes due to the fact that SOAP parameters having another
namespace then the first SOAPbody subelement. Renaming the parameters with the prefix "ns1:"
makes the requests work so I know thats where the problem is.


According to the sample requests on the w3c forum
( see. http://www.w3.org/TR/2003/REC-soap12-part0-20030624/#L1165 ) the same namespace is used
for all SOAP parameter elements in the same body subelement so from my point of view it looks
like Apache SOAP is making non standard requests !?!??


I have even seen some samples of requests from Axis that shows the same behavior ?!?

See below how the "Login" element doesn't use the qualified name "ns1:Login"....

My request from Apache SOAP
---------------------------

POST http://www.yaddayadday.com/webservices/customer/customer.asmx HTTP/1.0
Host: www.yaddayadday.com:80
Content-Type: text/xml; charset=utf-8
Content-Length: 554
SOAPAction: "http://www.yaddayadday.com/webservices/customer/RequestProductList";


<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope 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";>
<SOAP-ENV:Body>
<ns1:RequestProductList xmlns:ns1="http://www.yaddayadday.com/webservices/customer"; SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
<Login xsi:type="xsd:string">USERID</Login>
<Password xsi:type="xsd:string">PASSWORD</Password>
</ns1:RequestProductList>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>



What it should look like ( According to the MS server and me...) -----------------------------------------------------------------

POST http://www.yaddayadday.com/webservices/customer/customer.asmx HTTP/1.0
Host: www.yaddayadday.com:80
Content-Type: text/xml; charset=utf-8
Content-Length: 554
SOAPAction: "http://www.yaddayadday.com/webservices/customer/RequestProductList";


<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope 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";>
<SOAP-ENV:Body>
<ns1:RequestProductList xmlns:ns1="http://www.yaddayadday.com/webservices/customer"; SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
<ns1:Login xsi:type="xsd:string">USERID</ns1:Login>
<ns1:Password xsi:type="xsd:string">PASSWORD</ns1:Password>
</ns1:RequestProductList>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>



Below is my code ( that looks like all the samples I found around). -------------------------------------------------------------------

URL url = new URL("http://www.yaddayadday.com/webservices/customer/customer.asmx";);

Call call = new Call();
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
call.setTargetObjectURI("http://www.yaddayadday.com/webservices/customer";);
call.setMethodName("RequestProductList");
call.setSOAPMappingRegistry(Smr);

Vector params = new Vector();

params.add(new Parameter("Login",String.class,"USERID",null) );
params.add(new Parameter("Password",String.class,"PASSWORD",null) );

call.setParams(params);

resp = call.invoke(url,"http://www.yaddayadday.com/webservices/customer/RequestProductList";);


Conclusion ----------

So my question is if Apache SOAP is using a non standard implementation or if I am doing something wrong
in my code/assumption. Anyone know how to solve this without rewriting the SOAP Apache implementation or the service ?


/Thanks, Jer

_________________________________________________________________
Auktioner: Tj�na en hacka p� gamla prylar http://tradera.msn.se



Reply via email to