You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by mi...@icw.de on 2012/06/20 09:03:32 UTC

CXF magic - please help

Hello everyone, 

I have the following jaxws:client and local jaxws:server configuration:

     <jaxws:client id="client"
                  serviceClass="MyClass"
                  serviceName="s:Service"
                  xmlns:s="http://tempuri.org/"
                  wsdlLocation="MyService.wsdl">
          <jaxws:outInterceptors>
            <ref bean="webServiceAddressAndTransportChangeInterceptor"/>
          </jaxws:outInterceptors>
      </jaxws:client>


 <jaxws:server id="localImplementor" 
                 address="local://myService"
                 serviceName="s:Service"
                 xmlns:s="http://tempuri.org/"
                 wsdlLocation="MyService.wsdl">
      <jaxws:serviceBean>
          <bean class="com.icw.pxs.sandlot.qrmservice.mock.QRMServiceMock"
/>
       </jaxws:serviceBean>
    </jaxws:server>

Nothing unusual - decoupled client and a local server:
* the jaxws:client has no endpoint address set
* the client has one out interceptor 
webServiceAddressAndTransportChangeInterceptor
* the jaxws:server address="local://myService"

It seems that there exists an invisible "connection" between the client 
and the server - In the client out interceptor (SETUP phase) , the client 
endpoint address is local://myService. I would assume that the default 
address is taken from thw WSDL. Can someone please explain what is the 
nature of this, in my opinion strange, observation. 

My ultimate goal is to be able to change the endpoint address of the 
client dynamically from a CXF interceptor. To use local://myService оr 
http://myservice.org

Thanks in advance. Any Ideas?


Best Regards,
Mitko

   
InterComponentWare AG:  
Vorstand: Peter Kirschbauer (Vors.), J?rg Stadler  
Aufsichtsratsvors.: Prof. Dr. Christof Hettich  
Firmensitz: 69190 Walldorf, Altrottstra?e 31  
AG Mannheim HRB 351761 / USt.-IdNr.: DE 198388516  

Re: CXF magic - please help

Posted by Daniel Kulp <dk...@apache.org>.
Since both are in the same config, they likely share the same Bus object.   
If they share the same Bus object, they would be using the same WSDLManager 
and thus the same copy of MyService.wsdl.    When a service starts up, is 
sets the address it is started on into the wsdl.   In your case 
local://myService.   Since the client is created from the same wsdl, that is 
what it sees.    :-)

Hope that helps explain the magic.  :-)

Dan


On Wednesday, June 20, 2012 09:03:32 AM mitko.kolev@icw.de wrote:
> Hello everyone, 
> 
> I have the following jaxws:client and local jaxws:server configuration:
> 
>      <jaxws:client id="client"
>                   serviceClass="MyClass"
>                   serviceName="s:Service"
>                   xmlns:s="http://tempuri.org/"
>                   wsdlLocation="MyService.wsdl">
>           <jaxws:outInterceptors>
>             <ref bean="webServiceAddressAndTransportChangeInterceptor"/>
>           </jaxws:outInterceptors>
>       </jaxws:client>
> 
> 
>  <jaxws:server id="localImplementor" 
>                  address="local://myService"
>                  serviceName="s:Service"
>                  xmlns:s="http://tempuri.org/"
>                  wsdlLocation="MyService.wsdl">
>       <jaxws:serviceBean>
>           <bean
> class="com.icw.pxs.sandlot.qrmservice.mock.QRMServiceMock"
 />
>        </jaxws:serviceBean>
>     </jaxws:server>
> 
> Nothing unusual - decoupled client and a local server:
> * the jaxws:client has no endpoint address set
> * the client has one out interceptor 
> webServiceAddressAndTransportChangeInterceptor
> * the jaxws:server address="local://myService"
> 
> It seems that there exists an invisible "connection" between the client 
> and the server - In the client out interceptor (SETUP phase) , the client
> 
 endpoint address is local://myService. I would assume that the default
> address is taken from thw WSDL. Can someone please explain what is the
> nature of this, in my opinion strange, observation.
> 
> My ultimate goal is to be able to change the endpoint address of the 
> client dynamically from a CXF interceptor. To use local://myService оr 
> http://myservice.org
> 
> Thanks in advance. Any Ideas?
> 
> 
> Best Regards,
> Mitko
> 
>    
> InterComponentWare AG:  
> Vorstand: Peter Kirschbauer (Vors.), J?rg Stadler  
> Aufsichtsratsvors.: Prof. Dr. Christof Hettich  
> Firmensitz: 69190 Walldorf, Altrottstra?e 31  
> AG Mannheim HRB 351761 / USt.-IdNr.: DE 198388516
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com