• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

CXF -Endpoint - Binding object

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am using CXF webservice. I am trying to access the published endpoint in the Interceptor class.

Endpoint ep= null;
Bus bus = CXFBusFactory.getDefaultBus();
ServerRegistry serverRegistry = bus.getExtension(ServerRegistry.class);
List<Server> servers = serverRegistry.getServers();
Server targetServer = null;
for (Server server : servers) {
targetServer = server;
String address = server.getEndpoint().getEndpointInfo().getAddress();
ep = server.getEndpoint();
logger.debug("Endpoint ******* "+ep);
logger.debug("Endpoint Info******* "+ep.getEndpointInfo());
}


The above code works fine and I am able get the endpoint object.
With the endpoint object when I try to access the method ep.getBinding()
I need to setMTOMEnabled property on the binding object.

SOAPBinding binding = (SOAPBinding)ep.getBinding();
binding.setMTOMEnabled(true);

I am getting class cast exception. Cannot cast org.apache.cxf.binding.soap.SoapBinding cannot be cast to javax.xml.ws.soap.SOAPBinding
It is expecting cxf.binding.soap.SoapBinding object. But there is no setMTOMEnabled in cxf SoapBinding.

Can you please suggest any solution for the above problem.

We have confirgured the below service factory in cxf-servlet.xml
<jaxws:serviceFactory>
<bean class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean"/>
</jaxws:serviceFactory>

Will this create any problem?


Thanks,
Aruna.J



 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic