You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Bhaskar Orbitz <bh...@yahoo.com> on 2010/08/02 19:40:51 UTC
servicemix-http consumer issue
Hi,
I am facing an issue with the servicemix http-consumer.
It's working fine when I am doing a POST request using WizTools REST client.
But it's not working with simple Java HttpURLConnection client or Ruby
client. I am seeing the following lines in the servicemix log.
2010-08-02 12:38:13,693 | DEBUG |
x.http.jetty.JettyContextManager$ThreadPoolWrapper 467 | Dispatching job:
SCEP@33273308[d=true,io=0,w=true,b=false|false]
2010-08-02 12:38:20,625 | DEBUG | org.apache.servicemix.http.jetty.JCLLogger
70 | REQUEST /service/hotelpublish on
org.mortbay.jetty.HttpConnection@32558d
2010-08-02 12:38:20,626 | DEBUG | org.apache.servicemix.http.jetty.JCLLogger
70 | RESPONSE /service/hotelpublish 302
2010-08-02 12:38:20,627 | DEBUG |
x.http.jetty.JettyContextManager$ThreadPoolWrapper 467 | Dispatching job:
SCEP@33273308[d=true,io=1,w=true,b=false|false]
2010-08-02 12:38:21,761 | DEBUG | org.apache.servicemix.http.jetty.JCLLogger
70 | EOF
I am not sure what's going wrong with these 2 clients(Java, Ruby).
Here is my xbean configuration.
<beans xmlns:bean="http://servicemix.apache.org/bean/1.0"
xmlns:http="http://servicemix.apache.org/http/1.0"
xmlns:hp="http://services.hotel.orbitz.com/hotel-publish">
<http:consumer service="hp:hotelPublishHttpConsumerService"
endpoint="hotelPublishHttpConsumerEndpoint"
locationURI="http://0.0.0.0:8192/service/hotelpublish"
targetService="hp:hotelPublishService"
targetEndpoint="hotelPublishEndpoint"
defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
marshaler="#publishXmlMarshaler" />
<bean id="publishXmlMarshaler"
class="com.orbitz.hotel.publish.PublishXmlMarshaler" />
</beans>
--
View this message in context: http://servicemix.396122.n5.nabble.com/servicemix-http-consumer-issue-tp2262037p2262037.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: servicemix-http consumer issue
Posted by Bhaskar Orbitz <bh...@yahoo.com>.
Thanks JB for looking it into it. I am using Servicemix version 3.3
--
View this message in context: http://servicemix.396122.n5.nabble.com/servicemix-http-consumer-issue-tp2262037p2263029.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: servicemix-http consumer issue
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Bhaskar,
which servicemix-http version do you use ?
Regards
JB
On 08/02/2010 07:40 PM, Bhaskar Orbitz wrote:
>
> Hi,
>
> I am facing an issue with the servicemix http-consumer.
>
> It's working fine when I am doing a POST request using WizTools REST client.
> But it's not working with simple Java HttpURLConnection client or Ruby
> client. I am seeing the following lines in the servicemix log.
>
> 2010-08-02 12:38:13,693 | DEBUG |
> x.http.jetty.JettyContextManager$ThreadPoolWrapper 467 | Dispatching job:
> SCEP@33273308[d=true,io=0,w=true,b=false|false]
> 2010-08-02 12:38:20,625 | DEBUG | org.apache.servicemix.http.jetty.JCLLogger
> 70 | REQUEST /service/hotelpublish on
> org.mortbay.jetty.HttpConnection@32558d
> 2010-08-02 12:38:20,626 | DEBUG | org.apache.servicemix.http.jetty.JCLLogger
> 70 | RESPONSE /service/hotelpublish 302
> 2010-08-02 12:38:20,627 | DEBUG |
> x.http.jetty.JettyContextManager$ThreadPoolWrapper 467 | Dispatching job:
> SCEP@33273308[d=true,io=1,w=true,b=false|false]
> 2010-08-02 12:38:21,761 | DEBUG | org.apache.servicemix.http.jetty.JCLLogger
> 70 | EOF
>
> I am not sure what's going wrong with these 2 clients(Java, Ruby).
>
> Here is my xbean configuration.
>
> <beans xmlns:bean="http://servicemix.apache.org/bean/1.0"
> xmlns:http="http://servicemix.apache.org/http/1.0"
> xmlns:hp="http://services.hotel.orbitz.com/hotel-publish">
>
> <http:consumer service="hp:hotelPublishHttpConsumerService"
> endpoint="hotelPublishHttpConsumerEndpoint"
> locationURI="http://0.0.0.0:8192/service/hotelpublish"
> targetService="hp:hotelPublishService"
> targetEndpoint="hotelPublishEndpoint"
> defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
> marshaler="#publishXmlMarshaler" />
> <bean id="publishXmlMarshaler"
> class="com.orbitz.hotel.publish.PublishXmlMarshaler" />
> </beans>
Re: servicemix-http consumer issue
Posted by Bhaskar Orbitz <bh...@yahoo.com>.
Hi Gert,
I am getting the below message for my Java client as a response to the POST
request. But I was expecting HTTP OK or ACCEPTED response. Do I need to
override any specific methods in DefaultHttpConsumerMarshaler ?
$ java HttpURLConnectionTest
Exception in thread "main" java.io.IOException: Server returned HTTP
response code: 500 for URL: http://localhost:8192/service/hotelpublish/
Here are the log statements that appear in Servicemix after I process the
posted XML using servicemix-bean (HotelPublishBean).
2010-08-04 13:07:40,641 | INFO |
com.orbitz.hotel.publish.services.HotelPublishBean 264 | MasterId:2582151
OnegId:787 NotifyStatusCode:200
2010-08-04 13:08:45,953 | DEBUG |
x.http.jetty.JettyContextManager$ThreadPoolWrapper 467 | Dispatching job:
RetryContinuation@25149369,pending,expired
2010-08-04 13:08:45,954 | DEBUG | org.apache.servicemix.http.jetty.JCLLogger
70 | resume continuation RetryContinuation@25149369,pending,expired
2010-08-04 13:08:45,954 | DEBUG | org.apache.servicemix.http.jetty.JCLLogger
70 | REQUEST /service/hotelpublish/ on
org.mortbay.jetty.HttpConnection@1e9d5e0
2010-08-04 13:08:45,954 | DEBUG | org.apache.servicemix.http.jetty.JCLLogger
70 | servlet=jbiServlet
2010-08-04 13:08:45,955 | DEBUG | org.apache.servicemix.http.jetty.JCLLogger
70 | chain=null
2010-08-04 13:08:45,955 | DEBUG | org.apache.servicemix.http.jetty.JCLLogger
70 | servlet holder=jbiServlet
2010-08-04 13:08:45,955 | DEBUG |
che.servicemix.http.endpoints.HttpConsumerEndpoint 266 | Receiving HTTP
request: POST /service/hotelpublish/ HTTP/1.1
Authorization: Basic aG90ZWxtYXN0ZXI6aG90ZWxtYXN0ZXI=
User-Agent: Java/1.6.0_0
Host: bdabbigodla.duncllc.com:8192
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 252
2010-08-04 13:08:45,956 | DEBUG | org.apache.servicemix.http.jetty.JCLLogger
70 | RESPONSE /service/hotelpublish/ 500
2010-08-04 13:08:45,956 | DEBUG | org.apache.servicemix.http.jetty.JCLLogger
70 | continuation still pending null
2010-08-04 13:08:45,956 | DEBUG | org.apache.servicemix.http.jetty.JCLLogger
70 | continuation RetryContinuation@25149369
2010-08-04 13:08:45,967 | DEBUG |
x.http.jetty.JettyContextManager$ThreadPoolWrapper 467 | Dispatching job:
SCEP@4034043[d=true,io=1,w=true,b=false|false]
2010-08-04 13:08:45,968 | DEBUG | org.apache.servicemix.http.jetty.JCLLogger
65 | EXCEPTION
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:21)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:233)
at sun.nio.ch.IOUtil.read(IOUtil.java:206)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:236)
at org.mortbay.io.nio.ChannelEndPoint.fill(ChannelEndPoint.java:131)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:283)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:205)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:377)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451)
2010-08-04 13:08:45,969 | DEBUG | org.apache.servicemix.http.jetty.JCLLogger
70 | EOF
2010-08-04 13:08:45,969 | DEBUG | org.apache.servicemix.http.jetty.JCLLogger
70 | continuation RetryContinuation@25149369
Thanks,
Bhaskar
--
View this message in context: http://servicemix.396122.n5.nabble.com/servicemix-http-consumer-issue-tp2262037p2264462.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: servicemix-http consumer issue
Posted by Bhaskar Orbitz <bh...@yahoo.com>.
Hi Gert,
You are awesome!!!
It worked when I add a slash at the end as you have suggested both from Ruby
and Java clients.
How do I know whether to add a slash at the end or not?
Thanks,
Bhaskar
--
View this message in context: http://servicemix.396122.n5.nabble.com/servicemix-http-consumer-issue-tp2262037p2263188.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: servicemix-http consumer issue
Posted by Gert Vanthienen <ge...@gmail.com>.
L.S.,
>From the logging, I notice that the endpoint is sending back a HTTP
status 302 (which is a redirect). My guess is that the redirect tells
your client to redirect to http://...:8192/service/hotelpublish/
(notice the trailing / ). Your simple Java/Ruby script probably does
not handle this case, where the WizTools tooling does follow through
on the redirect.
Could you try coding your simple Java/Ruby client to access the URL
with the trailing / instead to see if that can confirm my suspicion?
Regards,
Gert Vanthienen
------------------------
Open Source SOA: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/
On 2 August 2010 19:40, Bhaskar Orbitz <bh...@yahoo.com> wrote:
>
> Hi,
>
> I am facing an issue with the servicemix http-consumer.
>
> It's working fine when I am doing a POST request using WizTools REST client.
> But it's not working with simple Java HttpURLConnection client or Ruby
> client. I am seeing the following lines in the servicemix log.
>
> 2010-08-02 12:38:13,693 | DEBUG |
> x.http.jetty.JettyContextManager$ThreadPoolWrapper 467 | Dispatching job:
> SCEP@33273308[d=true,io=0,w=true,b=false|false]
> 2010-08-02 12:38:20,625 | DEBUG | org.apache.servicemix.http.jetty.JCLLogger
> 70 | REQUEST /service/hotelpublish on
> org.mortbay.jetty.HttpConnection@32558d
> 2010-08-02 12:38:20,626 | DEBUG | org.apache.servicemix.http.jetty.JCLLogger
> 70 | RESPONSE /service/hotelpublish 302
> 2010-08-02 12:38:20,627 | DEBUG |
> x.http.jetty.JettyContextManager$ThreadPoolWrapper 467 | Dispatching job:
> SCEP@33273308[d=true,io=1,w=true,b=false|false]
> 2010-08-02 12:38:21,761 | DEBUG | org.apache.servicemix.http.jetty.JCLLogger
> 70 | EOF
>
> I am not sure what's going wrong with these 2 clients(Java, Ruby).
>
> Here is my xbean configuration.
>
> <beans xmlns:bean="http://servicemix.apache.org/bean/1.0"
> xmlns:http="http://servicemix.apache.org/http/1.0"
> xmlns:hp="http://services.hotel.orbitz.com/hotel-publish">
>
> <http:consumer service="hp:hotelPublishHttpConsumerService"
> endpoint="hotelPublishHttpConsumerEndpoint"
> locationURI="http://0.0.0.0:8192/service/hotelpublish"
> targetService="hp:hotelPublishService"
> targetEndpoint="hotelPublishEndpoint"
> defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
> marshaler="#publishXmlMarshaler" />
> <bean id="publishXmlMarshaler"
> class="com.orbitz.hotel.publish.PublishXmlMarshaler" />
> </beans>
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/servicemix-http-consumer-issue-tp2262037p2262037.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>