2013-10-23 206 views
2

下面結合而運行的版本給出了錯誤:提供商

[WSDLC] [錯誤]無效的擴展元素: 「JAXWS:供應商」(在命名空間 「http://java.sun.com/xml/ns/jaxws」)

如果我把在綁定之外,骨架沒有變化。我的目標是基於wsdl生成基於提供者的端點。

<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> 
+0

有人能告訴我怎麼使用的wsimport生成基於提供商終點? – user1018287

回答

0

<jaxws:provider>元件的正確位置是在wsdl名字空間元素<port>上的<jaxws:binding>元件。

例如:

<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

在這裏看到更多的信息: