brijesh wrote:
thanks freeman for the response , I do understand by using cxf-camel , i can route the to different targetService.
But my doubt is , based on wsdl & porttype operation is there a possibility
in cxf-bc xbean to give different targetService? Something like , matching service name in wsdl with cxf-bc service
attribute, is there any way to match portType operation in wsdl & cxf-bc to
match and pass the message to different targetService??

No.
The relationship between service porttype and operation is

service--->porttype -- operation1
                             |---operation2
                             |----operation n
there is noway cxf can route different message based on operation to different targetService, since only one targetService could be defined for cxf bc consumer. CBR should be taken care of by servicemix-eip or servicemix-camel

One way is you can split your wsdl, define two portType and two service, each portType have different operation, and use two cxf bc consumers.

Freeman

Thanks Brijesh N K



Freeman Fang wrote:
brijesh wrote:
hello ,
I need to know how to configure wsdl operations in cxf-bc xbean,

the following is scenario wsdl having portype as follows
           <wsdl:portType name="ContractPortType">
                <wsdl:operation name="createContract">
                        <wsdl:input message="eka:createContractRequest" />
                        <wsdl:output message="eka:createContractResponse" />
<wsdl:fault name="fault"
message="eka:createContract_faultMsg1"></wsdl:fault>
        </wsdl:operation>
                <wsdl:operation name="modifyContract">
                        <wsdl:input 
message="eka:modifyContractRequest"></wsdl:input>
                        <wsdl:output 
message="eka:modifyContractResponse"></wsdl:output>
<wsdl:fault name="fault"
message="eka:modifyContract_faultMsg1"></wsdl:fault>
        </wsdl:operation>

    </wsdl:portType>

the following service for the above port
            <wsdl:service name="ContractService">
             <wsdl:port binding="eka:ContractBinding"
name="ContractServicePort">
                <soap:address location="http://localhost:8092/ContractService"; 
/>
                </wsdl:port>
        </wsdl:service>

cxf-bc configureation as follows

 <cxfbc:consumer wsdl="classpath:contract.wsdl"
        service="eka:ContractService"
        targetService="eka:contractBeanRouter"
useJBIWrapper="false" useSOAPEnvelope="false"
      />

above xbean i can configure only one targetService, but service client
can
make call to createContract and modifyContract operations(see the above
wsdl
operations declaration in port type), both calls are going to same
targetService. wondering is there any way to configure multiple targetService based on
my
wsdl operation?? like createContract should have contractBeanRouter ,
modifyContract should have modifyContractBeanRouter as targetService?.
i can't define one more cxfbc conf with same service with different
target
space, it gives error as duplicate endpoint defined
For your case, you want route to different target Service based on different operation. You can archieve it by using servicemix-eip or servicemix-camel, something like content based routing
The flow looks like

external client ====> cxf bc consumer====> servicemix-eip or servicemix-camel ====> your different target service based on different operation.

Freeman
Any idea on this

thanks Brijesh N K



Reply via email to