You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by LeeCK <le...@yahoo.com> on 2010/01/07 07:06:40 UTC

Custom service and port names for provider

Hi,

Can I use custom names for services and ports in servicemix-cxf-bc provider?
I.e, does the services and ports names defined in the provider wsdl have to
match what's in the endpoint wsdl?

The reason I need to do this is because I need to use the same provider to
talk to two instances of the same endpoint (different url). I am using
ServiceMix 3.3.1

Please help. Thanks

Provider wsdl:
    <wsdl:service name="Service1">
        <wsdl:port name="Service1Port" binding="ns:ServiceBinding">
            <soap12:address location="http://localhost:8080/TheService"/>
        </wsdl:port>
    </wsdl:service>
    <wsdl:service name="Service2">
        <wsdl:port name="Service2Port" binding="ns:ServiceBinding">
            <soap12:address location="http://localhost:9090/TheService"/>
        </wsdl:port>
    </wsdl:service>

Provider xbean:
	<cxfbc:provider wsdl="classpath:provider.wsdl"
	                 service="endpoint:Service1"
	                 endpoint="Service1Port"/>
	<cxfbc:provider wsdl="classpath:provider.wsdl"
	                 service="endpoint:Service2"
	                 endpoint="Service2Port"/>

Actually endpoint wsdl:
    <wsdl:service name="TheService">
        <wsdl:port name="TheServicePort" binding="ns:ServiceBinding">
            <soap12:address location="http://...../TheService"/>
        </wsdl:port>
    </wsdl:service>
-- 
View this message in context: http://old.nabble.com/Custom-service-and-port-names-for-provider-tp27055495p27055495.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Custom service and port names for provider

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

If I understand correctly, you just want to use one cxf bc provider  
endpoint to talk to two external service(those two external service  
actually use same wsdl but use different locationURI).

If so, you can use dynamic http locationURI with cxf bc provider.
Before you send NormalizedMessage to cxf bc provider, do something like
NormalizedMessage nm = ..
nm.setProperty(JbiConstants.HTTP_DESTINATION_URI,  
"what_ever_locationURI_you_need"),

and the cxf bc provider will send the request to the correct external  
service accordingly.

Or if you want to use two cxf bc provider, you can add locationURI  
attribute for each, it will override the one from your provider.wsdl,  
so your provider.wsdl needn't two different service/port which is only  
used for different soap:address (samething as the locationURI)

Freeman
On 2010-1-7, at 下午2:06, LeeCK wrote:

>
> Hi,
>
> Can I use custom names for services and ports in servicemix-cxf-bc  
> provider?
> I.e, does the services and ports names defined in the provider wsdl  
> have to
> match what's in the endpoint wsdl?
>
> The reason I need to do this is because I need to use the same  
> provider to
> talk to two instances of the same endpoint (different url). I am using
> ServiceMix 3.3.1
>
> Please help. Thanks
>
> Provider wsdl:
>    <wsdl:service name="Service1">
>        <wsdl:port name="Service1Port" binding="ns:ServiceBinding">
>            <soap12:address location="http://localhost:8080/ 
> TheService"/>
>        </wsdl:port>
>    </wsdl:service>
>    <wsdl:service name="Service2">
>        <wsdl:port name="Service2Port" binding="ns:ServiceBinding">
>            <soap12:address location="http://localhost:9090/ 
> TheService"/>
>        </wsdl:port>
>    </wsdl:service>
>
> Provider xbean:
> 	<cxfbc:provider wsdl="classpath:provider.wsdl"
> 	                 service="endpoint:Service1"
> 	                 endpoint="Service1Port"/>
> 	<cxfbc:provider wsdl="classpath:provider.wsdl"
> 	                 service="endpoint:Service2"
> 	                 endpoint="Service2Port"/>
>
> Actually endpoint wsdl:
>    <wsdl:service name="TheService">
>        <wsdl:port name="TheServicePort" binding="ns:ServiceBinding">
>            <soap12:address location="http://...../TheService"/>
>        </wsdl:port>
>    </wsdl:service>
> -- 
> View this message in context: http://old.nabble.com/Custom-service-and-port-names-for-provider-tp27055495p27055495.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>


-- 
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com