You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Arul Dhesiaseelan <ar...@fluxcorp.com> on 2008/04/04 00:00:30 UTC

Dynamic Client/Server Side Configuration using API for Java First Spring WS

Hello!

I am developing a Java first spring based CXF services. Is there a way 
to dynamically create services and clients at runtime rather using 
service-beans.xml and client-beans.xml?
I am embedding Jetty as my server which will host my CXF services.

Can someone on this group suggest me the approach?

Thanks!
Arul


EndpointRegistry/ServerRegistry usage in CXF

Posted by Arul Dhesiaseelan <ar...@fluxcorp.com>.
Hello,

I see Celtix had EndpointRegistry in its 1.0 version. What is the 
equivalent functionality in CXF? After seeing the CXF sources, I could 
see ServerRegistry is looking similar to the Celtix interface.

Can ServerRegistry be used to register/unregister JAX-WS endpoints 
dynamically? So that, I could run multiple instances of the same service 
in single JVM but with named endpoints as shown below.

http://localhost:8080/CustomerServiceInstance1
http://localhost:8080/CustomerServiceInstance2
http://localhost:8080/CustomerServiceInstance3

Can someone help me understand if this is possible in CXF?

Thank you
Arul


Arul Dhesiaseelan wrote:
> Can some one help me out?
>
> Is there an EndPointRegistry in CXF where I can dynamically 
> register/unregister JAX-WS endpoints running within the same server? 
> Or, is there any other way to achieve this functionality using 
> JaxWsProxyFactoryBean?
>
> I appreciate your directions.
>
> Thanks!
> Arul
>
> Arul Dhesiaseelan wrote:
>> Dan,
>>
>> I was able to create the service dynamically. I have another related 
>> question.
>>
>> Is it possible to create one instance of JaxWsProxyFactoryBean server 
>> and then add multiple endpoints to this instance dynamically? In 
>> essence, I would like to run multiple instances of the same web 
>> service in the same JVM, but with named service end points.
>>
>> Thanks for your continued support.
>>
>> Cheers!
>> Arul
>>



Re: Dynamic Client/Server Side Configuration using API for Java First Spring WS

Posted by Arul Dhesiaseelan <ar...@fluxcorp.com>.
Can some one help me out?

Is there an EndPointRegistry in CXF where I can dynamically 
register/unregister JAX-WS endpoints running within the same server? Or, 
is there any other way to achieve this functionality using 
JaxWsProxyFactoryBean?

I appreciate your directions.

Thanks!
Arul

Arul Dhesiaseelan wrote:
> Dan,
>
> I was able to create the service dynamically. I have another related 
> question.
>
> Is it possible to create one instance of JaxWsProxyFactoryBean server 
> and then add multiple endpoints to this instance dynamically? In 
> essence, I would like to run multiple instances of the same web 
> service in the same JVM, but with named service end points.
>
> Thanks for your continued support.
>
> Cheers!
> Arul
>
> Daniel Kulp wrote:
>> The jaxws:endpoint element is just configuring the actual CXF 
>> implementation of the jaxws Endpoint interface:
>> org.apache.cxf.jaxws.EndpointImpl
>>
>> Dan
>>
>>
>>
>> On Thursday 03 April 2008, Arul Dhesiaseelan wrote:
>>  
>>> Thanks Dan. Client worked just fine with your suggestion.
>>>
>>> Here is my service bean configuration. How do I dynamically create an
>>> endpoint shown in service-beans.xml? I am embedding jetty to deploy
>>> this endpoint.
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>>
>>> <beans xmlns="http://www.springframework.org/schema/beans"
>>>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>     xmlns:context="http://www.springframework.org/schema/context"
>>>     xmlns:cxf="http://cxf.apache.org/core"
>>>     xmlns:jaxws="http://cxf.apache.org/jaxws"
>>>     xsi:schemaLocation="http://www.springframework.org/schema/beans
>>>        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>>> http://www.springframework.org/schema/context
>>>        
>>> http://www.springframework.org/schema/context/spring-context-2.5.xsd
>>> http://cxf.apache.org/core
>>>         http://cxf.apache.org/schemas/core.xsd
>>>         http://cxf.apache.org/jaxws
>>>         http://cxf.apache.org/schemas/jaxws.xsd">
>>>
>>>   <!-- Load CXF modules from cxf.jar -->
>>>   <import resource="classpath:META-INF/cxf/cxf.xml" />
>>>     <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"
>>> /> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
>>>
>>>   <jaxws:endpoint
>>>       id="engine"
>>>       implementor="demo.services.CustomerServiceImpl"
>>>       address="/CustomerService" />
>>>
>>> </beans>
>>>
>>> **Thanks!
>>>
>>> Arul
>>>
>>> Daniel Kulp wrote:
>>>    
>>>> On Thursday 03 April 2008, Arul Dhesiaseelan wrote:
>>>>      
>>>>> Hello!
>>>>>
>>>>> I am developing a Java first spring based CXF services. Is there a
>>>>> way to dynamically create services and clients at runtime rather
>>>>> using service-beans.xml and client-beans.xml?
>>>>> I am embedding Jetty as my server which will host my CXF services.
>>>>>
>>>>> Can someone on this group suggest me the approach?
>>>>>
>>>>> Thanks!
>>>>> Arul
>>>>>         
>>>> Basically, the spring things are just configuring instances of
>>>> various factory beans.   Thus, you can easily just configure the
>>>> same factory beans via API's calls.   For example, jaxws:server is
>>>> just configuring a JaxWsServerFactoryBean.   jaxws:client is
>>>> configuring a
>>>> JaxWsProxyFactoryBean instance.
>
>
> ______________________________________________________________________
> Scanned by MessageLabs
> ______________________________________________________________________


Re: Dynamic Client/Server Side Configuration using API for Java First Spring WS

Posted by Arul Dhesiaseelan <ar...@fluxcorp.com>.
Dan,

I was able to create the service dynamically. I have another related 
question.

Is it possible to create one instance of JaxWsProxyFactoryBean server 
and then add multiple endpoints to this instance dynamically? In 
essence, I would like to run multiple instances of the same web service 
in the same JVM, but with named service end points.

Thanks for your continued support.

Cheers!
Arul

Daniel Kulp wrote:
> The jaxws:endpoint element is just configuring the actual CXF 
> implementation of the jaxws Endpoint interface:
> org.apache.cxf.jaxws.EndpointImpl
>
> Dan
>
>
>
> On Thursday 03 April 2008, Arul Dhesiaseelan wrote:
>   
>> Thanks Dan. Client worked just fine with your suggestion.
>>
>> Here is my service bean configuration. How do I dynamically create an
>> endpoint shown in service-beans.xml? I am embedding jetty to deploy
>> this endpoint.
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>>
>> <beans xmlns="http://www.springframework.org/schema/beans"
>>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>     xmlns:context="http://www.springframework.org/schema/context"
>>     xmlns:cxf="http://cxf.apache.org/core"
>>     xmlns:jaxws="http://cxf.apache.org/jaxws"
>>     xsi:schemaLocation="http://www.springframework.org/schema/beans
>>        
>> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>> http://www.springframework.org/schema/context
>>        
>> http://www.springframework.org/schema/context/spring-context-2.5.xsd
>> http://cxf.apache.org/core
>>         http://cxf.apache.org/schemas/core.xsd
>>         http://cxf.apache.org/jaxws
>>         http://cxf.apache.org/schemas/jaxws.xsd">
>>
>>   <!-- Load CXF modules from cxf.jar -->
>>   <import resource="classpath:META-INF/cxf/cxf.xml" />
>>     <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"
>> /> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
>>
>>   <jaxws:endpoint
>>       id="engine"
>>       implementor="demo.services.CustomerServiceImpl"
>>       address="/CustomerService" />
>>
>> </beans>
>>
>> **Thanks!
>>
>> Arul
>>
>> Daniel Kulp wrote:
>>     
>>> On Thursday 03 April 2008, Arul Dhesiaseelan wrote:
>>>       
>>>> Hello!
>>>>
>>>> I am developing a Java first spring based CXF services. Is there a
>>>> way to dynamically create services and clients at runtime rather
>>>> using service-beans.xml and client-beans.xml?
>>>> I am embedding Jetty as my server which will host my CXF services.
>>>>
>>>> Can someone on this group suggest me the approach?
>>>>
>>>> Thanks!
>>>> Arul
>>>>         
>>> Basically, the spring things are just configuring instances of
>>> various factory beans.   Thus, you can easily just configure the
>>> same factory beans via API's calls.   For example, jaxws:server is
>>> just configuring a JaxWsServerFactoryBean.   jaxws:client is
>>> configuring a
>>> JaxWsProxyFactoryBean instance.


Re: Dynamic Client/Server Side Configuration using API for Java First Spring WS

Posted by Daniel Kulp <dk...@apache.org>.
The jaxws:endpoint element is just configuring the actual CXF 
implementation of the jaxws Endpoint interface:
org.apache.cxf.jaxws.EndpointImpl

Dan



