Restlet Response - Decoding issue

2016-01-17 Thread contactreji
Hello 

I have a camel route like this

from("restlet:http://0.0.0.0:7839/dwb/item?restletMethods=get;)
.log('MESSAGE RECEIVED AT ITEM SERVICE  ${body}. query
parameters are as follows ${in.header.CamelHttpQuery}')
.process(new QueryParameterParser())
.process(new ParseDPCI())
.to("velocity:velocityTemplates/ItemServiceFormat.vm")
.log('SOAP Request - ${body}')
.removeHeaders("*")
.setHeader("SOAPAction").simple('')
   
.setHeader("Content-Type").constant("application/xml;charset=UTF-8")
   
.to("cxf:http://tmci-stores.target.com:80/TMCI/services/ItemAvailabilityServicePort?dataFormat=MESSAGE;)
.convertBodyTo(java.lang.String)
.log('SOAP Response - ${body}')
   
.setProperty("itemAvailability",ns.xpath("//p693:responseBody/p693:itemStoreAvailability/p693:itemAvailabilityStatus/text()"))
   
.setHeader("CamelHttpUri").simple('http://tws.target.com/webapp/wcs/stores/servlet/ItemLookup?IdType=DPCI=${property.dpciWithoutHipen}=MerchantItemAttributes%2cIACAttributes%2cReviews=***Secret**')
   
.to('http://tws.target.com/webapp/wcs/stores/servlet/ItemLookup')
.convertBodyTo(java.lang.String)   
   
.setProperty("Description",xpath("//Items/Item/ASIN/text()"))
.to("xquery:xquery/itemavailability.xq")
.convertBodyTo(java.lang.String)
.log('Response from Integration layer - ${body}')  
.end()

For composing the response, I am hitting a soap service as well as a rest
service before returning back to the rest client. Everything works perfect.
In soap UI log, I can see the response received. 

But I see that SOAP UI is not able to show the response message and it keeps
waiting untill the socket timeout happens.

Can someone tell me why it waits for the socket timeout though SOAP UI shows
the response xml received back from the camel route?


Camel Log
--
[main] INFO org.apache.camel.spring.SpringCamelContext - Route: route2
started and consuming from:
Endpoint[http://0.0.0.0:7839/dwb/item?restletMethods=GET]
[main] INFO org.apache.camel.spring.SpringCamelContext - Total 2 routes, of
which 2 is started.
[main] INFO org.apache.camel.spring.SpringCamelContext - Apache Camel 2.15.1
(CamelContext: DCIContext) started in 3.091 seconds
[Restlet-1872012709] INFO route2 - MESSAGE RECEIVED AT ITEM SERVICE  . query
parameters are as follows dpci=037-13-0991=1375
[Restlet-1872012709] INFO route2 - SOAP Request - http://schemas.xmlsoap.org/soap/envelope/;
xmlns:ns="http://schemas.target.com/schemas/Store/ItemAvailabilitySchema/V1/2006-03-28;
xmlns:ns1="http://schemas.target.com/schemas/Store/TMCICommonSchema/V1/2006-03-28;>
   
   
  
 
DWBUSER
2010-03-22T00:00:00.000+05:00
DWB

?

false
 
 

1375

   037
   13
   0991

 
  
   

[default-workqueue-1] INFO route2 - SOAP Response - http://schemas.xmlsoap.org/soap/envelope/;
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/;
xmlns:xsd="http://www.w3.org/2001/XMLSchema;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;>http://schemas.target.com/schemas/Store/ItemAvailabilitySchema/V1/2006-03-28;>http://schemas.target.com/schemas/Store/TMCICommonSchema/V1/2006-03-28;>DWBUSERhttp://schemas.target.com/schemas/Store/TMCICommonSchema/V1/2006-03-28;>2016-01-18T07:12:57.552Zhttp://schemas.target.com/schemas/Store/TMCICommonSchema/V1/2006-03-28;>DWBhttp://schemas.target.com/schemas/Store/TMCICommonSchema/V1/2006-03-28;>?http://schemas.target.com/schemas/Store/TMCICommonSchema/V1/2006-03-28;>013753
[default-workqueue-1] INFO org.apache.camel.builder.xml.XPathBuilder -
Created default XPathFactory org.apache.xpath.jaxp.XPathFactoryImpl@fe9aee8
[default-workqueue-1] WARN org.apache.commons.httpclient.HttpMethodBase -
Cookie rejected: "$Version=0; twsakalb=scs; $Path=/; $Domain=target.com".
Domain attribute "target.com" violates RFC 2109: domain must start with a
dot
[default-workqueue-1] INFO route2 - Response from Integration layer -
037130991BA4EW3TBDTBDTBDTBDTBDTBDTBDTBD13753
Jan 18, 2016 12:43:05 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2016-01-1812:43:050:0:0:0:0:0:0:1 -   -   7839
GET /dwb/item
dpci=037-13-0991=1375   200 95510   9400
http://localhost:7839
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/47.0.2526.106 Safari/537.36  -








Jetty Log in SOAP UI
--
Mon Jan 18 12:44:21 IST 2016:DEBUG:>> "GET
/dwb/item?dpci=037-13-0991=1375 HTTP/1.1[\r][\n]"
Mon Jan 18 12:44:21 IST 2016:DEBUG:>> "Accept-Encoding:

Re: Exchange has SOAPMessage want to Send to JMS Topic

2016-01-17 Thread Willem Jiang
If you can treat the SOAPMessage as a stream, you can just redirect this stream 
to the JMS topic without doing anything more.

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 15, 2016 at 2:54:02 PM, sanjay.gautam (sanjay.gau...@gmail.com) 
wrote:
> I am new to the Camel world and what I am trying to do is as follows.
>  
> 1. There is a route which is Servlet Component which is called by external
> System.
> 2. MyServlet CamelComponent Reads the incoming exchange and creates the
> SOAPMessage.
> 3. In Next Step I want to send the SOAP message to JMS Topic.
>  
> > class="org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory">  
>  
>  
>  
>  
>  
> > class="org.apache.camel.component.jms.JmsConfiguration">
>  
>  
>  
>  
> > class="org.apache.activemq.camel.component.ActiveMQComponent">
>  
>  
>  
> JMS ROUTE
> At this point I Have a Exchange with SOAPMessage into it and as per the SOAP
> documentation I should be able to send SOAP message via JMS , but as per
> document JMS can take only few types ?
> I was expecting that CAMEL might have some internal Converter like
> MessageTransformer.SOAPMessageIntoJMSMessage(soapMessage, session);
> which help in converting the message . I tried Spring Converter but it
> doesnt not convert actually.
>  
>  
>  
>  
>  
> > uri="activemq:topic:exampleTopic?messageConverter=#jmsMsgConverter"
> pattern="InOnly" />
>  
>  
> OK
>  
>  
>  
>  
>  
> java.lang.Exception
>  
>  
>  
>  
>  
>  
> Please suggest me any option , I can surely unmarshel and get the details
> form the SOAP message but i dont want to do that as that is not our
> requirement. we dont need to looking into the message
>  
> thanks
> Sanjay G
>  
>  
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Exchange-has-SOAPMessage-want-to-Send-to-JMS-Topic-tp5776268.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>