如何把webservice的endpoint配置成一个spring bean

来源:互联网 发布:swift开发windows程序 编辑:程序博客网 时间:2024/06/08 07:02

第一种:

<bean id="ruleExecutionWebServiceEndpoint" class="org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean">

        <property name="serviceInterface" value="XXXEndpoint" />
        <property name="jaxWsService" ref="XXXXXXJaxWsService" />
        <property name="endpointAddress" value="${endpointAddress.RulemgmtWEC}" />
        <property name="customProperties">
            <ref bean="ruleExecutionWebServiceCustomProperties"/>
        </property>

    </bean>

<bean id="XXXXXXJaxWsService" class="org.springframework.remoting.jaxws.LocalJaxWsServiceFactoryBean">
        <property name="wsdlDocumentUrl" value="classpath:META-INF/wsdl/wec/RuleExecutionWebServiceEndpoint.wsdl" />
        <property name="namespaceUri" value="http://endpoint.rulemgmt.ws.wec.group.hsbc.com/" />
        <property name="serviceName" value="RuleExecutionWebServiceEndpoint" />
        <property name="handlerResolver">
            <ref bean="commonJaxWsServiceHandlerResolver"/>
        </property>
    </bean>

第二种:

<bean id="accountWebService" class="org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean">    <property name="serviceInterface" value="example.AccountService"/>    <property name="wsdlDocumentUrl" value="http://localhost:8888/AccountServiceEndpoint?WSDL"/>    <property name="namespaceUri" value="http://example/"/>    <property name="serviceName" value="AccountService"/>    <property name="portName" value="AccountServiceEndpointPort"/></bean>

spring会使用代理类JaxWsPortProxyFactoryBean,然后endpointAddress配置的是webservice的URL

0 0
原创粉丝点击