You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by akamp <ar...@kadaster.nl> on 2011/08/19 11:12:56 UTC
Setting options on http-request in spring-ws component
Hi all,
I'm using the Camel spring-ws component to send a soap message to SAP-PI.
The syntax for the SAP-PI url is:
http://machine.domain.com:57000/XISOAPAdapter/MessageServlet?channel=value
So, the SAP-PI url has its own option after the '?'.
If Camel parses this endpoint the following exception is raised because
Camel expects a spring-ws component option after the '?'.
Failed to resolve endpoint:
spring-ws://http://machine.domain.com:57000/XISOAPAdapter/MessageServlet?channel=value%3FmessageFactory%3D%23messageFactory&messageSender=%23messageSender
due to: There are 1 parameters that couldn't be set on the endpoint. Check
the uri if the parameters are spelt correctly and that they are properties
of the endpoint. Unknown
parameters=[{channel=value?messageFactory=#messageFactory}]
How can I set options on the http request used the spring-ws component in
Camel.
Thanks in advance.
Arno
--
View this message in context: http://camel.465427.n5.nabble.com/Setting-options-on-http-request-in-spring-ws-component-tp4714995p4714995.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Setting options on http-request in spring-ws component
Posted by Taariq Levack <ta...@gmail.com>.
Btw I copy/pasted that config from a page in my browser cache, I meant to put your header name for clarity but I'm sure you've noticed that already.
So you won't need a processor for this if you don't want it.
Taariq
> <setHeader headerName="CamelSpringWebserviceEndpointUri> <constant>yourURI</constant>
> </setHeader>
>>
On 19 Aug 2011, at 9:02 PM, Taariq Levack <ta...@gmail.com> wrote:
> I thought you'd inject a ProducerTemplate and call sendBodyAndHeader, or add the header some other way[1], but if that works then great.
> I frankly don't know if it's a workaround or how it should be used, but it's what I'd reach for.
>
> [1]
> <setHeader headerName="origin"> <constant>file</constant>
> </setHeader>
>
> Taariq
>
> On 19 Aug 2011, at 8:43 PM, akamp <ar...@kadaster.nl> wrote:
>
>> This workaround fixes the problem.
>> Setting the header was done in a processor:
>>
>> public class UriProcessor implements Processor {
>> private String uri;
>>
>> public void process(Exchange exchange) throws Exception {
>>
>> exchange.getIn().setHeader(SpringWebserviceConstants.SPRING_WS_ENDPOINT_URI,
>> getUri());
>> }
>> ..........
>> This processor was inserted in the route, just before the endpoint with the
>> uri with the '?' in it.
>> The spring-ws component was given a dummy uri:
>> spring-ws:http://dummy?messageFactory=#messageFactory..etc
>>
>>
>> Taariq Levack wrote:
>>>
>>>
>>> that component also has a header CamelSpringWebserviceEndpointUri, which
>>> you
>>> can use to set the URI afterwards.
>>> Can you try creating the endpoint without the params and then using the
>>> actual URI in the header?
>>>
>>> Taariq
>>>
>>> On Fri, Aug 19, 2011 at 11:12 AM, akamp <arno.vandekamp@kadaster.nl>
>>> wrote:
>>>
>>>> Hi all,
>>>>
>>>> I'm using the Camel spring-ws component to send a soap message to SAP-PI.
>>>> The syntax for the SAP-PI url is:
>>>> http://machine.domain.com:57000/XISOAPAdapter/MessageServlet?channel=value
>>>> So, the SAP-PI url has its own option after the '?'.
>>>>
>>>> If Camel parses this endpoint the following exception is raised because
>>>> Camel expects a spring-ws component option after the '?'.
>>>>
>>>> Failed to resolve endpoint:
>>>> spring-ws://
>>>> http://machine.domain.com:57000/XISOAPAdapter/MessageServlet?channel=value%3FmessageFactory%3D%23messageFactory&messageSender=%23messageSender
>>>> due to: There are 1 parameters that couldn't be set on the endpoint.
>>>> Check
>>>> the uri if the parameters are spelt correctly and that they are
>>>> properties
>>>> of the endpoint. Unknown
>>>> parameters=[{channel=value?messageFactory=#messageFactory}]
>>>>
>>>> How can I set options on the http request used the spring-ws component in
>>>> Camel.
>>>>
>>>> Thanks in advance.
>>>> Arno
>>>>
>>>> --
>>>> View this message in context:
>>>> http://camel.465427.n5.nabble.com/Setting-options-on-http-request-in-spring-ws-component-tp4714995p4714995.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>
>>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/Setting-options-on-http-request-in-spring-ws-component-tp4714995p4716645.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Setting options on http-request in spring-ws component
Posted by Taariq Levack <ta...@gmail.com>.
I thought you'd inject a ProducerTemplate and call sendBodyAndHeader, or add the header some other way[1], but if that works then great.
I frankly don't know if it's a workaround or how it should be used, but it's what I'd reach for.
[1]
<setHeader headerName="origin"> <constant>file</constant>
</setHeader>
Taariq
On 19 Aug 2011, at 8:43 PM, akamp <ar...@kadaster.nl> wrote:
> This workaround fixes the problem.
> Setting the header was done in a processor:
>
> public class UriProcessor implements Processor {
> private String uri;
>
> public void process(Exchange exchange) throws Exception {
>
> exchange.getIn().setHeader(SpringWebserviceConstants.SPRING_WS_ENDPOINT_URI,
> getUri());
> }
> ..........
> This processor was inserted in the route, just before the endpoint with the
> uri with the '?' in it.
> The spring-ws component was given a dummy uri:
> spring-ws:http://dummy?messageFactory=#messageFactory..etc
>
>
> Taariq Levack wrote:
>>
>>
>> that component also has a header CamelSpringWebserviceEndpointUri, which
>> you
>> can use to set the URI afterwards.
>> Can you try creating the endpoint without the params and then using the
>> actual URI in the header?
>>
>> Taariq
>>
>> On Fri, Aug 19, 2011 at 11:12 AM, akamp <arno.vandekamp@kadaster.nl>
>> wrote:
>>
>>> Hi all,
>>>
>>> I'm using the Camel spring-ws component to send a soap message to SAP-PI.
>>> The syntax for the SAP-PI url is:
>>> http://machine.domain.com:57000/XISOAPAdapter/MessageServlet?channel=value
>>> So, the SAP-PI url has its own option after the '?'.
>>>
>>> If Camel parses this endpoint the following exception is raised because
>>> Camel expects a spring-ws component option after the '?'.
>>>
>>> Failed to resolve endpoint:
>>> spring-ws://
>>> http://machine.domain.com:57000/XISOAPAdapter/MessageServlet?channel=value%3FmessageFactory%3D%23messageFactory&messageSender=%23messageSender
>>> due to: There are 1 parameters that couldn't be set on the endpoint.
>>> Check
>>> the uri if the parameters are spelt correctly and that they are
>>> properties
>>> of the endpoint. Unknown
>>> parameters=[{channel=value?messageFactory=#messageFactory}]
>>>
>>> How can I set options on the http request used the spring-ws component in
>>> Camel.
>>>
>>> Thanks in advance.
>>> Arno
>>>
>>> --
>>> View this message in context:
>>> http://camel.465427.n5.nabble.com/Setting-options-on-http-request-in-spring-ws-component-tp4714995p4714995.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Setting-options-on-http-request-in-spring-ws-component-tp4714995p4716645.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Setting options on http-request in spring-ws component
Posted by akamp <ar...@kadaster.nl>.
This workaround fixes the problem.
Setting the header was done in a processor:
public class UriProcessor implements Processor {
private String uri;
public void process(Exchange exchange) throws Exception {
exchange.getIn().setHeader(SpringWebserviceConstants.SPRING_WS_ENDPOINT_URI,
getUri());
}
..........
This processor was inserted in the route, just before the endpoint with the
uri with the '?' in it.
The spring-ws component was given a dummy uri:
spring-ws:http://dummy?messageFactory=#messageFactory..etc
Taariq Levack wrote:
>
>
> that component also has a header CamelSpringWebserviceEndpointUri, which
> you
> can use to set the URI afterwards.
> Can you try creating the endpoint without the params and then using the
> actual URI in the header?
>
> Taariq
>
> On Fri, Aug 19, 2011 at 11:12 AM, akamp <arno.vandekamp@kadaster.nl>
> wrote:
>
>> Hi all,
>>
>> I'm using the Camel spring-ws component to send a soap message to SAP-PI.
>> The syntax for the SAP-PI url is:
>> http://machine.domain.com:57000/XISOAPAdapter/MessageServlet?channel=value
>> So, the SAP-PI url has its own option after the '?'.
>>
>> If Camel parses this endpoint the following exception is raised because
>> Camel expects a spring-ws component option after the '?'.
>>
>> Failed to resolve endpoint:
>> spring-ws://
>> http://machine.domain.com:57000/XISOAPAdapter/MessageServlet?channel=value%3FmessageFactory%3D%23messageFactory&messageSender=%23messageSender
>> due to: There are 1 parameters that couldn't be set on the endpoint.
>> Check
>> the uri if the parameters are spelt correctly and that they are
>> properties
>> of the endpoint. Unknown
>> parameters=[{channel=value?messageFactory=#messageFactory}]
>>
>> How can I set options on the http request used the spring-ws component in
>> Camel.
>>
>> Thanks in advance.
>> Arno
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Setting-options-on-http-request-in-spring-ws-component-tp4714995p4714995.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
--
View this message in context: http://camel.465427.n5.nabble.com/Setting-options-on-http-request-in-spring-ws-component-tp4714995p4716645.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Setting options on http-request in spring-ws component
Posted by Taariq Levack <ta...@gmail.com>.
Hi Arno
I don't know if this is recommended or not, I'm sure you'll know soon, but
that component also has a header CamelSpringWebserviceEndpointUri, which you
can use to set the URI afterwards.
Can you try creating the endpoint without the params and then using the
actual URI in the header?
Taariq
On Fri, Aug 19, 2011 at 11:12 AM, akamp <ar...@kadaster.nl> wrote:
> Hi all,
>
> I'm using the Camel spring-ws component to send a soap message to SAP-PI.
> The syntax for the SAP-PI url is:
> http://machine.domain.com:57000/XISOAPAdapter/MessageServlet?channel=value
> So, the SAP-PI url has its own option after the '?'.
>
> If Camel parses this endpoint the following exception is raised because
> Camel expects a spring-ws component option after the '?'.
>
> Failed to resolve endpoint:
> spring-ws://
> http://machine.domain.com:57000/XISOAPAdapter/MessageServlet?channel=value%3FmessageFactory%3D%23messageFactory&messageSender=%23messageSender
> due to: There are 1 parameters that couldn't be set on the endpoint. Check
> the uri if the parameters are spelt correctly and that they are properties
> of the endpoint. Unknown
> parameters=[{channel=value?messageFactory=#messageFactory}]
>
> How can I set options on the http request used the spring-ws component in
> Camel.
>
> Thanks in advance.
> Arno
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Setting-options-on-http-request-in-spring-ws-component-tp4714995p4714995.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
Re: Setting options on http-request in spring-ws component
Posted by akamp <ar...@kadaster.nl>.
I have made a JIRA ticket: CAMEL-4389.
--
View this message in context: http://camel.465427.n5.nabble.com/Setting-options-on-http-request-in-spring-ws-component-tp4714995p4741942.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Setting options on http-request in spring-ws component
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Do you mind creating a JIRA ticket for this? Maybe we can improve the
spring-ws component to accept the parameter in the endpoint uri
directly.
http://camel.apache.org/support
On Fri, Aug 19, 2011 at 11:12 AM, akamp <ar...@kadaster.nl> wrote:
> Hi all,
>
> I'm using the Camel spring-ws component to send a soap message to SAP-PI.
> The syntax for the SAP-PI url is:
> http://machine.domain.com:57000/XISOAPAdapter/MessageServlet?channel=value
> So, the SAP-PI url has its own option after the '?'.
>
> If Camel parses this endpoint the following exception is raised because
> Camel expects a spring-ws component option after the '?'.
>
> Failed to resolve endpoint:
> spring-ws://http://machine.domain.com:57000/XISOAPAdapter/MessageServlet?channel=value%3FmessageFactory%3D%23messageFactory&messageSender=%23messageSender
> due to: There are 1 parameters that couldn't be set on the endpoint. Check
> the uri if the parameters are spelt correctly and that they are properties
> of the endpoint. Unknown
> parameters=[{channel=value?messageFactory=#messageFactory}]
>
> How can I set options on the http request used the spring-ws component in
> Camel.
>
> Thanks in advance.
> Arno
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Setting-options-on-http-request-in-spring-ws-component-tp4714995p4714995.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/