WebServiceTemplate soap ws使用动态wsdl

时间:2014-08-20 13:57:46

标签: java spring soap dynamic wsdl

我正在尝试使用WebServiceTemplate构建soap ws客户端,但我使用动态wsdl并在配置我的bean时使用:

    <bean id="webServiceTemplate" class="org.springframework.ws.client.core.WebServiceTemplate"
    p:marshaller-ref="jaxbMarshaller" p:unmarshaller-ref="jaxbMarshaller"
    p:defaultUri="http://127.0.0.1:8080/com-example-gateway-store/endpoints"
    p:messageSender-ref="messageSender">
    <constructor-arg ref="messageFactory" />
</bean>

我得到一个空指针异常,因为它无法找到wsdl的端点或404找不到错误。

我们以这种方式暴露了2个动态生成的WSDL(使用Spring功能):

<sws:dynamic-wsdl id="x" portTypeName="X"
    locationUri="/endpoints/" requestSuffix="Request" responseSuffix="Response"
    targetNamespace="http://example.com/gateway/store/x/schema/v1">
    <sws:xsd location="/WEB-INF/classes/schemas/x.xsd" />
</sws:dynamic-wsdl>

<sws:dynamic-wsdl id="y" portTypeName="Y"
    locationUri="/endpoints/" requestSuffix="Request" responseSuffix="Response"
    targetNamespace="http://example.com/gateway/store/y/schema/v1">
    <sws:xsd location="/WEB-INF/classes/schemas/y.xsd" />
</sws:dynamic-wsdl>

有任何帮助吗?

0 个答案:

没有答案