Camel HTTPS Webservice Consumption - HTTP Status Code 500

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Camel HTTPS Webservice Consumption - HTTP Status Code 500

muruga
I am able to successfully negotiate the SSL handshake and after that it fails with HTTP Status Code: 500.

We are using the DataPower to access the secured WS. I am able to invoke the service through SoapUI and it goes through fine. It fails when I invoke from Camel. Our DataPower guys says that they are seeing the response coming back and returned to the application. Any thoughts, would be greatly appreciated.

org.apache.camel.component.http.HttpOperationFailedException: HTTP operation failed invoking https://xx.x.x.x.x.x:5618/Reservation with statusCode: 500 at org.apache.camel.component.http.HttpProducer.populateHttpOperationFailedException(HttpProducer.java:229)[camel-http-2.10.2.jar:2.10.2] at org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:157)[camel-http-2.10.2.jar:2.10.2]
Reply | Threaded
Open this post in threaded view
|

Re: Camel HTTPS Webservice Consumption - HTTP Status Code 500

muruga
Can someone help me with this?
Reply | Threaded
Open this post in threaded view
|

Re: Camel HTTPS Webservice Consumption - HTTP Status Code 500

Christian Mueller
Administrator
Which Camel component do you use?
If you use Camel CXF, could you enable the logging in interceptor?

Sent from a mobile device
Am 15.11.2012 17:17 schrieb "muruga" <[hidden email]>:

> Can someone help me with this?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-HTTPS-Webservice-Consumption-HTTP-Status-Code-500-tp5722782p5722785.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Camel HTTPS Webservice Consumption - HTTP Status Code 500

muruga
Thanks for your help!  Appreciate that.

Here is my camel config xml.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:camel="http://camel.apache.org/schema/spring"
       xmlns:cxf="http://camel.apache.org/schema/cxf"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:http="http://cxf.apache.org/transports/http/configuration"
       xmlns:sec="http://cxf.apache.org/configuration/security"
       xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
       http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
       http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
       http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd
       http://cxf.apache.org/transports/http-jetty/configuration http://cxf.apache.org/schemas/configuration/http-jetty.xsd 
       ">

  <import resource="classpath:META-INF/cxf/cxf.xml"/>

 
  <context:property-placeholder location="classpath:incident.properties,file:target/custom.properties"
                                ignore-resource-not-found="true"/>

 
  <bean id="enrichBean" class="org.apache.camel.example.cxf.proxy.EnrichBean"/>
  <bean id="getReservationBean" class="com.marriott.webserivce.test.InputGetReservation"/>
  <bean id="getResponseBean" class="com.marriott.webserivce.test.OutputGetReservation"/>
  <bean id="controllListBean" class="com.marriott.webserivce.test.GetControllList"/>
  <bean id="reservationResponseBean" class="com.marriott.webserivce.test.GetReservationResponse"/>
  <bean id="reservationControlListBean" class="com.marriott.webserivce.test.ReservationControlListBean"/>

        <bean id="camelTracer" class="org.apache.camel.processor.interceptor.Tracer">
            <property name="traceExceptions" value="true"/>
            <property name="traceInterceptors" value="true"/>
          <property name="traceOutExchanges" value="true" />
        </bean>
       
        <bean id="traceFormatter" class="org.apache.camel.processor.interceptor.DefaultTraceFormatter">
          <property name="showOutBody" value="true" />
          <property name="showOutBodyType" value="true" />
          <property name="showException" value="true" />
        </bean>

 
  <cxf:cxfEndpoint id="getReservation"
                   address="<a href="http://localhost:$">http://localhost:${proxy.port}/camel-example-cxf-proxy/webservices/get_reservation"
                   endpointName="s:GetReservationEndpoint"
                   serviceName="s:GetReservationEndpointService"
                   wsdlURL="etc/reservation.wsdl"
                   serviceClass="com.marriott.webserivce.test.GetReservationEndpointService"
                   xmlns:s="http://reservation.marriott.com/services"/>                   
 
  <http:conduit name="*.http-conduit">
                <http:tlsClientParameters secureSocketProtocol="SSL" >
                        <sec:keyManagers keyPassword="mcom123">
                                <sec:keyStore type="JKS" password="mcom123" file="C:/Temp/testcert.jks" />
                        </sec:keyManagers>
                        <sec:trustManagers>
                                <sec:keyStore type="JKS" password="mcom123" file="C:/Temp/testcert.jks" />
                        </sec:trustManagers>
                        <sec:cipherSuitesFilter>
                                <sec:include>.*.*</sec:include>
                        </sec:cipherSuitesFilter>
                </http:tlsClientParameters>
                <http:client AllowChunking="true" /> 
        </http:conduit> 
 
  <camelContext trace="true"  xmlns="http://camel.apache.org/schema/spring">
    <propertyPlaceholder location="classpath:incident.properties,file:target/custom.properties" id="properties"/>
    <endpoint uri="http://dsasdf.sdf.sadf.sdf.sf/content/services/Service_v1" id="callGetControlList"/>
    <endpoint uri="https://asfdasdf.adf.asf.asdf:5618/Reservation" id="callReservationWS"/>
    <endpoint uri="https://asdfasfasdf.asdf.sadf.asf.sdf:5070/Processor_v3" id="callRewardsWS"/>
    <route>
        <from uri="cxf:bean:getReservation"/>
        <to uri="bean:reservationControlListBean?method=getReservationRequest"/>
        <to uri="log:input"/>
        <to ref="callReservationWS"/>
    </route>
</camelContext>

</beans>


NOTE:  the URLs are mocked when posted here.
Reply | Threaded
Open this post in threaded view
|

Re: Camel HTTPS Webservice Consumption - HTTP Status Code 500

Christian Mueller
Administrator
Could you change

<cxf:cxfEndpoint id="getReservation"
  address="http://localhost:
${proxy.port}/camel-example-cxf-proxy/webservices/get_reservation"
  endpointName="s:GetReservationEndpoint"
  serviceName="s:GetReservationEndpointService"
  wsdlURL="etc/reservation.wsdl"
  serviceClass="com.marriott.webserivce.test.GetReservationEndpointService"
  xmlns:s="http://reservation.marriott.com/services"/>

to

<cxf:cxfEndpoint id="getReservation"
  address="http://localhost:
${proxy.port}/camel-example-cxf-proxy/webservices/get_reservation"
  endpointName="s:GetReservationEndpoint"
  serviceName="s:GetReservationEndpointService"
  wsdlURL="etc/reservation.wsdl"
  serviceClass="com.marriott.webserivce.test.GetReservationEndpointService"
  xmlns:s="http://reservation.marriott.com/services">

  <cxf:inInterceptors>
      <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
  </cxf:inInterceptors>
  <cxf:outInterceptors>
      <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
  </cxf:outInterceptors>
  <cxf:inFaultInterceptors>
      <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
  </cxf:inFaultInterceptors>
  <cxf:outFaultInterceptors>
      <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
  </cxf:outFaultInterceptors>
</cxf:cxfEndpoint>

and check the log file.

Best,
Christian

On Thu, Nov 15, 2012 at 10:53 PM, muruga <[hidden email]> wrote:

> Thanks for your help!  Appreciate that.
>
> Here is my camel config xml.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xmlns:camel="http://camel.apache.org/schema/spring"
>        xmlns:cxf="http://camel.apache.org/schema/cxf"
>        xmlns:context="http://www.springframework.org/schema/context"
>        xmlns:http="http://cxf.apache.org/transports/http/configuration"
>        xmlns:sec="http://cxf.apache.org/configuration/security"
>
> xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
>        xsi:schemaLocation="
>        http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
>        http://www.springframework.org/schema/context
> http://www.springframework.org/schema/context/spring-context.xsd
>        http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd
>        http://camel.apache.org/schema/cxf
> http://camel.apache.org/schema/cxf/camel-cxf.xsd
>        http://cxf.apache.org/transports/http/configuration
> http://cxf.apache.org/schemas/configuration/http-conf.xsd
>        http://cxf.apache.org/configuration/security
> http://cxf.apache.org/schemas/configuration/security.xsd
>        http://cxf.apache.org/transports/http-jetty/configuration
> http://cxf.apache.org/schemas/configuration/http-jetty.xsd
>        ">
>
>   <import resource="classpath:META-INF/cxf/cxf.xml"/>
>
>
>   <context:property-placeholder
> location="classpath:incident.properties,file:target/custom.properties"
>                                 ignore-resource-not-found="true"/>
>
>
>   <bean id="enrichBean"
> class="org.apache.camel.example.cxf.proxy.EnrichBean"/>
>   <bean id="getReservationBean"
> class="com.marriott.webserivce.test.InputGetReservation"/>
>   <bean id="getResponseBean"
> class="com.marriott.webserivce.test.OutputGetReservation"/>
>   <bean id="controllListBean"
> class="com.marriott.webserivce.test.GetControllList"/>
>   <bean id="reservationResponseBean"
> class="com.marriott.webserivce.test.GetReservationResponse"/>
>   <bean id="reservationControlListBean"
> class="com.marriott.webserivce.test.ReservationControlListBean"/>
>
>         <bean id="camelTracer"
> class="org.apache.camel.processor.interceptor.Tracer">
>             <property name="traceExceptions" value="true"/>
>             <property name="traceInterceptors" value="true"/>
>                 <property name="traceOutExchanges" value="true" />
>         </bean>
>
>         <bean id="traceFormatter"
> class="org.apache.camel.processor.interceptor.DefaultTraceFormatter">
>           <property name="showOutBody" value="true" />
>           <property name="showOutBodyType" value="true" />
>           <property name="showException" value="true" />
>         </bean>
>
>
>         <cxf:cxfEndpoint id="getReservation"
>
> address="http://localhost:
> ${proxy.port}/camel-example-cxf-proxy/webservices/get_reservation"
>                    endpointName="s:GetReservationEndpoint"
>                    serviceName="s:GetReservationEndpointService"
>                    wsdlURL="etc/reservation.wsdl"
>
> serviceClass="com.marriott.webserivce.test.GetReservationEndpointService"
>                    xmlns:s="http://reservation.marriott.com/services"/>
>
>         <http:conduit name="*.http-conduit">
>                 <http:tlsClientParameters secureSocketProtocol="SSL" >
>                         <sec:keyManagers keyPassword="mcom123">
>                                 <sec:keyStore type="JKS"
> password="mcom123" file="C:/Temp/testcert.jks"
> />
>                         </sec:keyManagers>
>                         <sec:trustManagers>
>                                 <sec:keyStore type="JKS"
> password="mcom123" file="C:/Temp/testcert.jks"
> />
>                         </sec:trustManagers>
>                         <sec:cipherSuitesFilter>
>                                 <sec:include>.*.*</sec:include>
>                         </sec:cipherSuitesFilter>
>                 </http:tlsClientParameters>
>                 <http:client AllowChunking="true" />
>         </http:conduit>
>
>   <camelContext trace="true"  xmlns="http://camel.apache.org/schema/spring
> ">
>     <propertyPlaceholder
> location="classpath:incident.properties,file:target/custom.properties"
> id="properties"/>
>     <endpoint
> uri="http://dsasdf.sdf.sadf.sdf.sf/content/services/Service_v1"
> id="callGetControlList"/>
>     <endpoint uri="https://asfdasdf.adf.asf.asdf:5618/Reservation"
> id="callReservationWS"/>
>     <endpoint uri="https://asdfasfasdf.asdf.sadf.asf.sdf:5070/Processor_v3
> "
> id="callRewardsWS"/>
>     <route>
>         <from uri="cxf:bean:getReservation"/>
>         <to
> uri="bean:reservationControlListBean?method=getReservationRequest"/>
>         <to uri="log:input"/>
>         <to ref="callReservationWS"/>
>     </route>
> </camelContext>
>
> </beans>
>
>
> *NOTE: * the URLs are mocked when posted here.
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-HTTPS-Webservice-Consumption-HTTP-Status-Code-500-tp5722782p5722806.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--
Reply | Threaded
Open this post in threaded view
|

Re: Camel HTTPS Webservice Consumption - HTTP Status Code 500

muruga
Thank you!  I will try that out and let you know.
Reply | Threaded
Open this post in threaded view
|

Re: Camel HTTPS Webservice Consumption - HTTP Status Code 500

Willem.Jiang
Administrator
In reply to this post by muruga
Hi,
Can you check the log file ?
If camel-cxf producer get some thing wrong, you should be able to tell from the stack trace in the log file.


--
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang
Weibo: willemjiang





On Thursday, November 15, 2012 at 11:35 PM, muruga wrote:

> I am able to successfully negotiate the SSL handshake and after that it fails
> with HTTP Status Code: 500.
>
> We are using the DataPower to access the secured WS. I am able to invoke the
> service through SoapUI and it goes through fine. It fails when I invoke from
> Camel. Our DataPower guys says that they are seeing the response coming back
> and returned to the application. Any thoughts, would be greatly appreciated.
>
> org.apache.camel.component.http.HttpOperationFailedException: HTTP operation
> failed invoking https://xx.x.x.x.x.x:5618/Reservation with statusCode: 500
> at
> org.apache.camel.component.http.HttpProducer.populateHttpOperationFailedException(HttpProducer.java:229)[camel-http-2.10.2.jar:2.10.2]
> at
> org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:157)[camel-http-2.10.2.jar:2.10.2]
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-HTTPS-Webservice-Consumption-HTTP-Status-Code-500-tp5722782.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).