You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by scottj <sc...@outlook.com> on 2013/10/15 22:06:47 UTC

Send XML over HTTPS

hello,
I'm using camel 2.12.1 with https4 to try to send a simple XML, but I keep
getting 400 Bad Request when trying to send... Any suggestions on why is
highly appreciated. The body of the Exchange is just plain String.



[ant:jettyRun] [PROVIDER.Eb] [to1               ]
[https4:ws.acme.com/xml/service                                     ] [     
1631]
[ant:jettyRun] 
[ant:jettyRun] Exchange
[ant:jettyRun]
---------------------------------------------------------------------------------------------------------------------------------------
[ant:jettyRun] Exchange[
[ant:jettyRun] 	Id                  ID-52901-1381866674115-0-1
[ant:jettyRun] 	ExchangePattern     InOnly
[ant:jettyRun] 	Headers            
{breadcrumbId=bfe2c9c1-28ad-41de-a458-09b53ab37528, CamelHttpMethod=POST,
CamelRedelivered=false, CamelRedeliveryCounter=0, Content-Type=text/xml}
[ant:jettyRun] 	BodyType            String
[ant:jettyRun] 	Body                 <?xml version="1.0"
encoding="UTF-8"?><ShoppingRequest
xmlns='http://ws.acme.com/schemas/2008/A'>
[ant:jettyRun]   <Slices refundableOnly='false'>
[ant:jettyRun]     <FooType code='C' />
[ant:jettyRun]     <Slice>
[ant:jettyRun]       <Arriving>
[ant:jettyRun]         <City code='NYC' />
[ant:jettyRun]         <Date>2013-10-24</Date>
[ant:jettyRun]       </Arriving>
[ant:jettyRun]     </Slice>
[ant:jettyRun]   </Slices>
[ant:jettyRun] </ShoppingRequest>
[ant:jettyRun] ]
[ant:jettyRun] 
[ant:jettyRun] Stacktrace
[ant:jettyRun]
---------------------------------------------------------------------------------------------------------------------------------------
[ant:jettyRun]
org.apache.camel.component.http4.HttpOperationFailedException: HTTP
operation failed invoking https://ws.acme.com:443/xml/service with
statusCode: 400
[ant:jettyRun] 	at
org.apache.camel.component.http4.HttpProducer.populateHttpOperationFailedException(HttpProducer.java:237)
~[camel-http4-2.12.1.jar:2.12.1]
[ant:jettyRun] 	at
org.apache.camel.component.http4.HttpProducer.process(HttpProducer.java:165)
~[camel-http4-2.12.1.jar:2.12.1]
[ant:jettyRun] 	at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
~[camel-core-2.12.1.jar:2.12.1]
[ant:jettyRun] 	at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:110)
~[camel-core-2.12.1.jar:2.12.1]




--
View this message in context: http://camel.465427.n5.nabble.com/Send-XML-over-HTTPS-tp5741619.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Send XML over HTTPS

Posted by Christian Müller <ch...@gmail.com>.
Thanks for sharing your solution!

Best,

Christian
-----------------

Software Integration Specialist

Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Fri, Nov 22, 2013 at 4:21 PM, henrik <he...@synth.no> wrote:

> For future reference:
>
> camel-http sent our request as POST, with a Host header.
>
> camel-http4 sent it as GET, without a Host header.
>
> Explicitly setting POST and the Host header solved our problem.
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Send-XML-over-HTTPS-tp5741619p5743695.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Send XML over HTTPS

Posted by Willem jiang <wi...@gmail.com>.
Can I have a look at the camel route and the message that you send to the camel-http4 endpoint?

If the message body is not null, camel-http4 should use the POST method to send the message.
I also wants to know why camel-http4 lost the Host header,


--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem




On Friday, November 22, 2013 at 11:21 PM, henrik wrote:

> For future reference:
>  
> camel-http sent our request as POST, with a Host header.
>  
> camel-http4 sent it as GET, without a Host header.
>  
> Explicitly setting POST and the Host header solved our problem.
>  
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Send-XML-over-HTTPS-tp5741619p5743695.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).




Re: Send XML over HTTPS

Posted by henrik <he...@synth.no>.
For future reference:

camel-http sent our request as POST, with a Host header.

camel-http4 sent it as GET, without a Host header.

Explicitly setting POST and the Host header solved our problem.




--
View this message in context: http://camel.465427.n5.nabble.com/Send-XML-over-HTTPS-tp5741619p5743695.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Send XML over HTTPS

Posted by Christian Müller <ch...@gmail.com>.
Can you share the route or an unit test with us?

Best,

Christian
-----------------

Software Integration Specialist

Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Sat, Oct 26, 2013 at 10:48 PM, scottj <sc...@outlook.com> wrote:

> bumping this. Anyone know why http would works where http4 fails?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Send-XML-over-HTTPS-tp5741619p5742263.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Send XML over HTTPS

Posted by scottj <sc...@outlook.com>.
bumping this. Anyone know why http would works where http4 fails?



--
View this message in context: http://camel.465427.n5.nabble.com/Send-XML-over-HTTPS-tp5741619p5742263.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Send XML over HTTPS

Posted by scottj <sc...@outlook.com>.
seems like everything works fine when I downgraded from https4 to https. How
come!? Any clues on this?



--
View this message in context: http://camel.465427.n5.nabble.com/Send-XML-over-HTTPS-tp5741619p5741626.html
Sent from the Camel - Users mailing list archive at Nabble.com.