You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by D....@hzd.hessen.de on 2004/10/14 13:17:35 UTC

problem with calling a web service with soap

Hi all,

i have a problem in calling a web service with cocoon and soap. i want
to sent an xml-file, which is saved on my local harddisk, via soap
request to a web service. The web service function well..

How can i do this? i can't find any example for this problem!

here my xsp code for calling the web service:

<xsp:page language="java" xmlns:xsp="http://apache.org/xsp" xmlns:xsp-request="http://apache.org/xsp/request/2.0" xmlns:soap="http://apache.org/xsp/soap/3.0" xmlns:xscript="http://apache.org/xsp/xscript/1.0" xmlns:log="http://apache.org/xsp/log/2.0">
        <page>
                <xsp:logic>
                        String query = "testabfrage";
                </xsp:logic>
                <soap:call
                url="http://10.111.11.111/datenpool21/datenpool21.asmx" method="http://name.org/datenpool21/datenpool21/Auskunft">
                        <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">
                                <soap:Body>
                                        <ns1:Polizeiauskunft xmlns:ns1="urn:http://tempuri.org/datenpool21/datenpool21/PolizeiAuskunft" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
                                                
                                                <XMELDQuery0400
                                                xsi:type="string">xml-file</href></XMELDQuery0400>
                                                
                                        </ns1:Auskunft>
                                </soap:Body>
                        </soap:Envelope>
                </soap:call>
        </page>
</xsp:page>


Thanks for your help!

Regards  Dirk
 
----------------------------------------
Dirk Skirde
Hessische Zentrale für Datenverarbeitung
Mainzer Strasse 50  Raum 009
65189 Wiesbaden
Tel.:  +49 611 340 1941
Fax:   +49 611 340 5941
EMail: d.skirde@hzd.hessen.de

RE: problem with calling a web service with soap

Posted by "JACOB, ERIC" <er...@bell.ca>.
Hi Dirk,

I wrote an HTTPClientTransformer that takes a soap message and send it (POST
method) to a request uri like this:

<message>
  <http-client:request
xmlns:http-client="http://bell.ca/cocoon/HTTPClient/1.0">
 
<http-client:request-uri>http://www.xignite.com/xQuotes.asmx</http-client:re
quest-uri>
    <http-client:method>POST</http-client:method>
    <http-client:request-header name="Content-Type">text/xml;
charset=UTF-8</http-client:request-header>
    <http-client:request-header
name="SOAPAction">http://www.xignite.com/services/GetQuotes</http-client:req
uest-header>
    <http-client:message-body>
      <soap:Envelope
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Header>
          <Header xmlns="http://www.xignite.com/services/">
            <Username/>
            <Password/>
            <Tracer/>
           </Header>
         </soap:Header>
         <soap:Body>
           <GetQuotes xmlns="http://www.xignite.com/services/">
             <Symbol>BCE.TO,NT.TO</Symbol>
           </GetQuotes>
         </soap:Body>
       </soap:Envelope>
     </http-client:message-body>
  </http-client:request>
</message>

I would like donate the transformer to the cocoon project if the community
is interested in it. The transformer can also send request via GET method.

Thanks,

Eric Jacob, ing. jr, CCNA, CCDA
Bell Canada - Architecture et Intégration des Solutions

-----Original Message-----
From: D.Skirde@hzd.hessen.de [mailto:D.Skirde@hzd.hessen.de] 
Sent: Thursday, October 14, 2004 7:18 AM
To: users@cocoon.apache.org
Subject: problem with calling a web service with soap

Hi all,

i have a problem in calling a web service with cocoon and soap. i want
to sent an xml-file, which is saved on my local harddisk, via soap
request to a web service. The web service function well..

How can i do this? i can't find any example for this problem!

here my xsp code for calling the web service:

<xsp:page language="java" xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:soap="http://apache.org/xsp/soap/3.0"
xmlns:xscript="http://apache.org/xsp/xscript/1.0"
xmlns:log="http://apache.org/xsp/log/2.0">
        <page>
                <xsp:logic>
                        String query = "testabfrage";
                </xsp:logic>
                <soap:call
                url="http://10.111.11.111/datenpool21/datenpool21.asmx"
