You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Rajesh_lakhotia <la...@gmail.com> on 2009/05/27 19:51:23 UTC

CXF BC provider configuration

Hi,
Here is my situation ..
I have same wsdl being implemented by multiple providers.
I need to route to one of the provider based on incoming message header or a
field in soap enevelop.
I could succesfully do that using http and eip combination. ( http
consumer---> eip router---> http provider----> back to client)
Now I was trying to do that using CXF and eip  ( soap client--->cxf consumer
----> eip router---> CXF-provider -----> client)
How do I configure all these providers in CXF-BC.

Since CXF needs service name and endpoint to be same as in wsdl service name
and port.

So I can not not have multple provider setup like this ...
<cxfbc:provider wsdl="classpath:wsdl/ipws-services.wsdl"
                    service="ns1:AvnEsbService" 
		    endpoint="AvnEsbSoapPort" 
                   
locationURI="http://mycompanyName.com/CONTEXTROOT_1/services/AvnEsbService"
                    interfaceName="ns1:AvnEsbSoapPort">
</cxfbc:provider>

<cxfbc:provider
wsdl="classpath:ipws-wsdl/1.0.3/faa/1.0.3/wsdl/ipws-services.wsdl"
                    service="ns1:AvnEsbService" 
		    endpoint="AvnEsbSoapPort" 
                   
locationURI="http://mycompanyName.com/CONTEXTROOT_2/services/AvnEsbService"
                    interfaceName="ns1:AvnEsbSoapPort">
</cxfbc:provider>

This set up errors out with 
<loc-message>More than one endpoint found in the SU for 
key:
{http://www.faa.gov/avnis/ipws/wsdl}AvnEsbService:AvnEsbSoapPort</loc-message>
<stack-trace><![CDATA[javax.jbi.management.DeploymentException: More than
one endpoint found in the SU for key:
{http://mycompany//wsdl}AvnEsbService:AvnEsbSoapPort

Now if I change the endpoint to be different then it says End point not
found in wsdl.

How can I achieve this using CXF ?

Appreciate your help ...

-- 
View this message in context: http://www.nabble.com/CXF-BC-provider-configuration-tp23747507p23747507.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: CXF BC provider configuration

Posted by Gert Vanthienen <ge...@gmail.com>.
L.S.,

If the exact same service (with the same WSDL) is being provided on
multiple HTTP URLs, you can configure a single CXF BC endpoint with
the WSDL and the correct service/endpoint name.  There's no need to
configure the same endpoint over and over again for every HTTP URL
that provides it.

Now, at runtime, you can override the URL specified on the endpoint by
adding a header called "org.apache.servicemix.http.destination.uri"
(JbiConstants.HTTP_DESTINATION_URI) to the incoming NormalizedMessage.
 So instead of having an EIP CBR in the middle, you can now add a
servicemix-bean POJO or (even better) a little Camel route that adds
the message header.

Because there's no need to configure an additional endpoint whenever a
new provider for the service pops up, it becomes a lot easier to
externalize this in e.g. a database or a config file and access that
from your Camel route.


Regards,

Gert Vanthienen
------------------------
Open Source SOA: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/



2009/5/27 Rajesh_lakhotia <la...@gmail.com>:
>
> Hi,
> Here is my situation ..
> I have same wsdl being implemented by multiple providers.
> I need to route to one of the provider based on incoming message header or a
> field in soap enevelop.
> I could succesfully do that using http and eip combination. ( http
> consumer---> eip router---> http provider----> back to client)
> Now I was trying to do that using CXF and eip  ( soap client--->cxf consumer
> ----> eip router---> CXF-provider -----> client)
> How do I configure all these providers in CXF-BC.
>
> Since CXF needs service name and endpoint to be same as in wsdl service name
> and port.
>
> So I can not not have multple provider setup like this ...
> <cxfbc:provider wsdl="classpath:wsdl/ipws-services.wsdl"
>                    service="ns1:AvnEsbService"
>                    endpoint="AvnEsbSoapPort"
>
> locationURI="http://mycompanyName.com/CONTEXTROOT_1/services/AvnEsbService"
>                    interfaceName="ns1:AvnEsbSoapPort">
> </cxfbc:provider>
>
> <cxfbc:provider
> wsdl="classpath:ipws-wsdl/1.0.3/faa/1.0.3/wsdl/ipws-services.wsdl"
>                    service="ns1:AvnEsbService"
>                    endpoint="AvnEsbSoapPort"
>
> locationURI="http://mycompanyName.com/CONTEXTROOT_2/services/AvnEsbService"
>                    interfaceName="ns1:AvnEsbSoapPort">
> </cxfbc:provider>
>
> This set up errors out with
> <loc-message>More than one endpoint found in the SU for
> key:
> {http://www.faa.gov/avnis/ipws/wsdl}AvnEsbService:AvnEsbSoapPort</loc-message>
> <stack-trace><![CDATA[javax.jbi.management.DeploymentException: More than
> one endpoint found in the SU for key:
> {http://mycompany//wsdl}AvnEsbService:AvnEsbSoapPort
>
> Now if I change the endpoint to be different then it says End point not
> found in wsdl.
>
> How can I achieve this using CXF ?
>
> Appreciate your help ...
>
> --
> View this message in context: http://www.nabble.com/CXF-BC-provider-configuration-tp23747507p23747507.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>