English 中文(简体)
Expose a POJO as a Websevice in Mule via Configuration _Only_?
原标题:

Technologies Involved

  • Mule
  • Apache CXF

Given

A simple POJO (controversial acronym, but let s say a smart POJO):

public class SmartPojo implements SomeBusinessInterface {

    public String doSomethingSmart( With something ) {

        String result;

        result = Irrelevant.process( something )

        return result;
    }
}

Need to Achieve

Expose SmartPojo as a Webservice without touching the code ( without: changing SmartPojo, changing SmartPojoInterface, adding a new interface, any JAX-WS annotations, etc ). The goal is to use Mule configuration only.

I can easily do it with Spring Integration, and would appreciate any input on how to achieve it with Mule. ( It seems that "cxf:inbound-endpoint" needs to be configured with "method-entry-point-resolver" + providing my WSDL in some way.. or another direction? )

Thank you

问题回答

CXF will use reflection to examine the public methods of your component class and expose them as SOAP operations in the wsdl.

This quote comes straight from Mule In Action. (page 58)

If you are trying to expose every public method in your class as a SOAP operation, then this is the approach you should take.

From your explict call above, it looks like you may want to implement a REST-ful or REST-like interface, not a SOAP interface. You would not use cxf to implement that. You would probably need to look at http://www.mulesoft.org/display/MULE/Mule+RESTpack.





相关问题
Obtaining HTTP session from a webservice

We have a web application built on a Tomcat 6/WebWork/Hibernate/SQL Server stack. One part of the web application is a network map built using the Flare toolkit (the predecessor to Flare was Prefuse)...

Using CXF web service from java web start

UPDATE: I have submitted my question to the CXF User s mailing list, here. UPDATE: I have currently signed all of my jars. I still can t seem to get CXF setup in a way that it can find the WSDL. My ...

How to reduce memory size of Apache CXF client stub objects?

My web service client application uses Apache CXF to generate client stubs for talking to several web services. The generated CXF web service stub objects have quite a large memory footprint (10 - 15 ...

@Path regex expression in RESTful server

I m writing a RESTful Java server with CXF framework. How do I can write a @Path Regular Expression in order to obtain any URI finished in "/action" value?

Getting access to a spring bean from a webservice?

I have created a cxf webservice within my cxf.xml file I have the following tag. bean id="videoStatsTable" class="com.company.auth.dataobjects.VideoStatsTable" From what I understand Spring should ...

JaxWSProxyFactoryBean sharing HTTP session

We are working on one project where in we are using JaxWSProxyFactoryBean provided by CXF framework to invoke webservices. I am using SPRING configuration to create clients rather than using API ...

Advantages of using a Dynamic Client with JAX-WS

What are the advantages of using a dynamic client with JAX-WS services as opposed to just using generated client classes? What are the disadvantages? **For my particular case I am using Apache CXF, I ...

热门标签