On Thursday 03 April 2008, Arul Dhesiaseelan wrote:
> Thanks Dan. Client worked just fine with your suggestion.
>
> Here is my service bean configuration. How do I dynamically create an
> endpoint shown in service-beans.xml? I am embedding jetty to deploy
> this endpoint.
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <beans xmlns="http://www.springframework.org/schema/beans"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xmlns:context="http://www.springframework.org/schema/context"
>     xmlns:cxf="http://cxf.apache.org/core"
>     xmlns:jaxws="http://cxf.apache.org/jaxws"
>     xsi:schemaLocation="http://www.springframework.org/schema/beans
>        
> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
> http://www.springframework.org/schema/context
>        
> http://www.springframework.org/schema/context/spring-context-2.5.xsd
> http://cxf.apache.org/core
>         http://cxf.apache.org/schemas/core.xsd
>         http://cxf.apache.org/jaxws
>         http://cxf.apache.org/schemas/jaxws.xsd">
>
>   <!-- Load CXF modules from cxf.jar -->
>   <import resource="classpath:META-INF/cxf/cxf.xml" />
>     <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"
> /> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
>
>   <jaxws:endpoint
>       id="engine"
>       implementor="demo.services.CustomerServiceImpl"
>       address="/CustomerService" />
>
> </beans>
>
> **Thanks!
>
> Arul
>
> Daniel Kulp wrote:
> > On Thursday 03 April 2008, Arul Dhesiaseelan wrote:
> >> Hello!
> >>
> >> I am developing a Java first spring based CXF services. Is there a
> >> way to dynamically create services and clients at runtime rather
> >> using service-beans.xml and client-beans.xml?
> >> I am embedding Jetty as my server which will host my CXF services.
> >>
> >> Can someone on this group suggest me the approach?
> >>
> >> Thanks!
> >> Arul
> >
> > Basically, the spring things are just configuring instances of
> > various factory beans.   Thus, you can easily just configure the
> > same factory beans via API's calls.   For example, jaxws:server is
> > just configuring a JaxWsServerFactoryBean.   jaxws:client is
> > configuring a
> > JaxWsProxyFactoryBean instance.



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Re: Dynamic Client/Server Side Configuration using API for Java First Spring WS

Posted by Arul Dhesiaseelan <ar...@fluxcorp.com>.
Thanks Dan. Client worked just fine with your suggestion.

Here is my service bean configuration. How do I dynamically create an 
endpoint shown in service-beans.xml? I am embedding jetty to deploy this 
endpoint.

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:cxf="http://cxf.apache.org/core"
    xmlns:jaxws="http://cxf.apache.org/jaxws"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-2.5.xsd
        http://cxf.apache.org/core
        http://cxf.apache.org/schemas/core.xsd
        http://cxf.apache.org/jaxws
        http://cxf.apache.org/schemas/jaxws.xsd">

  <!-- Load CXF modules from cxf.jar -->
  <import resource="classpath:META-INF/cxf/cxf.xml" />
    <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />

  <jaxws:endpoint
      id="engine"
      implementor="demo.services.CustomerServiceImpl"
      address="/CustomerService" />

</beans>

**Thanks!

Arul

Daniel Kulp wrote:
> On Thursday 03 April 2008, Arul Dhesiaseelan wrote:
>   
>> Hello!
>>
>> I am developing a Java first spring based CXF services. Is there a way
>> to dynamically create services and clients at runtime rather using
>> service-beans.xml and client-beans.xml?
>> I am embedding Jetty as my server which will host my CXF services.
>>
>> Can someone on this group suggest me the approach?
>>
>> Thanks!
>> Arul
>>     
>
> Basically, the spring things are just configuring instances of various 
> factory beans.   Thus, you can easily just configure the same factory 
> beans via API's calls.   For example, jaxws:server is just configuring a 
> JaxWsServerFactoryBean.   jaxws:client is configuring a 
> JaxWsProxyFactoryBean instance.   
>
>
>   




Re: Dynamic Client/Server Side Configuration using API for Java First Spring WS

Posted by Daniel Kulp <dk...@apache.org>.
On Thursday 03 April 2008, Arul Dhesiaseelan wrote:
> Hello!
>
> I am developing a Java first spring based CXF services. Is there a way
> to dynamically create services and clients at runtime rather using
> service-beans.xml and client-beans.xml?
> I am embedding Jetty as my server which will host my CXF services.
>
> Can someone on this group suggest me the approach?
>
> Thanks!
> Arul

Basically, the spring things are just configuring instances of various 
factory beans.   Thus, you can easily just configure the same factory 
beans via API's calls.   For example, jaxws:server is just configuring a 
JaxWsServerFactoryBean.   jaxws:client is configuring a 
JaxWsProxyFactoryBean instance.   


-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog