简体   繁体   English

Spring-WS生成WSDL而不进行操作

[英]Spring-WS generates WSDL without operations

Spring-WS generates WSDL without operations in binding tag... Do you know why? Spring-WS生成WSDL而没有绑定标记中的操作......你知道为什么吗?

There is my spring-ws-service.xml: 有我的spring-ws-service.xml:

    <import resource="classpath*:application-context.xml" />

    <!-- Register PayloadRootAnnotationMethodEndpointMapping -->
    <bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping" />

    <!-- Register Endpoint -->
    <bean id="tasktablerServiceEndpoint" class="tasktabler.mpk.service.TasktablerServiceEndpoint" />

    <!-- Configure XML Marshaller -->
    <bean class="org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter">
        <constructor-arg ref="marshaller" />
    </bean>

    <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
        <property name="classesToBeBound">
            <list>
                <value>tasktabler.mpk.databinding.OptimizeRequest</value>
            </list>
        </property>
    </bean>

    <!-- Add automatic WSDL generation support -->
    <bean id="tasktabler" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition">
        <property name="schema" ref="schema" />
        <property name="portTypeName" value="tasktabler" />
        <property name="locationUri" value="http://localhost:8080/tasktabler" />
        <property name="targetNamespace" value="http://tasktabler" />
    </bean>

    <bean id="schema" class="org.springframework.xml.xsd.SimpleXsdSchema">
        <property name="xsd" value="/WEB-INF/schema.xsd" />
    </bean>

And there is wsdl binding part of WSDL: 并且有WSDL的wsdl绑定部分:

   <wsdl:binding name="tasktablerSoap11" type="tns:tasktabler">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
   </wsdl:binding>

Thanks in advance, Etam. 在此先感谢,Etam。

DefaultWsdl11Definition attempts to auto-generate the WSDL by examining the types in your schema. DefaultWsdl11Definition尝试通过检查模式中的类型来自动生成WSDL。 If your schema doesn't fit its expected patterns, it won't do a good job of it. 如果您的架构不符合其预期的模式,它将无法很好地完成它。

From the documentation : 文档

The DefaultWsdl11Definition which builds a WSDL from a XSD schema. DefaultWsdl11Definition,它从XSD架构构建WSDL。 This definition iterates over all element elements found in the schema, and creates a message for all elements. 此定义迭代在架构中找到的所有元素元素,并为所有元素创建消息。 Next, it creates WSDL operation for all messages that end with the defined request or response suffix. 接下来,它为以定义的请求或响应后缀结尾的所有消息创建WSDL操作。 The default request suffix is Request; 默认请求后缀为Request; the default response suffix is Response, though these can be changed by setting the requestSuffix and responseSuffix properties, respectively. 默认响应后缀是Response,尽管可以通过分别设置requestSuffix和responseSuffix属性来更改这些后缀。 It also builds a portType, binding, and service based on the operations. 它还基于操作构建portType,绑定和服务。

For instance, if our Orders.xsd schema defines the GetOrdersRequest and GetOrdersResponse elements, the XsdBasedSoap11Wsdl4jDefinitionBuilder will create a GetOrdersRequest and GetOrdersResponse message, and a GetOrders operation, which is put in a Orders port type. 例如,如果我们的Orders.xsd模式定义了GetOrdersRequest和GetOrdersResponse元素,则XsdBasedSoap11Wsdl4jDefinitionBuilder将创建GetOrdersRequest和GetOrdersResponse消息,以及GetOrders操作,该操作将置于Orders端口类型中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM