[cl-soap-devel] a couple of bug fixes
Sven Van Caekenberghe
scaekenberghe at common-lisp.net
Fri Sep 9 11:29:59 UTC 2005
Carlos,
I now understand better what you were getting at.
I committed some changes to allow optional/arbitrary extensions
(attributes) to the envelope, header and body elements (apart from
the header itself). The next artificial example shows what can be done:
CL-SOAP 39 > (soap-call xmethods
'((:username "foo") (:password "secret"))
`((ns1::|getQuote|
soapenv:|encodingStyle| ,+soap-enc-ns-uri+
:|xmlns:ns1| ,ns)
((:|symbol| xsi::|type| "xsd:string")
"AAPL"))
:soap-action "urn:xmethods-delayed-
quotes#getQuote"
:envelope-attributes '(:foo "1" :bar "2")
:header-attributes '(:foo "1" :bar "2")
:body-attributes '(:foo "1" :bar "2"))
;; SOAP CALL sending:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/
envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" FOO="1" BAR="2">
<soapenv:Header FOO="1" BAR="2">
<USERNAME>foo</USERNAME>
<PASSWORD>secret</PASSWORD>
</soapenv:Header>
<soapenv:Body FOO="1" BAR="2">
<ns1:getQuote soapenv:encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/" xmlns:ns1="urn:xmethods-delayed-quotes">
<symbol xsi:type="xsd:string">AAPL</symbol>
</ns1:getQuote>
</soapenv:Body>
</soapenv:Envelope>
;; SOAP CALL receiving: <?xml version='1.0' encoding='UTF-8'?>
<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance'
xmlns:xsd='http://www.w3.org/1999/XMLSchema' xmlns:soapenc='http://
schemas.xmlsoap.org/soap/encoding/' soap:encodingStyle='http://
schemas.xmlsoap.org/soap/encoding/'><soap:Body><n:getQuoteResponse
xmlns:n='urn:xmethods-delayed-quotes'><Result
xsi:type='xsd:float'>49.78</Result></n:getQuoteResponse></soap:Body></
soap:Envelope>
((NS1:|getQuoteResponse| :|xmlns:n| "urn:xmethods-delayed-quotes")
((:|Result| XSI:|type| "xsd:float") "49.78"))
I hope that the API now covers what you need (you can add the
encodingStyle attribute manually).
Is it possible for you to illustrate your points (this one or future
ones) using publically available SOAP web services (like the ones
listed on xmethods.net), that way we can write test code that
everybody can run while being sure we talk about exactly the same
things.
I didn't just add the attribute you requested because (1) it is not
always necessary (for example for non-RPC calls) (2) it can be added
on the element inside the body as well (as far as I understand).
BTW: how did you find out about this project, I thought it wasn't
visible anywhere ?
Now I am off to parsing WSDL ;-)
Sven
On 09 Sep 2005, at 00:12, Carlos Ungil wrote:
> Hello Sven,
>
> I was trying to reproduce the following message (generated using
> the perl module SOAP:Lite):
>
> <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-
> instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/
> encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/
> envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-
> ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-
> ENV:Header><AuthenticationInfo><userName>xxx</
> userName><password>xxx</password><authentication/><locale/
> ><timeZone/></AuthenticationInfo></SOAP-ENV:Header><SOAP-
> ENV:Body><namesp1:OpGetList
> xmlns:namesp1="urn:PRMS_ProblemMgmt_AIS"><Qualification>'Short
> Description' LIKE "Probl%"</Qualification></namesp1:OpGetList></
> SOAP-ENV:Body></SOAP-ENV:Envelope>
>
> Using my soap-envelope function, the following code
>
> (soap-call end-point
> '(((:|AuthenticationInfo|)
> ((:|userName|) "xxx")
> ((:|password|) "xxx")
> ((:|authentication|))
> ((:|locale|))
> ((:|timeZone|))))
> `(((ns1::|OpGetList| :|xmlns:ns1| ,ns)
> ((:|Qualification|) "'Short Description' LIKE
> \"Prob%\""))))
>
> produces the quite similar xml message
>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/
> envelope/" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/
> encoding/" xmlns:xsd="http://www.w3.org/1999/XMLSchema"
> xmlns:xsi="http://www.w3.org/1999/XMLSchema-
> instance"><soapenv:Header><AuthenticationInfo><userName>xxx</
> userName><password>xxx</password><authentication/><locale/
> ><timeZone/></AuthenticationInfo></
> soapenv:Header><soapenv:Body><ns1:OpGetList
> xmlns:ns1="urn:PRMS_ProblemMgmt_AIS"><Qualification>'Short
> Description' LIKE "Prob%"</Qualification></
> ns1:OpGetList></soapenv:Body></soapenv:Envelope>
>
> I've just noticed that the perl-generated version contains two
> properties related to the encoding:
> - SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/
> encoding/" (I reproduced this in the lisp version)
> - xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" (I
> didn't include that, but it worked the same)
>
> I don't know if those are "correct" soap messages, in any case they
> work. But in fact I've not tried to connect to the web service
> using the original cl-soap code, it might work as well.
>
> Cheers,
>
> Carlos
>
>
More information about the cl-soap-devel
mailing list