method="http://name.org/datenpool21/datenpool21/Auskunft">
                        <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">
                                <soap:Body>
                                        <ns1:Polizeiauskunft
xmlns:ns1="urn:http://tempuri.org/datenpool21/datenpool21/PolizeiAuskunft"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
                                               
                                                <XMELDQuery0400
                                               
xsi:type="string">xml-file</href></XMELDQuery0400>
                                               
                                        </ns1:Auskunft>
                                </soap:Body>
                        </soap:Envelope>
                </soap:call>
        </page>
</xsp:page>


Thanks for your help!

Regards  Dirk

----------------------------------------
Dirk Skirde
Hessische Zentrale für Datenverarbeitung
Mainzer Strasse 50  Raum 009
65189 Wiesbaden
Tel.:  +49 611 340 1941
Fax:   +49 611 340 5941
EMail: d.skirde@hzd.hessen.de 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: problem with calling a web service with soap

Posted by "JACOB, ERIC" <er...@bell.ca>.
Hi Dirk,

I wrote an HTTPClientTransformer that takes a soap message and send it (POST
method) to a request uri like this:

<message>
  <http-client:request
xmlns:http-client="http://bell.ca/cocoon/HTTPClient/1.0">
 
<http-client:request-uri>http://www.xignite.com/xQuotes.asmx</http-client:re
quest-uri>
    <http-client:method>POST</http-client:method>
    <http-client:request-header name="Content-Type">text/xml;
charset=UTF-8</http-client:request-header>
    <http-client:request-header
name="SOAPAction">http://www.xignite.com/services/GetQuotes</http-client:req
uest-header>
    <http-client:message-body>
      <soap:Envelope
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Header>
          <Header xmlns="http://www.xignite.com/services/">
            <Username/>
            <Password/>
            <Tracer/>
           </Header>
         </soap:Header>
         <soap:Body>
           <GetQuotes xmlns="http://www.xignite.com/services/">
             <Symbol>BCE.TO,NT.TO</Symbol>
           </GetQuotes>
         </soap:Body>
       </soap:Envelope>
     </http-client:message-body>
  </http-client:request>
</message>

I would like donate the transformer to the cocoon project if the community
is interested in it. The transformer can also send request via GET method.

Thanks,

Eric Jacob, ing. jr, CCNA, CCDA
Bell Canada - Architecture et Intégration des Solutions

-----Original Message-----
From: D.Skirde@hzd.hessen.de [mailto:D.Skirde@hzd.hessen.de] 
Sent: Thursday, October 14, 2004 7:18 AM
To: users@cocoon.apache.org
Subject: problem with calling a web service with soap

Hi all,

i have a problem in calling a web service with cocoon and soap. i want
to sent an xml-file, which is saved on my local harddisk, via soap
request to a web service. The web service function well..

How can i do this? i can't find any example for this problem!

here my xsp code for calling the web service:

<xsp:page language="java" xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:soap="http://apache.org/xsp/soap/3.0"
xmlns:xscript="http://apache.org/xsp/xscript/1.0"
xmlns:log="http://apache.org/xsp/log/2.0">
        <page>
                <xsp:logic>
                        String query = "testabfrage";
                </xsp:logic>
                <soap:call
                url="http://10.111.11.111/datenpool21/datenpool21.asmx"
method="http://name.org/datenpool21/datenpool21/Auskunft">
                        <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">
                                <soap:Body>
                                        <ns1:Polizeiauskunft
xmlns:ns1="urn:http://tempuri.org/datenpool21/datenpool21/PolizeiAuskunft"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
                                               
                                                <XMELDQuery0400
                                               
xsi:type="string">xml-file</href></XMELDQuery0400>
                                               
                                        </ns1:Auskunft>
                                </soap:Body>
                        </soap:Envelope>
                </soap:call>
        </page>
</xsp:page>


Thanks for your help!

Regards  Dirk

----------------------------------------
Dirk Skirde
Hessische Zentrale für Datenverarbeitung
Mainzer Strasse 50  Raum 009
65189 Wiesbaden
Tel.:  +49 611 340 1941
Fax:   +49 611 340 5941
EMail: d.skirde@hzd.hessen.de