开发者

Regarding Spring and Apache CXF Integration

Inside the applicationcontext.xml file we have like this

开发者_开发知识库  <bean id="vincent" class="com.bayer.vincent.service.vincent"/>

  <jaxws:endpoint
      id="vincentSOAP"
      implementor="#vincent"
      implementorClass="com.bayer.vincent.service.vincent"
      address="/vincent/soap"
      bindingUri="http://schemas.xmlsoap.org/wsdl/soap/" />

what does this mean by this defination ??

My question is how the vincent class is being getting called ??


CXF has provided a custom spring namespace to help easily configure a webservice endpoint here.

If the implementor starts with a #, CXF makes the assumption that the endpoint is a Spring Bean, the way it is in your case.

The endpoint will have to be a normal JAX-WS endpoint, i.e annotated with @Webservice annotation, eg:

@WebService(serviceName="MemberService", endpointInterface="org.bk.memberservice.endpoint.MemberEndpoint", targetNamespace="http://bk.org/memberservice/")

Now any call to your uri-/vincent/soap, will be redirected by the CXF front controller(which you can register in the web.xml file):

<servlet>
    <servlet-name>CXFServlet</servlet-name>
    <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>

which maintains an internal registry of payload uri's to handlers(in this case the Spring bean) and dispatches the request appropriately.


As far I understand there created proxy class which forwards all calls to your real class.

See also Configuring an Endpoint where described all jaxws:endpoint attributes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