2

下面的绑定在运行构建时会出错:

[wsdlc] [错误] 无效的扩展元素:“jaxws:provider”(在命名空间“ http://java.sun.com/xml/ns/jaxws ”中)

如果我放置在绑定之外,则骨架没有变化。我的目标是基于 wsdl 生成基于 Provider 的端点。

<jaxws:bindings
    wsdlLocation="mywsdl.wsdl"
    xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns='http://java.sun.com/xml/ns/jax-ws/ri/runtime'
    xsi:schemaLocation="http://java.sun.com/xml/ns/jaxws http://java.sun.com/xml/ns/jaxws" xmlns:javaee="http://java.sun.com/xml/ns/javaee">
    <jaxws:bindings node="wsdl:definitions/wsdl:portType[@name='MyPortType']">
            <jaxws:provider>true</jaxws:provider>
    </jaxws:bindings>
</jaxws:bindings>
4

1 回答 1

0

元素的正确位置是在命名空间元素上的<jaxws:provider>一个元素中。<jaxws:binding>wsdl<port>

例如:

<portType name="MyWebServicePortType">
  <jaxws:bindings>
    <jaxws:class name="MyWebService"/>
  </jaxws:bindings>
  <operation name="doSomething">
     <!-- operation (and fault) definition -->
  </operation>
</portType>

<binding name="MyWebServiceBinding" type="tns:MyWebServicePortType">
<!-- .. binding definition .. -->
</binding> 

<service name="MyWebService">
  <jaxws:bindings> 
    <jaxws:class name="MyWebServiceClient"/>
  </jaxws:bindings>
  <port name="MyWebServicePort" binding="tns:MyWebServiceBinding">
    <jaxws:bindings> 
      <!-- PROVIDER ELEMENT LOCATION BELOW --> 
      <jaxws:provider>true</jaxws:provider>
    </jaxws:bindings>
    <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
  </port>
</service>

<jaxws:provider>如上所示添加元素会导致生成<portType>类。在上述情况下,不会生成。MyWebService

浏览此处获取更多信息:

于 2015-02-04T15:56:42.167 回答