You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by RAvontuur <r....@landg.nl> on 2013/11/20 09:15:47 UTC
camel-cxf: SOAP-call to url with query parameters
I am asked to send a SOAP-call to:
https://yyy.xxx.net/Webservices/Xxx/XxxWebService.asmx?apk=myapk&oid=myoid&goid=mygoid
I am using a camel-cxf endpoint, POJO-mode, Java DSL based routes.
What is the most appropriate way to supply the required query parameters?
Rene Avontuur
--
View this message in context: http://camel.465427.n5.nabble.com/camel-cxf-SOAP-call-to-url-with-query-parameters-tp5743563.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel-cxf: SOAP-call to url with query parameters
Posted by Willem jiang <wi...@gmail.com>.
You can set the CXF related message context from camel just like this
Map<String, Object> requestContext = new HashMap<String, Object>();
requestContext.put("org.apache.cxf.message.Message.QUERY_STRING", “apk=myapk&oid=myoid&goid=mygoid");
exchange.getIn().setHeader(“RequestContext" , requestContext);
--
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 Wednesday, November 27, 2013 at 5:24 PM, RAvontuur wrote:
> One of the possible solutions I tried, was writing an interceptor.
> This did not result in sending an query-string.
> Should such an approach work?
>
> public class QueryParamInterceptor extends AbstractPhaseInterceptor<Message>
> {
>
> public QueryParamInterceptor(String phase) {
> super(phase);
> }
>
> public QueryParamInterceptor() {
> this(Phase.USER_PROTOCOL);
> }
>
> public void handleMessage(Message message) throws Fault {
> SoapMessage soapMessage = (SoapMessage) message;
> soapMessage.put("org.apache.cxf.message.Message.QUERY_STRING",
> "apk=myapk&oid=myoid&goid=mygoid");
> }
> }
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-cxf-SOAP-call-to-url-with-query-parameters-tp5743563p5743903.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: camel-cxf: SOAP-call to url with query parameters
Posted by RAvontuur <r....@landg.nl>.
One of the possible solutions I tried, was writing an interceptor.
This did not result in sending an query-string.
Should such an approach work?
public class QueryParamInterceptor extends AbstractPhaseInterceptor<Message>
{
public QueryParamInterceptor(String phase) {
super(phase);
}
public QueryParamInterceptor() {
this(Phase.USER_PROTOCOL);
}
public void handleMessage(Message message) throws Fault {
SoapMessage soapMessage = (SoapMessage) message;
soapMessage.put("org.apache.cxf.message.Message.QUERY_STRING",
"apk=myapk&oid=myoid&goid=mygoid");
}
}
--
View this message in context: http://camel.465427.n5.nabble.com/camel-cxf-SOAP-call-to-url-with-query-parameters-tp5743563p5743903.html
Sent from the Camel - Users mailing list archive at Nabble.com.