You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Alexey Zavizionov <al...@gmail.com> on 2008/12/10 17:08:32 UTC

Re: How to publish multiport service?

Hello,

I modified our service publishing

    EndpointImpl endpoint = (EndpointImpl)Endpoint.publish(address, object);

and got an exception

[INFO] Compilation failure
 inconvertible types
found   : javax.xml.ws.Endpoint
required: org.apache.cxf.endpoint.EndpointImpl

What it could be?
How can I cast the Endpoint to the specific org.apache.cxf.jaxws.EndpointImpl?

Regards,
Alexey

On Wed, Nov 26, 2008 at 8:01 PM, Daniel Kulp <dk...@apache.org> wrote:
> On Wednesday 26 November 2008 5:04:12 am Alexey Zavizionov wrote:
>> Thanks for reply, Dan
>>
>> How can I provide a multiple message observer for Endpoint.publish?
>> Any wiki documentation?
>
> If you cast the Endpoint to our specific org.apache.cxf.jaxws.EndpointImpl,
> you can call the getServer() call on it to get the Server object and then
> follow the stuff that Sergey provided.
>
> Dan
>
>
>
>>
>> BTW, I have another way to deploy my service
>>
>>     JaxWsServerFactoryBean serverFactory = new JaxWsServerFactoryBean();
>> //serverFactory.setBindingFactory(new HttpBindingInfoFactoryBean());
>>     serverFactory.getServiceFactory().setDataBinding(new
>> JAXBDataBinding()); serverFactory.setServiceClass(object.getClass());
>>     serverFactory.setAddress(address);
>>     serverFactory.setBus(CXFBusFactory.getDefaultBus());
>>     Server server = serverFactory.create();
>>     serverFactory.getServiceFactory()
>>                  .getService()
>>                  .getInInterceptors()
>>                  .add(new LoggingInInterceptor());
>>     serverFactory.getServiceFactory()
>>                  .getService()
>>                  .getOutInterceptors()
>>                  .add(new LoggingOutInterceptor());
>>     Service service = server.getEndpoint().getService();
>>     service.setInvoker(new BeanInvoker(object));
>>     server.start();
>>
>> Have you a code to add that MultipleEndpointObserver in this case?
>>
>> Regards,
>> Alexey
>>
>> --
>> Alexey Zavizionov
>> eXo Platform SAS
>>
>> On Tue, Nov 25, 2008 at 9:55 PM, Daniel Kulp <dk...@apache.org> wrote:
>> > On Tuesday 25 November 2008 10:19:54 am Alexey Zavizionov wrote:
>> >> Are there any thoughts?
>> >>
>> >> How can I publish several ports with one service name?
>> >>
>> >>        String address = "http://my.service:8082/WSRPService";
>> >>        Endpoint.publish(address, implementor);
>> >
>> > There isn't a way to do it.   Each endpoint needs to have a unique URL.
>> > The ONLY exception we have right now is aSOAP 1.1 and a 1.2 endpoint can
>> > share the URL as the endpoint can be determined just from the namespace
>> > of the soap:envelope.
>> >
>> > You MAY be able to get it to work if you change the MessageObserver on
>> > the first registered endpoint to the MultipleEndpointObserver.   Then add
>> > some interceptors to figure out which endpoint to hit (probably saaj
>> > interceptor + something to look a the element names or similar), then
>> > register the second. Not something I've tried though.
>> >
>> > Dan
>> >
>> >> Regards,
>> >> Alexey
>> >>
>> >> --
>> >> Alexey Zavizionov
>> >> eXo Platform SAS
>> >>
>> >> On Mon, Nov 24, 2008 at 3:08 PM, Alexey Zavizionov
>> >>
>> >> <al...@gmail.com> wrote:
>> >> > How can I publish more than one port for a service?
>> >> >
>> >> > With generated sources I cannot do it due to the same address for both
>> >> > of them.
>> >> >
>> >> >  <wsdl:service name="WSRPService">
>> >> >    <wsdl:port binding="v2bind:WSRP_v2_Markup_Binding_SOAP"
>> >> > name="WSRP_v2_Markup_Service">
>> >> >      <soap:address location="http://my.service:8082/WSRPService"/>
>> >> >    </wsdl:port>
>> >> >    <wsdl:port binding="v2bind:WSRP_v2_ServiceDescription_Binding_SOAP"
>> >> > name="WSRP_v2_ServiceDescription_Service">
>> >> >      <soap:address location="http://my.service:8082/WSRPService"/>
>> >> >    </wsdl:port>
>> >> >
>> >> >
>> >> >    protected WSRPV2MarkupPortType_WSRPV2MarkupService_Server() throws
>> >> > Exception {
>> >> >        System.out.println("Starting Server");
>> >> >        Object implementor = new WSRPV2MarkupPortTypeImpl();
>> >> >        String address = "http://my.service:8082/WSRPService";
>> >> >        Endpoint.publish(address, implementor);
>> >> >    }
>> >> >
>> >> >    protected
>> >> > WSRPV2ServiceDescriptionPortType_WSRPV2ServiceDescriptionService_Serve
>> >> >r() throws Exception {
>> >> >        System.out.println("Starting Server");
>> >> >        Object implementor = new
>> >> > WSRPV2ServiceDescriptionPortTypeImpl(); String address =
>> >> > "http://my.service:8082/WSRPService"; Endpoint.publish(address,
>> >> > implementor);
>> >> >    }
>> >> >
>> >> > ============================
>> >> > java.lang.RuntimeException: Soap 1.1 endpoint already registered on
>> >> > address /WSRPService
>> >> >
>> >> > org.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBinding
>> >> >Fac tory.java:747)
>> >> > org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:122)
>> >> > org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:263)
>> >> > org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:201)
>> >> > org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(Provide
>> >> >rIm pl.java:84) javax.xml.ws.Endpoint.publish(Endpoint.java:47)
>> >> > ============================
>> >> >
>> >> >
>> >> > Regards,
>> >> > Alexey.
>> >
>> > --
>> > Daniel Kulp
>> > dkulp@apache.org
>> > http://dankulp.com/blog
>
>
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
>

RE: How to publish multiport service?

Posted by Sergey Beryozkin <sb...@progress.com>.
I think you'll need to set a bus you created as a default one on a bus
factory. I'm not really familiar with MultipleEndpointObservers so
please try to experiment, check the source code and hopefully you'll
find the right pattern...

Cheers, Sergey


-----Original Message-----
From: Alexey Zavizionov [mailto:alexey.zavizionov@gmail.com] 
Sent: 12 December 2008 19:51
To: Sergey Beryozkin
Cc: users@cxf.apache.org; Daniel Kulp
Subject: Re: How to publish multiport service?

Have you any comments on it?

Regards,
Alexey.

On Wed, Dec 10, 2008 at 7:20 PM, Alexey Zavizionov
<al...@gmail.com> wrote:
> Hello,
>
>
> I have returned to my Enpoint.publish, with latest modifications...
>
>    org.apache.cxf.jaxws.EndpointImpl endpoint =
> (org.apache.cxf.jaxws.EndpointImpl)Endpoint.publish(address, object);
>    ServerImpl server = endpoint.getServer();
>
>
>    Bus bus = BusFactory.newInstance().createBus();
>    QName serviceQName =
> server.getEndpoint().getEndpointInfo().getService().getName();
>    QName portQName = server.getEndpoint().getEndpointInfo().getName();
>
>    // replace the observer
>
>    MessageObserver mo = server.getDestination().getMessageObserver();
>    System.out.println(">>> EXOMAN
> MyServerLifeCycleListener.startServer() observer = " + mo);
>    if (mo == null) {
>      mo = new ChainInitiationObserver(server.getEndpoint(), bus);
>    }
>
>    if (mo instanceof ChainInitiationObserver) {
>      ChainInitiationObserver cio = (ChainInitiationObserver) mo;
>
>      MultipleEndpointObserver newMO = new
MultipleEndpointObserver(bus);
>      newMO.getBindingInterceptors().add(new
AttachmentInInterceptor());
>      newMO.getBindingInterceptors().add(new StaxInInterceptor());
>
>      // This will not work if we one of the endpoints disables message
>      // processing. But, if you've disabled message processing, you
>      // probably aren't going to use this feature.
>      newMO.getBindingInterceptors().add(new
ReadHeadersInterceptor(bus));
>      newMO.getBindingInterceptors().add(new CheckFaultInterceptor());
>
>      // Add in a default selection interceptor
>      newMO.getRoutingInterceptors().add(new
EndpointSelectionInterceptor());
>
>      newMO.getEndpoints().add(cio.getEndpoint());
>      mo = newMO;
>
>    }
>
>    server.getDestination().setMessageObserver(mo);
>
>
> Does it correct?
>
> Regards,
> Alexey.
>
>
>
> On Wed, Dec 10, 2008 at 7:00 PM, Sergey Beryozkin
> <se...@progress.com> wrote:
>> Hi
>>
>>> Hello, Sergey
>>>
>>> I have modified to
>>>
>>> public class MyServerLifeCycleListener implements
ServerLifeCycleListener
>>> {
>>>
>>>  public MyServerLifeCycleListener() {
>>>   Bus bus = BusFactory.newInstance().createBus();
>>>   ServerLifeCycleManager slcm =
>>> bus.getExtension(ServerLifeCycleManager.class);
>>>   // 'this' implements ServerLifeCycleListener
>>>   slcm.registerListener(this);
>>>  }
>>>
>> ok
>>
>>>
>>> next for
>>>
>>>  public void startServer(Server server) {
>>>   Bus bus = BusFactory.newInstance().createBus();
>>>   QName serviceQName =
>>> server.getEndpoint().getEndpointInfo().getService().getName();
>>>   QName portQName =
server.getEndpoint().getEndpointInfo().getName();
>>>
>>>   // replace the observer
>>>
>>>   MessageObserver observer =
server.getDestination().getMessageObserver();
>>>   if (observer == null) {
>>>            observer = new
ChainInitiationObserver(server.getEndpoint(),
>>> bus);
>>>    }
>>>
>>>    ServletFilterMessageObserver delegate =
>>>           new ServletFilterMessageObserver(observer, filter,
>>> serviceQName, portQName);
>>>
>>>    server.getDestination().setMessageObserver(delegate);
>>>  }
>>>
>>> I have a question
>>> what is the filter variable for ServletFilterMessageObserver?
>>
>> That was just a sample code. I believe in startServer() you need to
check if
>> it's the service and port QNames you expect and if yes then replace
an
>> observer with a MutipleEndpointObserver on a given endpoint (was it
the
>> first one which Dan suggested ?) - but as I said last time I did not
quite
>> follow what exactly needs to be done for a multiport
>> service with the same address to work
>>
>> Cheers, Sergey
>>
>>
>

Re: How to publish multiport service?

Posted by Alexey Zavizionov <al...@gmail.com>.
Have you any comments on it?

Regards,
Alexey.

On Wed, Dec 10, 2008 at 7:20 PM, Alexey Zavizionov
<al...@gmail.com> wrote:
> Hello,
>
>
> I have returned to my Enpoint.publish, with latest modifications...
>
>    org.apache.cxf.jaxws.EndpointImpl endpoint =
> (org.apache.cxf.jaxws.EndpointImpl)Endpoint.publish(address, object);
>    ServerImpl server = endpoint.getServer();
>
>
>    Bus bus = BusFactory.newInstance().createBus();
>    QName serviceQName =
> server.getEndpoint().getEndpointInfo().getService().getName();
>    QName portQName = server.getEndpoint().getEndpointInfo().getName();
>
>    // replace the observer
>
>    MessageObserver mo = server.getDestination().getMessageObserver();
>    System.out.println(">>> EXOMAN
> MyServerLifeCycleListener.startServer() observer = " + mo);
>    if (mo == null) {
>      mo = new ChainInitiationObserver(server.getEndpoint(), bus);
>    }
>
>    if (mo instanceof ChainInitiationObserver) {
>      ChainInitiationObserver cio = (ChainInitiationObserver) mo;
>
>      MultipleEndpointObserver newMO = new MultipleEndpointObserver(bus);
>      newMO.getBindingInterceptors().add(new AttachmentInInterceptor());
>      newMO.getBindingInterceptors().add(new StaxInInterceptor());
>
>      // This will not work if we one of the endpoints disables message
>      // processing. But, if you've disabled message processing, you
>      // probably aren't going to use this feature.
>      newMO.getBindingInterceptors().add(new ReadHeadersInterceptor(bus));
>      newMO.getBindingInterceptors().add(new CheckFaultInterceptor());
>
>      // Add in a default selection interceptor
>      newMO.getRoutingInterceptors().add(new EndpointSelectionInterceptor());
>
>      newMO.getEndpoints().add(cio.getEndpoint());
>      mo = newMO;
>
>    }
>
>    server.getDestination().setMessageObserver(mo);
>
>
> Does it correct?
>
> Regards,
> Alexey.
>
>
>
> On Wed, Dec 10, 2008 at 7:00 PM, Sergey Beryozkin
> <se...@progress.com> wrote:
>> Hi
>>
>>> Hello, Sergey
>>>
>>> I have modified to
>>>
>>> public class MyServerLifeCycleListener implements ServerLifeCycleListener
>>> {
>>>
>>>  public MyServerLifeCycleListener() {
>>>   Bus bus = BusFactory.newInstance().createBus();
>>>   ServerLifeCycleManager slcm =
>>> bus.getExtension(ServerLifeCycleManager.class);
>>>   // 'this' implements ServerLifeCycleListener
>>>   slcm.registerListener(this);
>>>  }
>>>
>> ok
>>
>>>
>>> next for
>>>
>>>  public void startServer(Server server) {
>>>   Bus bus = BusFactory.newInstance().createBus();
>>>   QName serviceQName =
>>> server.getEndpoint().getEndpointInfo().getService().getName();
>>>   QName portQName = server.getEndpoint().getEndpointInfo().getName();
>>>
>>>   // replace the observer
>>>
>>>   MessageObserver observer = server.getDestination().getMessageObserver();
>>>   if (observer == null) {
>>>            observer = new ChainInitiationObserver(server.getEndpoint(),
>>> bus);
>>>    }
>>>
>>>    ServletFilterMessageObserver delegate =
>>>           new ServletFilterMessageObserver(observer, filter,
>>> serviceQName, portQName);
>>>
>>>    server.getDestination().setMessageObserver(delegate);
>>>  }
>>>
>>> I have a question
>>> what is the filter variable for ServletFilterMessageObserver?
>>
>> That was just a sample code. I believe in startServer() you need to check if
>> it's the service and port QNames you expect and if yes then replace an
>> observer with a MutipleEndpointObserver on a given endpoint (was it the
>> first one which Dan suggested ?) - but as I said last time I did not quite
>> follow what exactly needs to be done for a multiport
>> service with the same address to work
>>
>> Cheers, Sergey
>>
>>
>

Re: How to publish multiport service?

Posted by Alexey Zavizionov <al...@gmail.com>.
Hello,


I have returned to my Enpoint.publish, with latest modifications...

    org.apache.cxf.jaxws.EndpointImpl endpoint =
(org.apache.cxf.jaxws.EndpointImpl)Endpoint.publish(address, object);
    ServerImpl server = endpoint.getServer();


    Bus bus = BusFactory.newInstance().createBus();
    QName serviceQName =
server.getEndpoint().getEndpointInfo().getService().getName();
    QName portQName = server.getEndpoint().getEndpointInfo().getName();

    // replace the observer

    MessageObserver mo = server.getDestination().getMessageObserver();
    System.out.println(">>> EXOMAN
MyServerLifeCycleListener.startServer() observer = " + mo);
    if (mo == null) {
      mo = new ChainInitiationObserver(server.getEndpoint(), bus);
    }

    if (mo instanceof ChainInitiationObserver) {
      ChainInitiationObserver cio = (ChainInitiationObserver) mo;

      MultipleEndpointObserver newMO = new MultipleEndpointObserver(bus);
      newMO.getBindingInterceptors().add(new AttachmentInInterceptor());
      newMO.getBindingInterceptors().add(new StaxInInterceptor());

      // This will not work if we one of the endpoints disables message
      // processing. But, if you've disabled message processing, you
      // probably aren't going to use this feature.
      newMO.getBindingInterceptors().add(new ReadHeadersInterceptor(bus));
      newMO.getBindingInterceptors().add(new CheckFaultInterceptor());

      // Add in a default selection interceptor
      newMO.getRoutingInterceptors().add(new EndpointSelectionInterceptor());

      newMO.getEndpoints().add(cio.getEndpoint());
      mo = newMO;

    }

    server.getDestination().setMessageObserver(mo);


Does it correct?

Regards,
Alexey.



On Wed, Dec 10, 2008 at 7:00 PM, Sergey Beryozkin
<se...@progress.com> wrote:
> Hi
>
>> Hello, Sergey
>>
>> I have modified to
>>
>> public class MyServerLifeCycleListener implements ServerLifeCycleListener
>> {
>>
>>  public MyServerLifeCycleListener() {
>>   Bus bus = BusFactory.newInstance().createBus();
>>   ServerLifeCycleManager slcm =
>> bus.getExtension(ServerLifeCycleManager.class);
>>   // 'this' implements ServerLifeCycleListener
>>   slcm.registerListener(this);
>>  }
>>
> ok
>
>>
>> next for
>>
>>  public void startServer(Server server) {
>>   Bus bus = BusFactory.newInstance().createBus();
>>   QName serviceQName =
>> server.getEndpoint().getEndpointInfo().getService().getName();
>>   QName portQName = server.getEndpoint().getEndpointInfo().getName();
>>
>>   // replace the observer
>>
>>   MessageObserver observer = server.getDestination().getMessageObserver();
>>   if (observer == null) {
>>            observer = new ChainInitiationObserver(server.getEndpoint(),
>> bus);
>>    }
>>
>>    ServletFilterMessageObserver delegate =
>>           new ServletFilterMessageObserver(observer, filter,
>> serviceQName, portQName);
>>
>>    server.getDestination().setMessageObserver(delegate);
>>  }
>>
>> I have a question
>> what is the filter variable for ServletFilterMessageObserver?
>
> That was just a sample code. I believe in startServer() you need to check if
> it's the service and port QNames you expect and if yes then replace an
> observer with a MutipleEndpointObserver on a given endpoint (was it the
> first one which Dan suggested ?) - but as I said last time I did not quite
> follow what exactly needs to be done for a multiport
> service with the same address to work
>
> Cheers, Sergey
>
>

Re: How to publish multiport service?

Posted by Sergey Beryozkin <se...@progress.com>.
Hi

> Hello, Sergey
>
> I have modified to
>
> public class MyServerLifeCycleListener implements ServerLifeCycleListener {
>
>  public MyServerLifeCycleListener() {
>    Bus bus = BusFactory.newInstance().createBus();
>    ServerLifeCycleManager slcm =
> bus.getExtension(ServerLifeCycleManager.class);
>    // 'this' implements ServerLifeCycleListener
>    slcm.registerListener(this);
>  }
>
ok

>
> next for
>
>  public void startServer(Server server) {
>    Bus bus = BusFactory.newInstance().createBus();
>    QName serviceQName =
> server.getEndpoint().getEndpointInfo().getService().getName();
>    QName portQName = server.getEndpoint().getEndpointInfo().getName();
>
>    // replace the observer
>
>    MessageObserver observer = server.getDestination().getMessageObserver();
>    if (observer == null) {
>             observer = new ChainInitiationObserver(server.getEndpoint(), bus);
>     }
>
>     ServletFilterMessageObserver delegate =
>            new ServletFilterMessageObserver(observer, filter,
> serviceQName, portQName);
>
>     server.getDestination().setMessageObserver(delegate);
>  }
>
> I have a question
> what is the filter variable for ServletFilterMessageObserver?

That was just a sample code. I believe in startServer() you need to check if it's the service and port QNames you expect and if yes 
then replace an observer with a MutipleEndpointObserver on a given endpoint (was it the first one which Dan suggested ?) - but as I 
said last time I did not quite follow what exactly needs to be done for a multiport
service with the same address to work

Cheers, Sergey 



Re: How to publish multiport service?

Posted by Alexey Zavizionov <al...@gmail.com>.
Hello, Sergey

I have modified to

public class MyServerLifeCycleListener implements ServerLifeCycleListener {

  public MyServerLifeCycleListener() {
    Bus bus = BusFactory.newInstance().createBus();
    ServerLifeCycleManager slcm =
bus.getExtension(ServerLifeCycleManager.class);
    // 'this' implements ServerLifeCycleListener
    slcm.registerListener(this);
  }


next for

  public void startServer(Server server) {
    Bus bus = BusFactory.newInstance().createBus();
    QName serviceQName =
server.getEndpoint().getEndpointInfo().getService().getName();
    QName portQName = server.getEndpoint().getEndpointInfo().getName();

    // replace the observer

    MessageObserver observer = server.getDestination().getMessageObserver();
    if (observer == null) {
             observer = new ChainInitiationObserver(server.getEndpoint(), bus);
     }

     ServletFilterMessageObserver delegate =
            new ServletFilterMessageObserver(observer, filter,
serviceQName, portQName);

     server.getDestination().setMessageObserver(delegate);
  }

I have a question
what is the filter variable for ServletFilterMessageObserver?

And, how can I use ServerLifeCycleListener for my service deployment?

Regards,
Alexey

On Wed, Dec 10, 2008 at 6:38 PM, Sergey Beryozkin
<se...@progress.com> wrote:
> Hi
>
> this is a code fragment showing an implementation of a
> ServiceLifeCycleListener interface, in the original fragment I posted in the
> other email, it was part of a constructor code I believe. Also, I was using
> a spring configuration there so a reference to a cxf bus is injected into a
> constructor.
>
> From the code you should be able to do
>
> BusFactory.getDefaultBus()
>
> Cheers, Sergey
>
>> Hello, Daniel
>>
>> Thanks.
>>
>> Where I should write code?
>>
>> ServerLifeCycleManager slcm =
>> bus.getExtension(ServerLifeCycleManager.class);
>> // 'this' implements ServerLifeCycleListener
>> sclm.register(this);
>>
>> I have no implementation for ServerLifeCycleListener and no bus variable.
>>
>> On Wed, Dec 10, 2008 at 6:20 PM, Sergey Beryozkin
>> <se...@progress.com> wrote:
>>>>
>>>> [INFO] Compilation failure
>>>> inconvertible types
>>>> found   : javax.xml.ws.Endpoint
>>>> required: org.apache.cxf.endpoint.EndpointImpl
>>>
>>> you just picked up a wrong type, update  the imports to include
>>> org.apache.cxf.jaxws.EndpointImpl
>>>
>>> Cheers, Sergey
>>>
>>>>
>>>> What it could be?
>>>> How can I cast the Endpoint to the specific
>>>> org.apache.cxf.jaxws.EndpointImpl?
>>>>
>>>> Regards,
>>>> Alexey
>>>>
>>>> On Wed, Nov 26, 2008 at 8:01 PM, Daniel Kulp <dk...@apache.org> wrote:
>>>>>
>>>>> On Wednesday 26 November 2008 5:04:12 am Alexey Zavizionov wrote:
>>>>>>
>>>>>> Thanks for reply, Dan
>>>>>>
>>>>>> How can I provide a multiple message observer for Endpoint.publish?
>>>>>> Any wiki documentation?
>>>>>
>>>>> If you cast the Endpoint to our specific
>>>>> org.apache.cxf.jaxws.EndpointImpl,
>>>>> you can call the getServer() call on it to get the Server object and
>>>>> then
>>>>> follow the stuff that Sergey provided.
>>>>>
>>>>> Dan
>>>>>
>>>>>
>>>>>
>>>>>>
>>>>>> BTW, I have another way to deploy my service
>>>>>>
>>>>>>   JaxWsServerFactoryBean serverFactory = new JaxWsServerFactoryBean();
>>>>>> //serverFactory.setBindingFactory(new HttpBindingInfoFactoryBean());
>>>>>>   serverFactory.getServiceFactory().setDataBinding(new
>>>>>> JAXBDataBinding()); serverFactory.setServiceClass(object.getClass());
>>>>>>   serverFactory.setAddress(address);
>>>>>>   serverFactory.setBus(CXFBusFactory.getDefaultBus());
>>>>>>   Server server = serverFactory.create();
>>>>>>   serverFactory.getServiceFactory()
>>>>>>                .getService()
>>>>>>                .getInInterceptors()
>>>>>>                .add(new LoggingInInterceptor());
>>>>>>   serverFactory.getServiceFactory()
>>>>>>                .getService()
>>>>>>                .getOutInterceptors()
>>>>>>                .add(new LoggingOutInterceptor());
>>>>>>   Service service = server.getEndpoint().getService();
>>>>>>   service.setInvoker(new BeanInvoker(object));
>>>>>>   server.start();
>>>>>>
>>>>>> Have you a code to add that MultipleEndpointObserver in this case?
>>>>>>
>>>>>> Regards,
>>>>>> Alexey
>>>>>>
>>>>>> --
>>>>>> Alexey Zavizionov
>>>>>> eXo Platform SAS
>>>>>>
>>>>>> On Tue, Nov 25, 2008 at 9:55 PM, Daniel Kulp <dk...@apache.org> wrote:
>>>>>> > On Tuesday 25 November 2008 10:19:54 am Alexey Zavizionov wrote:
>>>>>> >> Are there any thoughts?
>>>>>> >>
>>>>>> >> How can I publish several ports with one service name?
>>>>>> >>
>>>>>> >>        String address = "http://my.service:8082/WSRPService";
>>>>>> >>        Endpoint.publish(address, implementor);
>>>>>> >
>>>>>> > There isn't a way to do it.   Each endpoint needs to have a unique
>>>>>> > URL.
>>>>>> > The ONLY exception we have right now is aSOAP 1.1 and a 1.2 endpoint
>>>>>> > can
>>>>>> > share the URL as the endpoint can be determined just from the
>>>>>> > namespace
>>>>>> > of the soap:envelope.
>>>>>> >
>>>>>> > You MAY be able to get it to work if you change the MessageObserver
>>>>>> > on
>>>>>> > the first registered endpoint to the MultipleEndpointObserver.
>>>>>> > Then
>>>>>> > add
>>>>>> > some interceptors to figure out which endpoint to hit (probably saaj
>>>>>> > interceptor + something to look a the element names or similar),
>>>>>> > then
>>>>>> > register the second. Not something I've tried though.
>>>>>> >
>>>>>> > Dan
>>>>>> >
>>>>>> >> Regards,
>>>>>> >> Alexey
>>>>>> >>
>>>>>> >> --
>>>>>> >> Alexey Zavizionov
>>>>>> >> eXo Platform SAS
>>>>>> >>
>>>>>> >> On Mon, Nov 24, 2008 at 3:08 PM, Alexey Zavizionov
>>>>>> >>
>>>>>> >> <al...@gmail.com> wrote:
>>>>>> >> > How can I publish more than one port for a service?
>>>>>> >> >
>>>>>> >> > With generated sources I cannot do it due to the same address for
>>>>>> >> > both
>>>>>> >> > of them.
>>>>>> >> >
>>>>>> >> >  <wsdl:service name="WSRPService">
>>>>>> >> >    <wsdl:port binding="v2bind:WSRP_v2_Markup_Binding_SOAP"
>>>>>> >> > name="WSRP_v2_Markup_Service">
>>>>>> >> >      <soap:address
>>>>>> >> > location="http://my.service:8082/WSRPService"/>
>>>>>> >> >    </wsdl:port>
>>>>>> >> >    <wsdl:port
>>>>>> >> > binding="v2bind:WSRP_v2_ServiceDescription_Binding_SOAP"
>>>>>> >> > name="WSRP_v2_ServiceDescription_Service">
>>>>>> >> >      <soap:address
>>>>>> >> > location="http://my.service:8082/WSRPService"/>
>>>>>> >> >    </wsdl:port>
>>>>>> >> >
>>>>>> >> >
>>>>>> >> >    protected WSRPV2MarkupPortType_WSRPV2MarkupService_Server()
>>>>>> >> > throws
>>>>>> >> > Exception {
>>>>>> >> >        System.out.println("Starting Server");
>>>>>> >> >        Object implementor = new WSRPV2MarkupPortTypeImpl();
>>>>>> >> >        String address = "http://my.service:8082/WSRPService";
>>>>>> >> >        Endpoint.publish(address, implementor);
>>>>>> >> >    }
>>>>>> >> >
>>>>>> >> >    protected
>>>>>> >> >
>>>>>> >> >
>>>>>> >> > WSRPV2ServiceDescriptionPortType_WSRPV2ServiceDescriptionService_Serve
>>>>>> >> >r() throws Exception {
>>>>>> >> >        System.out.println("Starting Server");
>>>>>> >> >        Object implementor = new
>>>>>> >> > WSRPV2ServiceDescriptionPortTypeImpl(); String address =
>>>>>> >> > "http://my.service:8082/WSRPService"; Endpoint.publish(address,
>>>>>> >> > implementor);
>>>>>> >> >    }
>>>>>> >> >
>>>>>> >> > ============================
>>>>>> >> > java.lang.RuntimeException: Soap 1.1 endpoint already registered
>>>>>> >> > on
>>>>>> >> > address /WSRPService
>>>>>> >> >
>>>>>> >> >
>>>>>> >> >
>>>>>> >> > org.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBinding
>>>>>> >> >Fac tory.java:747)
>>>>>> >> > org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:122)
>>>>>> >> >
>>>>>> >> > org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:263)
>>>>>> >> > org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:201)
>>>>>> >> >
>>>>>> >> >
>>>>>> >> > org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(Provide
>>>>>> >> >rIm pl.java:84) javax.xml.ws.Endpoint.publish(Endpoint.java:47)
>>>>>> >> > ============================
>>>>>> >> >
>>>>>> >> >
>>>>>> >> > Regards,
>>>>>> >> > Alexey.
>>>>>> >
>>>>>> > --
>>>>>> > Daniel Kulp
>>>>>> > dkulp@apache.org
>>>>>> > http://dankulp.com/blog
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Daniel Kulp
>>>>> dkulp@apache.org
>>>>> http://dankulp.com/blog
>>>>>
>>>>
>>>
>>>
>>
>
>
>

Re: How to publish multiport service?

Posted by Sergey Beryozkin <se...@progress.com>.
Hi

this is a code fragment showing an implementation of a ServiceLifeCycleListener interface, in the original fragment I posted in the 
other email, it was part of a constructor code I believe. Also, I was using a spring configuration there so a reference to a cxf bus 
is injected into a constructor.

>From the code you should be able to do

BusFactory.getDefaultBus()

Cheers, Sergey

> Hello, Daniel
>
> Thanks.
>
> Where I should write code?
>
> ServerLifeCycleManager slcm = bus.getExtension(ServerLifeCycleManager.class);
> // 'this' implements ServerLifeCycleListener
> sclm.register(this);
>
> I have no implementation for ServerLifeCycleListener and no bus variable.
>
> On Wed, Dec 10, 2008 at 6:20 PM, Sergey Beryozkin
> <se...@progress.com> wrote:
>>> [INFO] Compilation failure
>>> inconvertible types
>>> found   : javax.xml.ws.Endpoint
>>> required: org.apache.cxf.endpoint.EndpointImpl
>>
>> you just picked up a wrong type, update  the imports to include
>> org.apache.cxf.jaxws.EndpointImpl
>>
>> Cheers, Sergey
>>
>>>
>>> What it could be?
>>> How can I cast the Endpoint to the specific
>>> org.apache.cxf.jaxws.EndpointImpl?
>>>
>>> Regards,
>>> Alexey
>>>
>>> On Wed, Nov 26, 2008 at 8:01 PM, Daniel Kulp <dk...@apache.org> wrote:
>>>>
>>>> On Wednesday 26 November 2008 5:04:12 am Alexey Zavizionov wrote:
>>>>>
>>>>> Thanks for reply, Dan
>>>>>
>>>>> How can I provide a multiple message observer for Endpoint.publish?
>>>>> Any wiki documentation?
>>>>
>>>> If you cast the Endpoint to our specific
>>>> org.apache.cxf.jaxws.EndpointImpl,
>>>> you can call the getServer() call on it to get the Server object and then
>>>> follow the stuff that Sergey provided.
>>>>
>>>> Dan
>>>>
>>>>
>>>>
>>>>>
>>>>> BTW, I have another way to deploy my service
>>>>>
>>>>>    JaxWsServerFactoryBean serverFactory = new JaxWsServerFactoryBean();
>>>>> //serverFactory.setBindingFactory(new HttpBindingInfoFactoryBean());
>>>>>    serverFactory.getServiceFactory().setDataBinding(new
>>>>> JAXBDataBinding()); serverFactory.setServiceClass(object.getClass());
>>>>>    serverFactory.setAddress(address);
>>>>>    serverFactory.setBus(CXFBusFactory.getDefaultBus());
>>>>>    Server server = serverFactory.create();
>>>>>    serverFactory.getServiceFactory()
>>>>>                 .getService()
>>>>>                 .getInInterceptors()
>>>>>                 .add(new LoggingInInterceptor());
>>>>>    serverFactory.getServiceFactory()
>>>>>                 .getService()
>>>>>                 .getOutInterceptors()
>>>>>                 .add(new LoggingOutInterceptor());
>>>>>    Service service = server.getEndpoint().getService();
>>>>>    service.setInvoker(new BeanInvoker(object));
>>>>>    server.start();
>>>>>
>>>>> Have you a code to add that MultipleEndpointObserver in this case?
>>>>>
>>>>> Regards,
>>>>> Alexey
>>>>>
>>>>> --
>>>>> Alexey Zavizionov
>>>>> eXo Platform SAS
>>>>>
>>>>> On Tue, Nov 25, 2008 at 9:55 PM, Daniel Kulp <dk...@apache.org> wrote:
>>>>> > On Tuesday 25 November 2008 10:19:54 am Alexey Zavizionov wrote:
>>>>> >> Are there any thoughts?
>>>>> >>
>>>>> >> How can I publish several ports with one service name?
>>>>> >>
>>>>> >>        String address = "http://my.service:8082/WSRPService";
>>>>> >>        Endpoint.publish(address, implementor);
>>>>> >
>>>>> > There isn't a way to do it.   Each endpoint needs to have a unique
>>>>> > URL.
>>>>> > The ONLY exception we have right now is aSOAP 1.1 and a 1.2 endpoint
>>>>> > can
>>>>> > share the URL as the endpoint can be determined just from the
>>>>> > namespace
>>>>> > of the soap:envelope.
>>>>> >
>>>>> > You MAY be able to get it to work if you change the MessageObserver on
>>>>> > the first registered endpoint to the MultipleEndpointObserver.   Then
>>>>> > add
>>>>> > some interceptors to figure out which endpoint to hit (probably saaj
>>>>> > interceptor + something to look a the element names or similar), then
>>>>> > register the second. Not something I've tried though.
>>>>> >
>>>>> > Dan
>>>>> >
>>>>> >> Regards,
>>>>> >> Alexey
>>>>> >>
>>>>> >> --
>>>>> >> Alexey Zavizionov
>>>>> >> eXo Platform SAS
>>>>> >>
>>>>> >> On Mon, Nov 24, 2008 at 3:08 PM, Alexey Zavizionov
>>>>> >>
>>>>> >> <al...@gmail.com> wrote:
>>>>> >> > How can I publish more than one port for a service?
>>>>> >> >
>>>>> >> > With generated sources I cannot do it due to the same address for
>>>>> >> > both
>>>>> >> > of them.
>>>>> >> >
>>>>> >> >  <wsdl:service name="WSRPService">
>>>>> >> >    <wsdl:port binding="v2bind:WSRP_v2_Markup_Binding_SOAP"
>>>>> >> > name="WSRP_v2_Markup_Service">
>>>>> >> >      <soap:address location="http://my.service:8082/WSRPService"/>
>>>>> >> >    </wsdl:port>
>>>>> >> >    <wsdl:port
>>>>> >> > binding="v2bind:WSRP_v2_ServiceDescription_Binding_SOAP"
>>>>> >> > name="WSRP_v2_ServiceDescription_Service">
>>>>> >> >      <soap:address location="http://my.service:8082/WSRPService"/>
>>>>> >> >    </wsdl:port>
>>>>> >> >
>>>>> >> >
>>>>> >> >    protected WSRPV2MarkupPortType_WSRPV2MarkupService_Server()
>>>>> >> > throws
>>>>> >> > Exception {
>>>>> >> >        System.out.println("Starting Server");
>>>>> >> >        Object implementor = new WSRPV2MarkupPortTypeImpl();
>>>>> >> >        String address = "http://my.service:8082/WSRPService";
>>>>> >> >        Endpoint.publish(address, implementor);
>>>>> >> >    }
>>>>> >> >
>>>>> >> >    protected
>>>>> >> >
>>>>> >> > WSRPV2ServiceDescriptionPortType_WSRPV2ServiceDescriptionService_Serve
>>>>> >> >r() throws Exception {
>>>>> >> >        System.out.println("Starting Server");
>>>>> >> >        Object implementor = new
>>>>> >> > WSRPV2ServiceDescriptionPortTypeImpl(); String address =
>>>>> >> > "http://my.service:8082/WSRPService"; Endpoint.publish(address,
>>>>> >> > implementor);
>>>>> >> >    }
>>>>> >> >
>>>>> >> > ============================
>>>>> >> > java.lang.RuntimeException: Soap 1.1 endpoint already registered on
>>>>> >> > address /WSRPService
>>>>> >> >
>>>>> >> >
>>>>> >> > org.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBinding
>>>>> >> >Fac tory.java:747)
>>>>> >> > org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:122)
>>>>> >> > org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:263)
>>>>> >> > org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:201)
>>>>> >> >
>>>>> >> > org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(Provide
>>>>> >> >rIm pl.java:84) javax.xml.ws.Endpoint.publish(Endpoint.java:47)
>>>>> >> > ============================
>>>>> >> >
>>>>> >> >
>>>>> >> > Regards,
>>>>> >> > Alexey.
>>>>> >
>>>>> > --
>>>>> > Daniel Kulp
>>>>> > dkulp@apache.org
>>>>> > http://dankulp.com/blog
>>>>
>>>>
>>>>
>>>> --
>>>> Daniel Kulp
>>>> dkulp@apache.org
>>>> http://dankulp.com/blog
>>>>
>>>
>>
>>
> 



Re: How to publish multiport service?

Posted by Alexey Zavizionov <al...@gmail.com>.
Hello, Daniel

Thanks.

Where I should write code?

ServerLifeCycleManager slcm = bus.getExtension(ServerLifeCycleManager.class);
// 'this' implements ServerLifeCycleListener
sclm.register(this);

I have no implementation for ServerLifeCycleListener and no bus variable.

On Wed, Dec 10, 2008 at 6:20 PM, Sergey Beryozkin
<se...@progress.com> wrote:
>> [INFO] Compilation failure
>> inconvertible types
>> found   : javax.xml.ws.Endpoint
>> required: org.apache.cxf.endpoint.EndpointImpl
>
> you just picked up a wrong type, update  the imports to include
> org.apache.cxf.jaxws.EndpointImpl
>
> Cheers, Sergey
>
>>
>> What it could be?
>> How can I cast the Endpoint to the specific
>> org.apache.cxf.jaxws.EndpointImpl?
>>
>> Regards,
>> Alexey
>>
>> On Wed, Nov 26, 2008 at 8:01 PM, Daniel Kulp <dk...@apache.org> wrote:
>>>
>>> On Wednesday 26 November 2008 5:04:12 am Alexey Zavizionov wrote:
>>>>
>>>> Thanks for reply, Dan
>>>>
>>>> How can I provide a multiple message observer for Endpoint.publish?
>>>> Any wiki documentation?
>>>
>>> If you cast the Endpoint to our specific
>>> org.apache.cxf.jaxws.EndpointImpl,
>>> you can call the getServer() call on it to get the Server object and then
>>> follow the stuff that Sergey provided.
>>>
>>> Dan
>>>
>>>
>>>
>>>>
>>>> BTW, I have another way to deploy my service
>>>>
>>>>    JaxWsServerFactoryBean serverFactory = new JaxWsServerFactoryBean();
>>>> //serverFactory.setBindingFactory(new HttpBindingInfoFactoryBean());
>>>>    serverFactory.getServiceFactory().setDataBinding(new
>>>> JAXBDataBinding()); serverFactory.setServiceClass(object.getClass());
>>>>    serverFactory.setAddress(address);
>>>>    serverFactory.setBus(CXFBusFactory.getDefaultBus());
>>>>    Server server = serverFactory.create();
>>>>    serverFactory.getServiceFactory()
>>>>                 .getService()
>>>>                 .getInInterceptors()
>>>>                 .add(new LoggingInInterceptor());
>>>>    serverFactory.getServiceFactory()
>>>>                 .getService()
>>>>                 .getOutInterceptors()
>>>>                 .add(new LoggingOutInterceptor());
>>>>    Service service = server.getEndpoint().getService();
>>>>    service.setInvoker(new BeanInvoker(object));
>>>>    server.start();
>>>>
>>>> Have you a code to add that MultipleEndpointObserver in this case?
>>>>
>>>> Regards,
>>>> Alexey
>>>>
>>>> --
>>>> Alexey Zavizionov
>>>> eXo Platform SAS
>>>>
>>>> On Tue, Nov 25, 2008 at 9:55 PM, Daniel Kulp <dk...@apache.org> wrote:
>>>> > On Tuesday 25 November 2008 10:19:54 am Alexey Zavizionov wrote:
>>>> >> Are there any thoughts?
>>>> >>
>>>> >> How can I publish several ports with one service name?
>>>> >>
>>>> >>        String address = "http://my.service:8082/WSRPService";
>>>> >>        Endpoint.publish(address, implementor);
>>>> >
>>>> > There isn't a way to do it.   Each endpoint needs to have a unique
>>>> > URL.
>>>> > The ONLY exception we have right now is aSOAP 1.1 and a 1.2 endpoint
>>>> > can
>>>> > share the URL as the endpoint can be determined just from the
>>>> > namespace
>>>> > of the soap:envelope.
>>>> >
>>>> > You MAY be able to get it to work if you change the MessageObserver on
>>>> > the first registered endpoint to the MultipleEndpointObserver.   Then
>>>> > add
>>>> > some interceptors to figure out which endpoint to hit (probably saaj
>>>> > interceptor + something to look a the element names or similar), then
>>>> > register the second. Not something I've tried though.
>>>> >
>>>> > Dan
>>>> >
>>>> >> Regards,
>>>> >> Alexey
>>>> >>
>>>> >> --
>>>> >> Alexey Zavizionov
>>>> >> eXo Platform SAS
>>>> >>
>>>> >> On Mon, Nov 24, 2008 at 3:08 PM, Alexey Zavizionov
>>>> >>
>>>> >> <al...@gmail.com> wrote:
>>>> >> > How can I publish more than one port for a service?
>>>> >> >
>>>> >> > With generated sources I cannot do it due to the same address for
>>>> >> > both
>>>> >> > of them.
>>>> >> >
>>>> >> >  <wsdl:service name="WSRPService">
>>>> >> >    <wsdl:port binding="v2bind:WSRP_v2_Markup_Binding_SOAP"
>>>> >> > name="WSRP_v2_Markup_Service">
>>>> >> >      <soap:address location="http://my.service:8082/WSRPService"/>
>>>> >> >    </wsdl:port>
>>>> >> >    <wsdl:port
>>>> >> > binding="v2bind:WSRP_v2_ServiceDescription_Binding_SOAP"
>>>> >> > name="WSRP_v2_ServiceDescription_Service">
>>>> >> >      <soap:address location="http://my.service:8082/WSRPService"/>
>>>> >> >    </wsdl:port>
>>>> >> >
>>>> >> >
>>>> >> >    protected WSRPV2MarkupPortType_WSRPV2MarkupService_Server()
>>>> >> > throws
>>>> >> > Exception {
>>>> >> >        System.out.println("Starting Server");
>>>> >> >        Object implementor = new WSRPV2MarkupPortTypeImpl();
>>>> >> >        String address = "http://my.service:8082/WSRPService";
>>>> >> >        Endpoint.publish(address, implementor);
>>>> >> >    }
>>>> >> >
>>>> >> >    protected
>>>> >> >
>>>> >> > WSRPV2ServiceDescriptionPortType_WSRPV2ServiceDescriptionService_Serve
>>>> >> >r() throws Exception {
>>>> >> >        System.out.println("Starting Server");
>>>> >> >        Object implementor = new
>>>> >> > WSRPV2ServiceDescriptionPortTypeImpl(); String address =
>>>> >> > "http://my.service:8082/WSRPService"; Endpoint.publish(address,
>>>> >> > implementor);
>>>> >> >    }
>>>> >> >
>>>> >> > ============================
>>>> >> > java.lang.RuntimeException: Soap 1.1 endpoint already registered on
>>>> >> > address /WSRPService
>>>> >> >
>>>> >> >
>>>> >> > org.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBinding
>>>> >> >Fac tory.java:747)
>>>> >> > org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:122)
>>>> >> > org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:263)
>>>> >> > org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:201)
>>>> >> >
>>>> >> > org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(Provide
>>>> >> >rIm pl.java:84) javax.xml.ws.Endpoint.publish(Endpoint.java:47)
>>>> >> > ============================
>>>> >> >
>>>> >> >
>>>> >> > Regards,
>>>> >> > Alexey.
>>>> >
>>>> > --
>>>> > Daniel Kulp
>>>> > dkulp@apache.org
>>>> > http://dankulp.com/blog
>>>
>>>
>>>
>>> --
>>> Daniel Kulp
>>> dkulp@apache.org
>>> http://dankulp.com/blog
>>>
>>
>
>

Re: How to publish multiport service?

Posted by Sergey Beryozkin <se...@progress.com>.
> [INFO] Compilation failure
> inconvertible types
> found   : javax.xml.ws.Endpoint
> required: org.apache.cxf.endpoint.EndpointImpl

you just picked up a wrong type, update  the imports to include
org.apache.cxf.jaxws.EndpointImpl

Cheers, Sergey

> 
> What it could be?
> How can I cast the Endpoint to the specific org.apache.cxf.jaxws.EndpointImpl?
> 
> Regards,
> Alexey
> 
> On Wed, Nov 26, 2008 at 8:01 PM, Daniel Kulp <dk...@apache.org> wrote:
>> On Wednesday 26 November 2008 5:04:12 am Alexey Zavizionov wrote:
>>> Thanks for reply, Dan
>>>
>>> How can I provide a multiple message observer for Endpoint.publish?
>>> Any wiki documentation?
>>
>> If you cast the Endpoint to our specific org.apache.cxf.jaxws.EndpointImpl,
>> you can call the getServer() call on it to get the Server object and then
>> follow the stuff that Sergey provided.
>>
>> Dan
>>
>>
>>
>>>
>>> BTW, I have another way to deploy my service
>>>
>>>     JaxWsServerFactoryBean serverFactory = new JaxWsServerFactoryBean();
>>> //serverFactory.setBindingFactory(new HttpBindingInfoFactoryBean());
>>>     serverFactory.getServiceFactory().setDataBinding(new
>>> JAXBDataBinding()); serverFactory.setServiceClass(object.getClass());
>>>     serverFactory.setAddress(address);
>>>     serverFactory.setBus(CXFBusFactory.getDefaultBus());
>>>     Server server = serverFactory.create();
>>>     serverFactory.getServiceFactory()
>>>                  .getService()
>>>                  .getInInterceptors()
>>>                  .add(new LoggingInInterceptor());
>>>     serverFactory.getServiceFactory()
>>>                  .getService()
>>>                  .getOutInterceptors()
>>>                  .add(new LoggingOutInterceptor());
>>>     Service service = server.getEndpoint().getService();
>>>     service.setInvoker(new BeanInvoker(object));
>>>     server.start();
>>>
>>> Have you a code to add that MultipleEndpointObserver in this case?
>>>
>>> Regards,
>>> Alexey
>>>
>>> --
>>> Alexey Zavizionov
>>> eXo Platform SAS
>>>
>>> On Tue, Nov 25, 2008 at 9:55 PM, Daniel Kulp <dk...@apache.org> wrote:
>>> > On Tuesday 25 November 2008 10:19:54 am Alexey Zavizionov wrote:
>>> >> Are there any thoughts?
>>> >>
>>> >> How can I publish several ports with one service name?
>>> >>
>>> >>        String address = "http://my.service:8082/WSRPService";
>>> >>        Endpoint.publish(address, implementor);
>>> >
>>> > There isn't a way to do it.   Each endpoint needs to have a unique URL.
>>> > The ONLY exception we have right now is aSOAP 1.1 and a 1.2 endpoint can
>>> > share the URL as the endpoint can be determined just from the namespace
>>> > of the soap:envelope.
>>> >
>>> > You MAY be able to get it to work if you change the MessageObserver on
>>> > the first registered endpoint to the MultipleEndpointObserver.   Then add
>>> > some interceptors to figure out which endpoint to hit (probably saaj
>>> > interceptor + something to look a the element names or similar), then
>>> > register the second. Not something I've tried though.
>>> >
>>> > Dan
>>> >
>>> >> Regards,
>>> >> Alexey
>>> >>
>>> >> --
>>> >> Alexey Zavizionov
>>> >> eXo Platform SAS
>>> >>
>>> >> On Mon, Nov 24, 2008 at 3:08 PM, Alexey Zavizionov
>>> >>
>>> >> <al...@gmail.com> wrote:
>>> >> > How can I publish more than one port for a service?
>>> >> >
>>> >> > With generated sources I cannot do it due to the same address for both
>>> >> > of them.
>>> >> >
>>> >> >  <wsdl:service name="WSRPService">
>>> >> >    <wsdl:port binding="v2bind:WSRP_v2_Markup_Binding_SOAP"
>>> >> > name="WSRP_v2_Markup_Service">
>>> >> >      <soap:address location="http://my.service:8082/WSRPService"/>
>>> >> >    </wsdl:port>
>>> >> >    <wsdl:port binding="v2bind:WSRP_v2_ServiceDescription_Binding_SOAP"
>>> >> > name="WSRP_v2_ServiceDescription_Service">
>>> >> >      <soap:address location="http://my.service:8082/WSRPService"/>
>>> >> >    </wsdl:port>
>>> >> >
>>> >> >
>>> >> >    protected WSRPV2MarkupPortType_WSRPV2MarkupService_Server() throws
>>> >> > Exception {
>>> >> >        System.out.println("Starting Server");
>>> >> >        Object implementor = new WSRPV2MarkupPortTypeImpl();
>>> >> >        String address = "http://my.service:8082/WSRPService";
>>> >> >        Endpoint.publish(address, implementor);
>>> >> >    }
>>> >> >
>>> >> >    protected
>>> >> > WSRPV2ServiceDescriptionPortType_WSRPV2ServiceDescriptionService_Serve
>>> >> >r() throws Exception {
>>> >> >        System.out.println("Starting Server");
>>> >> >        Object implementor = new
>>> >> > WSRPV2ServiceDescriptionPortTypeImpl(); String address =
>>> >> > "http://my.service:8082/WSRPService"; Endpoint.publish(address,
>>> >> > implementor);
>>> >> >    }
>>> >> >
>>> >> > ============================
>>> >> > java.lang.RuntimeException: Soap 1.1 endpoint already registered on
>>> >> > address /WSRPService
>>> >> >
>>> >> > org.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBinding
>>> >> >Fac tory.java:747)
>>> >> > org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:122)
>>> >> > org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:263)
>>> >> > org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:201)
>>> >> > org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(Provide
>>> >> >rIm pl.java:84) javax.xml.ws.Endpoint.publish(Endpoint.java:47)
>>> >> > ============================
>>> >> >
>>> >> >
>>> >> > Regards,
>>> >> > Alexey.
>>> >
>>> > --
>>> > Daniel Kulp
>>> > dkulp@apache.org
>>> > http://dankulp.com/blog
>>
>>
>>
>> --
>> Daniel Kulp
>> dkulp@apache.org
>> http://dankulp.com/blog
>>
>