2

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

4

1 回答 1

1

CXF 将使用反射来检查组件类的公共方法,并将它们作为 wsdl 中的 SOAP 操作公开。

这句话直接来自Mule In Action。(第 58 页)

如果您尝试将类中的每个公共方法公开为 SOAP 操作,那么您应该采用这种方法。

从上面的显式调用来看,您可能想要实现一个 REST-ful 或类似 REST 的接口,而不是 SOAP 接口。您不会使用 cxf 来实现它。您可能需要查看http://www.mulesoft.org/display/MULE/Mule+RESTpack

于 2010-02-22T17:55:04.747 回答