You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by tjain2011 <tj...@gmail.com> on 2011/03/14 19:42:18 UTC

Re: Camel CXF Producer should allow setting of BindingOperationInfo

Hi 
Can you please elaborate on this. I am in the similar situation. How did you
set the
operation name and namespace for the next endpoint.

And do i need to create CxfProducer (a client) for the second endpoint which
will then call the
external webservice.
Here is what i am doing ...but i am sure its not right as i get this
exception of

java.lang.IllegalArgumentException: BindingOperationInfo must be specified

from("cxf:bean:releasePOEndpoint").handleFault()
		.to("log:incoming?showAll=true").process(new Processor() {
			public void process(Exchange exchange) throws Exception {
				logger.info(" cxf:bean:releasePOEndpoint processing exchange in camel");

				BindingOperationInfo boi = (BindingOperationInfo) 
				exchange.getProperty(BindingOperationInfo.class.toString());
				if (boi != null) {
					logger.info("boi.isUnwrapped" + boi.isUnwrapped());
				}
				if (exchange != null){
					Message in = exchange.getIn();
					
	    
exchange.getIn().setHeader(CxfConstants.OPERATION_NAMESPACE,"http://zappos.com/pehz/wsdl/purchase_order_service.v1_0");
exchange.getIn().setHeader(CxfConstants.OPERATION_NAME,
"releasePurchaseOrder");
					
					exchange.getIn().setBody(in.getBody());
				}
			}
		})
		.to("log:incoming?showAll=true")

	
.to("cxf:bean:PurchaseOrderLifeEndpoint?defaultOperationName=releasePurchaseOrder&dataFormat=POJO&defaultOperationNameSpace=http://zappos.com/pehz/wsdl/purchase_order_service.v1_0").to("log:incoming?showAll=true")
		.to("mock:end");

--
View this message in context: http://camel.465427.n5.nabble.com/Camel-CXF-Producer-should-allow-setting-of-BindingOperationInfo-tp3258474p3580264.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel CXF Producer should allow setting of BindingOperationInfo

Posted by hyjshanghai <hy...@gmail.com>.
I think you should set the Header and DefaultOperationName of
exchange.getOut(), not those of exchange.getIn().

--
View this message in context: http://camel.465427.n5.nabble.com/Camel-CXF-Producer-should-allow-setting-of-BindingOperationInfo-tp3258474p3696949.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel CXF Producer should allow setting of BindingOperationInfo

Posted by Willem Jiang <wi...@gmail.com>.
It looks you are setting the message header rightly.
Can you send me a test case ? So I can debug the issue with it.

BTW, which version of Camel are you using ?

On 3/15/11 2:42 AM, tjain2011 wrote:
> Hi
> Can you please elaborate on this. I am in the similar situation. How did you
> set the
> operation name and namespace for the next endpoint.
>
> And do i need to create CxfProducer (a client) for the second endpoint which
> will then call the
> external webservice.
> Here is what i am doing ...but i am sure its not right as i get this
> exception of
>
> java.lang.IllegalArgumentException: BindingOperationInfo must be specified
>
> from("cxf:bean:releasePOEndpoint").handleFault()
> 		.to("log:incoming?showAll=true").process(new Processor() {
> 			public void process(Exchange exchange) throws Exception {
> 				logger.info(" cxf:bean:releasePOEndpoint processing exchange in camel");
>
> 				BindingOperationInfo boi = (BindingOperationInfo)
> 				exchange.getProperty(BindingOperationInfo.class.toString());
> 				if (boi != null) {
> 					logger.info("boi.isUnwrapped" + boi.isUnwrapped());
> 				}
> 				if (exchange != null){
> 					Message in = exchange.getIn();
> 					
> 	
> exchange.getIn().setHeader(CxfConstants.OPERATION_NAMESPACE,"http://zappos.com/pehz/wsdl/purchase_order_service.v1_0");
> exchange.getIn().setHeader(CxfConstants.OPERATION_NAME,
> "releasePurchaseOrder");
> 					
> 					exchange.getIn().setBody(in.getBody());
> 				}
> 			}
> 		})
> 		.to("log:incoming?showAll=true")
>
> 	
> .to("cxf:bean:PurchaseOrderLifeEndpoint?defaultOperationName=releasePurchaseOrder&dataFormat=POJO&defaultOperationNameSpace=http://zappos.com/pehz/wsdl/purchase_order_service.v1_0").to("log:incoming?showAll=true")
> 		.to("mock:end");
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-CXF-Producer-should-allow-setting-of-BindingOperationInfo-tp3258474p3580264.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang