I've used the tcp monitor that you refered and the results are attached
WebService.txt contains requests made to the real webservice.
Servicemix-consumer contains requests made to service-mix.
Client-stackstrace.txt contains the output from client execution.
Thanks a lot for the tcpmon hint :)
João Vieira da Luz
-----Original Message-----
From: Guillaume Nodet [mailto:[EMAIL PROTECTED]
Sent: segunda-feira, 24 de Julho de 2006 16:42
To: [email protected]
Subject: Re: How to call a external webservice?
Could you paste all the http requests sent (request / response) on both the
client side and server side using
http://ws.apache.org/axis/java/user-guide.html#AppendixUsingTheAxisTCPMonitorTcpmon
or any other tool ?
Cheers,
Guillaume Nodet
On 7/24/06, João Luz <[EMAIL PROTECTED]> wrote:
>
> My client is a XfireProxy
>
> String serviceDesc = "http://localhost:8192/HelloServiceProxy/";
> Service serviceModel = new ObjectServiceFactory().create(
> IHelloService.class);
> IHelloService service = (IHelloService) new
> XFireProxyFactory().create(serviceModel, serviceDesc);
> System.out.println(service.hello());
>
> I think it is blocked for a period of time, until it try again to make
> the request.
>
> Thanks,
> João
>
> -----Original Message-----
> From: Guillaume Nodet [mailto:[EMAIL PROTECTED]
> Sent: segunda-feira, 24 de Julho de 2006 16:16
> To: [email protected]
> Subject: Re: How to call a external webservice?
>
> There is no need for a pipeline in such a case, as the exchange should
> go from the consumer endpoint to the provider endpoint without any
> intermediary service.
> The pipeline is to bridge InOnly and InOut mep, but in this case,
> there is only a single InOut mep.
> I do not see any reason why it does not work.
>
> Joao, could you indicate if the http client is blocked while waiting
> for the response, or if an empty response is sent ?
>
> Cheers,
> Guillaume Nodet
>
> On 7/24/06, Pierre NOTEL <[EMAIL PROTECTED]> wrote:
> >
> > To receive the response of a component, I think you should use the
> > eip:pipeline to use the in-out mep functionality.
> > I haven't use it with a consumer endpoint but with an external
> > webservice (provider) to catch the response and sent it to other
> > component.
> > If anyone has other solution (easier)...
> >
> > Cheers,
> >
> > Pierre NOTEL
> >
> > //*******************************************
> > João Luz wrote:
> > > I'm only trying to call a webservice via servicemix. The problem
> > > is that
> > the request reachs the webservice and goes back to servicemix. But
> > it never reachs the original caller.
> > >
> > > Thanks,
> > > João Vieira da Luz
> > >
> > > -----Original Message-----
> > > From: Pierre NOTEL [mailto:[EMAIL PROTECTED]
> > > Sent: segunda-feira, 24 de Julho de 2006 15:28
> > > To: [email protected]
> > > Subject: Re: How to call a external webservice?
> > >
> > > I think you shoud use a eip:pipeline in order to receive response
> > > from
> > the webservice and send it to the consumer...
> > >
> > > For example :
> > >
> > > <eip:pipeline service="foo:WS" endpoint="pipelineWS">
> > > <eip:transformer>
> > > <eip:exchange-target service="foo:WService" />
> > > </eip:transformer>
> > > <eip:target>
> > > <eip:exchange-target service="foo:trace" />
> > > </eip:target>
> > > </eip:pipeline>
> > >
> > > The response of the webservice will be sent to the trace component.
> > >
> > > Hope it will be useful,
> > >
> > > Pierre NOTEL
> > >
> > > //****************************************************
> > > João Luz wrote:
> > >
> > >> Hi,
> > >>
> > >> My starting point was exactly your excelent post.
> > >>
> > >> The problem I have is that all works fine in the request chain,
> > >> until
> > the moment that consumer endpoint should send the response to the
> client.
> > Step that I can't figure out how to put working.
> > >>
> > >> 1- I call webservice exposed via consumer endpoint
> > >> 2- Consumer endpoint forwards to a provider endpoint that
> > >> 3- Provider forwards to the real webservice
> > >> 4- WebService executes
> > >> 5- Provider receives the response from webservice and it forwards
> > >> to the consumer
> > >> 6- Consumer should send the message to the client, but the
> > >> message
> > never reachs the client that made the request.
> > >>
> > >> Client, servicemix and Webservice run in 3 different jvm.
> > >>
> > >> Thanks a lot to all,
> > >> João
> > >>
> > >> -----Original Message-----
> > >> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Alessio
> > >> D'Innocenti
> > >> Sent: segunda-feira, 24 de Julho de 2006 14:47
> > >> To: [email protected]
> > >> Subject: Re: How to call a external webservice?
> > >>
> > >> Take a look at this
> > >> http://www.nabble.com/External-Webservices-binding-%28the-answer%
> > >> 29
> > >> -tf
> > >> 1971463.html
> > >>
> > >> João Luz ha scritto:
> > >>
> > >>
> > >>> How can we, using provider/consumer endpoints, call an external
> > webservice using servicemix?
> > >>>
> > >>> Thanks in advance,
> > >>> João
> > >>>
> > >>>
> > >>>
> > >>>
> > >>
> > >>
> > >
> > >
> > >
> >
> >
>
==============
Listen Port: 2222
Target Host: 127.0.0.1
Target Port: 8080
==== Request ====
GET /xfire-ws/services/HelloService?wsdl HTTP/1.1
User-Agent: Java/1.5.0_04
Host: 127.0.0.1:2222
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-type: application/x-www-form-urlencoded
==== Response ====
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/xml
Transfer-Encoding: chunked
Date: Mon, 24 Jul 2006 18:13:11 GMT
943
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"
xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding"
xmlns:tns="http://xfire.codehaus.org/HelloService"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xfire.codehaus.org/HelloService">
<wsdl:types>
<xsd:schema targetNamespace="http://xfire.codehaus.org/HelloService"
elementFormDefault="qualified" attributeFormDefault="qualified">
<xsd:element name="hello">
<xsd:complexType />
</xsd:element>
<xsd:element name="helloResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="out" type="xsd:string" nillable="true"
minOccurs="1" maxOccurs="1" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="helloRequest">
<wsdl:part element="tns:hello" name="parameters" />
</wsdl:message>
<wsdl:message name="helloResponse">
<wsdl:part element="tns:helloResponse" name="parameters" />
</wsdl:message>
<wsdl:portType name="HelloServicePortType">
<wsdl:operation name="hello">
<wsdl:input message="tns:helloRequest" name="helloRequest" />
<wsdl:output message="tns:helloResponse" name="helloResponse" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="HelloServiceHttpBinding" type="tns:HelloServicePortType">
<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="hello">
<wsdlsoap:operation soapAction="" />
<wsdl:input name="helloRequest">
<wsdlsoap:body use="literal" />
</wsdl:input>
<wsdl:output name="helloResponse">
<wsdlsoap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="HelloService">
<wsdl:port binding="tns:HelloServiceHttpBinding"
name="HelloServiceHttpPort">
<wsdlsoap:address
location="http://127.0.0.1:2222/xfire-ws/services/HelloService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
0
==============
==============
Listen Port: 2222
Target Host: 127.0.0.1
Target Port: 8080
==== Request ====
POST /xfire-ws/services/HelloService HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; XFire Client
+http://xfire.codehaus.org)
SOAPAction: ""
Content-Type: text/xml; charset=UTF-8
Content-Type: text/xml
Content-Length: 336
Host: 127.0.0.1:2222
<?xml version='1.0' encoding='UTF-8'?><env:Envelope
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><hello
xmlns="http://xfire.sinfic.pt"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
/></env:Body></env:Envelope>==== Response ====
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 24 Jul 2006 18:14:09 GMT
15e
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><helloResponse
xmlns="http://xfire.codehaus.org/HelloService"><out
xmlns="http://xfire.codehaus.org/HelloService">Hello!</out></helloResponse></soap:Body></soap:Envelope>
0
==============
==============
Listen Port: 2222
Target Host: 127.0.0.1
Target Port: 8080
==== Request ====
POST /xfire-ws/services/HelloService HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; XFire Client
+http://xfire.codehaus.org)
SOAPAction: ""
Content-Type: text/xml; charset=UTF-8
Content-Type: text/xml
Content-Length: 336
Host: 127.0.0.1:2222
<?xml version='1.0' encoding='UTF-8'?><env:Envelope
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><hello
xmlns="http://xfire.sinfic.pt"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
/></env:Body></env:Envelope>==== Response ====
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 24 Jul 2006 18:14:39 GMT
15e
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><helloResponse
xmlns="http://xfire.codehaus.org/HelloService"><out
xmlns="http://xfire.codehaus.org/HelloService">Hello!</out></helloResponse></soap:Body></soap:Envelope>
0
==============
==============
Listen Port: 2222
Target Host: 127.0.0.1
Target Port: 8080
==== Request ====
POST /xfire-ws/services/HelloService HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; XFire Client
+http://xfire.codehaus.org)
SOAPAction: ""
Content-Type: text/xml; charset=UTF-8
Content-Type: text/xml
Content-Length: 336
Host: 127.0.0.1:2222
<?xml version='1.0' encoding='UTF-8'?><env:Envelope
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><hello
xmlns="http://xfire.sinfic.pt"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
/></env:Body></env:Envelope>==== Response ====
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 24 Jul 2006 18:15:09 GMT
15e
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><helloResponse
xmlns="http://xfire.codehaus.org/HelloService"><out
xmlns="http://xfire.codehaus.org/HelloService">Hello!</out></helloResponse></soap:Body></soap:Envelope>
0
==============
==============
Listen Port: 2222
Target Host: 127.0.0.1
Target Port: 8080
==== Request ====
POST /xfire-ws/services/HelloService HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; XFire Client
+http://xfire.codehaus.org)
SOAPAction: ""
Content-Type: text/xml; charset=UTF-8
Content-Type: text/xml
Content-Length: 336
Host: 127.0.0.1:2222
<?xml version='1.0' encoding='UTF-8'?><env:Envelope
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><hello
xmlns="http://xfire.sinfic.pt"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
/></env:Body></env:Envelope>==== Response ====
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 24 Jul 2006 18:15:39 GMT
15e
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><helloResponse
xmlns="http://xfire.codehaus.org/HelloService"><out
xmlns="http://xfire.codehaus.org/HelloService">Hello!</out></helloResponse></soap:Body></soap:Envelope>
0
==============
==============
Listen Port: 9000
Target Host: 127.0.0.1
Target Port: 8192
==== Request ====
POST /HelloServiceProxy/ HTTP/1.1
SOAPAction: ""
Content-Type: text/xml; charset=UTF-8
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; XFire Client
+http://xfire.codehaus.org)
Host: 127.0.0.1:9000
Expect: 100-continue
Content-Length: 248
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><hello
xmlns="http://xfire.sinfic.pt" /></soap:Body></soap:Envelope>==== Response ====
HTTP/1.1 100 Continue
==============
==============
Listen Port: 9000
Target Host: 127.0.0.1
Target Port: 8192
==== Request ====
POST /HelloServiceProxy/ HTTP/1.1
SOAPAction: ""
Content-Type: text/xml; charset=UTF-8
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; XFire Client
+http://xfire.codehaus.org)
Expect: 100-continue
Content-Length: 248
Host: 127.0.0.1:9000
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><hello
xmlns="http://xfire.sinfic.pt" /></soap:Body></soap:Envelope>==== Response ====
HTTP/1.1 100 Continue
==============
==============
Listen Port: 9000
Target Host: 127.0.0.1
Target Port: 8192
==== Request ====
POST /HelloServiceProxy/ HTTP/1.1
SOAPAction: ""
Content-Type: text/xml; charset=UTF-8
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; XFire Client
+http://xfire.codehaus.org)
Expect: 100-continue
Content-Length: 248
Host: 127.0.0.1:9000
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><hello
xmlns="http://xfire.sinfic.pt" /></soap:Body></soap:Envelope>==== Response ====
HTTP/1.1 100 Continue
==============
==============
Listen Port: 9000
Target Host: 127.0.0.1
Target Port: 8192
==== Request ====
POST /HelloServiceProxy/ HTTP/1.1
SOAPAction: ""
Content-Type: text/xml; charset=UTF-8
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; XFire Client
+http://xfire.codehaus.org)
Expect: 100-continue
Content-Length: 248
Host: 127.0.0.1:9000
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><hello
xmlns="http://xfire.sinfic.pt" /></soap:Body></soap:Envelope>==== Response ====
HTTP/1.1 100 Continue
==============
24/Jul/2006 19:14:39 org.apache.commons.httpclient.HttpMethodDirector
executeWithRetry
INFO: I/O exception (org.apache.commons.httpclient.NoHttpResponseException)
caught when processing request: The server localhost failed to respond
24/Jul/2006 19:14:39 org.apache.commons.httpclient.HttpMethodDirector
executeWithRetry
INFO: Retrying request
24/Jul/2006 19:15:09 org.apache.commons.httpclient.HttpMethodDirector
executeWithRetry
INFO: I/O exception (org.apache.commons.httpclient.NoHttpResponseException)
caught when processing request: The server localhost failed to respond
24/Jul/2006 19:15:09 org.apache.commons.httpclient.HttpMethodDirector
executeWithRetry
INFO: Retrying request
24/Jul/2006 19:15:39 org.apache.commons.httpclient.HttpMethodDirector
executeWithRetry
INFO: I/O exception (org.apache.commons.httpclient.NoHttpResponseException)
caught when processing request: The server localhost failed to respond
24/Jul/2006 19:15:39 org.apache.commons.httpclient.HttpMethodDirector
executeWithRetry
INFO: Retrying request
Exception in thread "main" org.codehaus.xfire.XFireRuntimeException: Could not
invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault:
Couldn't send message.
org.codehaus.xfire.fault.XFireFault: Couldn't send message.
at org.codehaus.xfire.fault.XFireFault.createFault(XFireFault.java:89)
at
org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:30)
at
org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:110)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75)
at org.codehaus.xfire.client.Client.invoke(Client.java:335)
at
org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
at $Proxy0.hello(Unknown Source)
at pt.sinfic.xfire.ClientXFire.main(ClientXFire.java:18)
Caused by: org.codehaus.xfire.XFireException: Couldn't send message.
at
org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:125)
at
org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:44)
at
org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
... 7 more
Caused by: org.apache.commons.httpclient.NoHttpResponseException: The server
localhost failed to respond
at
org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1835)
at
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1590)
at
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:995)
at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)
at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
at
org.codehaus.xfire.transport.http.CommonsHttpMessageSender.send(CommonsHttpMessageSender.java:167)
at
org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:114)
... 9 more