Quantcast

Running a simple query using SOAP

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Running a simple query using SOAP

Paolo Di Pietro

Hi all,

 

I’m trying to run the simple query below against my eXist, but it doesn’t run, and return the following SOAPFault: <faultcode>ns1:Client.NoSOAPAction</faultcode><faultstring>no SOAPAction header!</faultstring>

 

Exactly the same xml contained in the $request run successfully when sending as a SOAP request using XMLSpy

 

Anyone can help?

 

Thank you in advance

 

Paolo

 

.

 

 

let $request:=(<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body><m:connect xmlns:m="urn:exist"><m:userId>guest</m:userId><m:password>guest</m:password></m:connect></SOAP-ENV:Body></SOAP-ENV:Envelope>)

 

let $response:=httpclient:post(xs:anyURI("http://VM-W:8080/exist/services/Query"),$request,false(),<Headers/>)

 

return

<p>

<request>{$request}</request>

<response>{$response}</response>

</p>

 

 

<p>

<request>

<SOAP-ENV:Envelope>

<SOAP-ENV:Body>

<m:connect>

<m:userId>guest</m:userId>

<m:password>guest</m:password>

</m:connect>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

</request>

<response>

<httpclient:response statusCode="500">

<httpclient:headers>

<httpclient:header name="Date" value="Sat, 24 Jul 2010 14:01:14 GMT"/>

<httpclient:header name="Server" value="Jetty/5.1.12 (Windows 7/6.1 x86 java/1.6.0_20"/>

<httpclient:header name="Expires" value="Thu, 01 Jan 1970 00:00:00 GMT"/>

<httpclient:header name="Set-Cookie" value="JSESSIONID=35ep597jszni;Path=/exist"/>

<httpclient:header name="Content-Type" value="text/xml; charset=utf-8"/>

<httpclient:header name="Content-Length" value="548"/>

</httpclient:headers>

<httpclient:body mimetype="text/xml; charset=utf-8" type="xml">

<soapenv:Envelope>

<soapenv:Body>

<soapenv:Fault>

<faultcode>ns1:Client.NoSOAPAction</faultcode>

<faultstring>no SOAPAction header!</faultstring>

<detail>

<ns2:hostname>VM-W</ns2:hostname>

</detail>

</soapenv:Fault>

</soapenv:Body>

</soapenv:Envelope>

</httpclient:body>

</httpclient:response>

</response>

</p>


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running a simple query using SOAP

Adam Retter
You need to check the spec -
http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383528

The SOAP Action is a http header and is not in the payload itself! So
something like -

$response:=httpclient:post(xs:anyURI("http://VM-W:8080/exist/services/Query"),
$payload, false(),<headers><header name="SOAPAction"
value="yourActionHere"/></headers>)



On 24 July 2010 15:07, Paolo Di Pietro <[hidden email]> wrote:

> Hi all,
>
>
>
> I’m trying to run the simple query below against my eXist, but it doesn’t
> run, and return the following SOAPFault:
> <faultcode>ns1:Client.NoSOAPAction</faultcode><faultstring>no SOAPAction
> header!</faultstring>
>
>
>
> Exactly the same xml contained in the $request run successfully when sending
> as a SOAP request using XMLSpy
>
>
>
> Anyone can help?
>
>
>
> Thank you in advance
>
>
>
> Paolo
>
>
>
> .
>
>
>
>
>
> let $request:=(<SOAP-ENV:Envelope
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body><m:connect
> xmlns:m="urn:exist"><m:userId>guest</m:userId><m:password>guest</m:password></m:connect></SOAP-ENV:Body></SOAP-ENV:Envelope>)
>
>
>
> let
> $response:=httpclient:post(xs:anyURI("http://VM-W:8080/exist/services/Query"),$request,false(),<Headers/>)
>
>
>
> return
>
> <p>
>
> <request>{$request}</request>
>
> <response>{$response}</response>
>
> </p>
>
>
>
>
>
> <p>
>
> <request>
>
> <SOAP-ENV:Envelope>
>
> <SOAP-ENV:Body>
>
> <m:connect>
>
> <m:userId>guest</m:userId>
>
> <m:password>guest</m:password>
>
> </m:connect>
>
> </SOAP-ENV:Body>
>
> </SOAP-ENV:Envelope>
>
> </request>
>
> <response>
>
> <httpclient:response statusCode="500">
>
> <httpclient:headers>
>
> <httpclient:header name="Date" value="Sat, 24 Jul 2010 14:01:14 GMT"/>
>
> <httpclient:header name="Server" value="Jetty/5.1.12 (Windows 7/6.1 x86
> java/1.6.0_20"/>
>
> <httpclient:header name="Expires" value="Thu, 01 Jan 1970 00:00:00 GMT"/>
>
> <httpclient:header name="Set-Cookie"
> value="JSESSIONID=35ep597jszni;Path=/exist"/>
>
> <httpclient:header name="Content-Type" value="text/xml; charset=utf-8"/>
>
> <httpclient:header name="Content-Length" value="548"/>
>
> </httpclient:headers>
>
> <httpclient:body mimetype="text/xml; charset=utf-8" type="xml">
>
> <soapenv:Envelope>
>
> <soapenv:Body>
>
> <soapenv:Fault>
>
> <faultcode>ns1:Client.NoSOAPAction</faultcode>
>
> <faultstring>no SOAPAction header!</faultstring>
>
> <detail>
>
> <ns2:hostname>VM-W</ns2:hostname>
>
> </detail>
>
> </soapenv:Fault>
>
> </soapenv:Body>
>
> </soapenv:Envelope>
>
> </httpclient:body>
>
> </httpclient:response>
>
> </response>
>
> </p>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> Exist-open mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/exist-open
>
>



--
Adam Retter

eXist Developer
{ United Kingdom }
[hidden email]
irc://irc.freenode.net/existdb

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running a simple query using SOAP

Adam Retter
On 26 July 2010 11:14, Paolo Di Pietro <[hidden email]> wrote:
> Thank you Adam, I spent a lot of time before, and now your link gave me the opportunity to understand.
>
> The specs you suggest to look at, are for SOAP 1. Can SOAP 1.2 be used instead to enable attachments?

I dont see why not, SOAP operates over HTTP and you have access to the
HTTP requests and responses via the httpclient module.

>
> Paolo
>
> -----Messaggio originale-----
> Da: Adam Retter [mailto:[hidden email]]
> Inviato: sabato 24 luglio 2010 17:05
> A: Paolo Di Pietro
> Cc: [hidden email]
> Oggetto: Re: [Exist-open] Running a simple query using SOAP
>
> You need to check the spec -
> http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383528
>
> The SOAP Action is a http header and is not in the payload itself! So something like -
>
> $response:=httpclient:post(xs:anyURI("http://VM-W:8080/exist/services/Query"),
> $payload, false(),<headers><header name="SOAPAction"
> value="yourActionHere"/></headers>)
>
>
>
> On 24 July 2010 15:07, Paolo Di Pietro <[hidden email]> wrote:
>> Hi all,
>>
>>
>>
>> I’m trying to run the simple query below against my eXist, but it
>> doesn’t run, and return the following SOAPFault:
>> <faultcode>ns1:Client.NoSOAPAction</faultcode><faultstring>no
>> SOAPAction header!</faultstring>
>>
>>
>>
>> Exactly the same xml contained in the $request run successfully when
>> sending as a SOAP request using XMLSpy
>>
>>
>>
>> Anyone can help?
>>
>>
>>
>> Thank you in advance
>>
>>
>>
>> Paolo
>>
>>
>>
>> .
>>
>>
>>
>>
>>
>> let $request:=(<SOAP-ENV:Envelope
>> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body><m:connect
>> xmlns:m="urn:exist"><m:userId>guest</m:userId><m:password>guest</m:pas
>> sword></m:connect></SOAP-ENV:Body></SOAP-ENV:Envelope>)
>>
>>
>>
>> let
>> $response:=httpclient:post(xs:anyURI("http://VM-W:8080/exist/services/
>> Query"),$request,false(),<Headers/>)
>>
>>
>>
>> return
>>
>> <p>
>>
>> <request>{$request}</request>
>>
>> <response>{$response}</response>
>>
>> </p>
>>
>>
>>
>>
>>
>> <p>
>>
>> <request>
>>
>> <SOAP-ENV:Envelope>
>>
>> <SOAP-ENV:Body>
>>
>> <m:connect>
>>
>> <m:userId>guest</m:userId>
>>
>> <m:password>guest</m:password>
>>
>> </m:connect>
>>
>> </SOAP-ENV:Body>
>>
>> </SOAP-ENV:Envelope>
>>
>> </request>
>>
>> <response>
>>
>> <httpclient:response statusCode="500">
>>
>> <httpclient:headers>
>>
>> <httpclient:header name="Date" value="Sat, 24 Jul 2010 14:01:14 GMT"/>
>>
>> <httpclient:header name="Server" value="Jetty/5.1.12 (Windows 7/6.1
>> x86 java/1.6.0_20"/>
>>
>> <httpclient:header name="Expires" value="Thu, 01 Jan 1970 00:00:00
>> GMT"/>
>>
>> <httpclient:header name="Set-Cookie"
>> value="JSESSIONID=35ep597jszni;Path=/exist"/>
>>
>> <httpclient:header name="Content-Type" value="text/xml;
>> charset=utf-8"/>
>>
>> <httpclient:header name="Content-Length" value="548"/>
>>
>> </httpclient:headers>
>>
>> <httpclient:body mimetype="text/xml; charset=utf-8" type="xml">
>>
>> <soapenv:Envelope>
>>
>> <soapenv:Body>
>>
>> <soapenv:Fault>
>>
>> <faultcode>ns1:Client.NoSOAPAction</faultcode>
>>
>> <faultstring>no SOAPAction header!</faultstring>
>>
>> <detail>
>>
>> <ns2:hostname>VM-W</ns2:hostname>
>>
>> </detail>
>>
>> </soapenv:Fault>
>>
>> </soapenv:Body>
>>
>> </soapenv:Envelope>
>>
>> </httpclient:body>
>>
>> </httpclient:response>
>>
>> </response>
>>
>> </p>
>>
>> ----------------------------------------------------------------------
>> -------- This SF.net email is sponsored by Sprint What will you do
>> first with EVO, the first 4G phone?
>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>> _______________________________________________
>> Exist-open mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/exist-open
>>
>>
>
>
>
> --
> Adam Retter
>
> eXist Developer
> { United Kingdom }
> [hidden email]
> irc://irc.freenode.net/existdb
>



--
Adam Retter

eXist Developer
{ United Kingdom }
[hidden email]
irc://irc.freenode.net/existdb

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Loading...