[R] Qualified parameters in SOAP body using .SOAP

Olivier Cailloux mlsmg at ulb.ac.be
Wed Jun 24 16:50:31 CEST 2009


Hello,

I am trying to reach a web service using the SOAP package. I succeeded 
calling the web service, but not sending parameters to it. After much 
research and tries, I think I found that the problem lies in the 
namespace including the parameters in the SOAP body.

In short, my question is: how can I send unqualified parameters in the 
SOAP body of a call produced through the SOAP package? Details of what I 
try to do follow.

The SOAP package sends this soap envelope to my test web service (wsdl 
here [http://smg8.ulb.ac.be:8080/web2?wsdl]).
<SOAP-ENV:Envelope 
xmlns:SOAP-ENC="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" 
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  <SOAP-ENV:Body>
    <greetMe xmlns="http://web2.web/">
      <arg0 xsi:type="xsd:string">Olivier</arg0>
    </greetMe>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The R commands used are:
library("SSOAP")
smg8TestService <- SOAPServer("smg8.ulb.ac.be", "/web2/TestService", 8080)
contentGreet <- .SOAP(server=smg8TestService, method="greetMe", 
arg0="Olivier", action="", xmlns="http://web2.web/", .convert=FALSE)

But, AFAIU, the arg0 tag should NOT be qualified, according to the WSDL. 
Hence, my web service implementation never receives the "Olivier" 
argument and rather receives "null" as the string parameter.

When calling the web service using an other client (eclipse Web services 
explorer), I see it generates the following body:
<soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:q0="http://web2.web/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
    <q0:greetMe>
      <arg0>Olivier-from-eclipse</arg0>
    </q0:greetMe>
  </soapenv:Body>
</soapenv:Envelope>

Thus with the "arg0" tag being unqualified (i.e. not in the 
"http://web2.web/" namespace). And that works: my web service 
implementation indeed receives the "Olivier-from-eclipse" parameter as 
string.

Can anyone confirm that my understanding of what happens and why my web 
service implementation, when called by the R client, does not see the 
parameters, seems correct?

If it seems correct, then how can I send unqualified parameters in the 
SOAP body using the SOAP package? Thanks for any help!
Olivier




More information about the R-help mailing list