Newbie question: possible for XQuery to call an Axis2 service?

View: New views
2 Messages — Rating Filter:   Alert me  

Newbie question: possible for XQuery to call an Axis2 service?

by bxgirten :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I wrote a variation of a "HelloWorld" Axis2 web service at port 8080.  Below is an XQuery (eXist on port 8580) I was hoping to call that service with.  I searched the forum but can't tell if this is possible?  I continue to get exceptions.  Is my SOAP messed-up?


declare namespace httpclient="http://exist-db.org/xquery/httpclient";
declare namespace soapenv="http://schema.xmlsoap.org/soap/envelope";
declare namespace ex="http://localhost:8080/axis2/services/waveAgentService";

let $uri := xs:anyURI('http://127.0.0.1:8580/exist/biofuse/wavebounce')

let $soap-request :=
<soap:Envelope xmlns:soap="http://schema.xmlsoap.org/soap/envelope">
   <soap:Header/>
   <soap:Body>
      <helloAxis2:Request xmlns:helloAxis2="http://localhost:8080/axis2/services/waveAgentService/">guess</helloAxis2:Request>
   </soap:Body>
</soap:Envelope>

let $headers :=
      <headers>
         <header name="Content-Type"
                  value="application/soap+xml"/>
        <header name="charset"
                  value="UTF-8"/>
        <header name="action"
                  value="http://localhost:8080/axis2/services/waveAgentService/waveBounce"/>
     </headers>

let $response :=   httpclient:post( $uri, $soap-request, false(), $headers )

return
<hello>
   {$response}
</hello>

Re: Newbie question: possible for XQuery to call an Axis2 service?

by Adam Retter-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I dont see any reason why you should not be able to call a SOAP
WebService from XQuery, it has been done before I believe.

You dont mention what your error/exception is, so I dont have much to
go on, but my guess would be that your SOAP request message is
invalid. Perhaps you could use a tool to generate or sniff a valid
SOAP request message and then replicate that format in your XQuery?

2009/11/7 bxgirten <bxgirten@...>:

>
> I wrote a variation of a "HelloWorld" Axis2 web service at port 8080.  Below
> is an XQuery (eXist on port 8580) I was hoping to call that service with.  I
> searched the forum but can't tell if this is possible?  I continue to get
> exceptions.  Is my SOAP messed-up?
>
>
> declare namespace httpclient="http://exist-db.org/xquery/httpclient";
> declare namespace soapenv="http://schema.xmlsoap.org/soap/envelope";
> declare namespace
> ex="http://localhost:8080/axis2/services/waveAgentService";
>
> let $uri := xs:anyURI('http://127.0.0.1:8580/exist/biofuse/wavebounce')
>
> let $soap-request :=
> <soap:Envelope xmlns:soap="http://schema.xmlsoap.org/soap/envelope">
>   <soap:Header/>
>   <soap:Body>
>      <helloAxis2:Request
> xmlns:helloAxis2="http://localhost:8080/axis2/services/waveAgentService/">guess</helloAxis2:Request>
>   </soap:Body>
> </soap:Envelope>
>
> let $headers :=
>      <headers>
>         <header name="Content-Type"
>                  value="application/soap+xml"/>
>        <header name="charset"
>                  value="UTF-8"/>
>        <header name="action"
>
> value="http://localhost:8080/axis2/services/waveAgentService/waveBounce"/>
>     </headers>
>
> let $response :=   httpclient:post( $uri, $soap-request, false(), $headers )
>
> return
> <hello>
>   {$response}
> </hello>
> --
> View this message in context: http://old.nabble.com/Newbie-question%3A-possible-for-XQuery-to-call-an-Axis2-service--tp26249495p26249495.html
> Sent from the exist-open mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Exist-open mailing list
> Exist-open@...
> https://lists.sourceforge.net/lists/listinfo/exist-open
>



--
Adam Retter

eXist Developer
{ United Kingdom }
adam@...
irc://irc.freenode.net/existdb

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open