我有麻烦通过的wsimport的装置生成从WSDL一个WS。
该WSDL是TMDD 3.0标准规范(WSDL和相关XSD文件可以发现这里 )
根据这篇文章来自IBM的WSDL似乎是在文档/文字格式。
为了获得WSDL编译我已经创造了一些绑定/调整不过我停留在这个错误(它不产生方法,因为操作有一个以上的部分):
[WARNING] Ingoring operation "DlFullEventUpdateSubscription": more than one part
bound to body
line 17 of file:/O:/temp/wsdltest/TMDD-stripped.wsdl
为了简化,这是WSDL的,只有有趣的操作定义的精简版
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns:tns="http://www.tmdd.org/3/dialogs"
xmlns:tmdd="http://www.tmdd.org/3/messages" xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:c2c="http://www.ntcip.org/c2c-message-administration" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
name="TMDDCenterServices" targetNamespace="http://www.tmdd.org/3/dialogs">
<documentation>
</documentation>
<types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://www.tmdd.org/3/messages"
schemaLocation="TMDD.xsd" />
<xs:import namespace="http://www.ntcip.org/c2c-message-administration"
schemaLocation="C2C.xsd" />
</xs:schema>
</types>
<message name="MSG_EventSubscription">
<part name="c2cMsgAdmin" element="c2c:c2cMessageSubscription" />
<part name="message" element="tmdd:eventRequestMsg" />
</message>
<!-- Common Messages -->
<message name="MSG_ConfirmationReceipt">
<!-- CONNECTION MANAGEMENT Messages -->
<part name="message" element="c2c:c2cMessageReceipt" />
</message>
<message name="MSG_ErrorReport">
<part name="message" element="tmdd:errorReportMsg" />
</message>
<!-- TMDD Owner Center Porttype -->
<portType name="tmddOCSoapHttpServicePortType">
<operation name="DlFullEventUpdateSubscription">
<documentation>
<objectClass>Event</objectClass>
<msgPattern>Sub</msgPattern>
<requirement>REQ1261</requirement>
</documentation>
<input message="tns:MSG_EventSubscription" />
<output message="tns:MSG_ConfirmationReceipt" />
<fault name="errorReport" message="tns:MSG_ErrorReport" />
</operation>
</portType>
<!-- TMDD Owner Center binding -->
<binding name="tmddOCSoapHttpServiceBinding" type="tns:tmddOCSoapHttpServicePortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="DlFullEventUpdateSubscription">
<soap:operation soapAction="' '" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
<fault name="errorReport">
<soap:fault name="errorReport" use="literal" />
</fault>
</operation>
</binding>
<!-- TMDD Owner Center Service -->
<service name="tmddOCSoapHttpService">
<!-- ************************ -->
<!-- OWNER CENTER Services -->
<!-- ************************ -->
<port name="tmddOCSoapHttpServicePort" binding="tns:tmddOCSoapHttpServiceBinding">
<soap:address location="http://tmdd.owner.center.com/c2cxml/" />
</port>
</service>
</definitions>
该绑定文件:
<?xml version="1.0" encoding="UTF-8"?>
<bindings xmlns="http://java.sun.com/xml/ns/jaxb" version="2.1" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jaxws="http://java.sun.com/xml/ns/jaxws">
<!-- To create standalone classes instead of nested classes -->
<!--<globalBindings localScoping="toplevel"/>-->
<!--*****************-->
<!-- Package Binding -->
<!--*****************-->
<!--*****************************-->
<!-- C2C classes package binding -->
<!--*****************************-->
<bindings schemaLocation="C2C.xsd">
<schemaBindings>
<package name="tdf.tmdd.model.ntcip.messageadministration" />
</schemaBindings>
</bindings>
<!--**************************************-->
<!-- ITIS-Adopted classes package binding -->
<!--**************************************-->
<bindings schemaLocation="ITIS-Adopted-03-00-02.xsd">
<schemaBindings>
<package name="tdf.tmdd.model.itis.adopted" />
</schemaBindings>
</bindings>
<!--************************************-->
<!-- ITIS-Local classes package binding -->
<!--************************************-->
<bindings schemaLocation="ITIS-Local-03-00-02.xsd">
<schemaBindings>
<package name="tdf.tmdd.model.itis.local" />
</schemaBindings>
</bindings>
<!--**************************************-->
<!-- LRMS-Adopted classes package binding -->
<!--************************************* -->
<bindings schemaLocation="LRMS-Adopted-02-00-00.xsd">
<schemaBindings>
<package name="tdf.tmdd.model.lrms.adopted" />
</schemaBindings>
</bindings>
<!--************************************-->
<!-- LRMS-Local classes package binding -->
<!--************************************-->
<bindings schemaLocation="LRMS-Local-02-00-00.xsd">
<schemaBindings>
<package name="tdf.tmdd.model.lrms.local" />
</schemaBindings>
</bindings>
<!--*******************************-->
<!-- NTCIP classes package binding -->
<!--*******************************-->
<bindings schemaLocation="NTCIP-References.xsd">
<schemaBindings>
<package name="tdf.tmdd.model.ntcip.objectreferences" />
</schemaBindings>
</bindings>
<!--******************************-->
<!-- TMDD classes package binding -->
<!--******************************-->
<bindings schemaLocation="TMDD.xsd">
<schemaBindings>
<package name="tdf.tmdd.model" />
</schemaBindings>
</bindings>
<!--***********************-->
<!-- Class personalization -->
<!--***********************-->
<!--************************************-->
<!-- LRMS-Adopted class personalization -->
<!--************************************-->
<bindings schemaLocation="LRMS-Adopted-02-00-00.xsd">
<bindings node="//xs:complexType[@name='Chain']//xs:sequence//xs:element[@name='chain']//xs:complexType">
<class name="ChainElement" />
</bindings>
<bindings node="//xs:complexType[@name='GridPointPair']">
<class name="GridPointPairAdopted" />
</bindings>
<bindings node="//xs:complexType[@name='AreaLocation']">
<class name="AreaLocationAdopted" />
</bindings>
<bindings node="//xs:complexType[@name='LinkLocation']">
<class name="LinkLocationAdopted" />
</bindings>
<bindings node="//xs:complexType[@name='AdminAreaGroup']">
<class name="AdminAreaGroupAdopted" />
</bindings>
<bindings node="//xs:complexType[@name='GridPointSequence']">
<class name="GridPointSequenceAdopted" />
</bindings>
<bindings node="//xs:complexType[@name='Grid']">
<class name="GridAdopted" />
</bindings>
<bindings node="//xs:complexType[@name='NodeAttribute']">
<class name="NodeAttributeAdopted" />
</bindings>
<bindings node="//xs:complexType[@name='GridPoint']">
<class name="GridPointAdopted" />
</bindings>
</bindings>
<!--********************************-->
<!-- factory method personalization -->
<!--********************************-->
<!--*************************************-->
<!-- TMDD factory method personalization -->
<!--*************************************-->
<bindings schemaLocation="TMDD.xsd" >
<bindings node="//xs:complexType[@name='IntersectionSignalInventoryLinkList']">
<factoryMethod name="createIntersectionSignalInventoryLinks" />
</bindings>
</bindings>
</bindings>
命令行调用的wsimport如下:
O:\temp\wsdltest>wsimport -extension -Xdebug -s src -b bindings.xjb TMDD-stripped.wsdl
我能做些什么,以获得“DlFullEventUpdateSubscription”操作正确创建? 是否有任何替代生成Java Web服务? 我不能修改的操作定义,因为这不会符合该标准。
更新。 解
我设法得到它的工作通过修改WSDL,因此消息的每个部分被分配到标题和正文:
<binding name="tmddOCSoapHttpServiceBinding" type="tns:tmddOCSoapHttpServicePortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="DlFullEventUpdateSubscription">
<soap:operation soapAction="' '" style="document" />
<input>
<soap:header message="tns:MSG_EventSubscription" use="literal" part="c2cMsgAdmin"/>
<soap:body use="literal" parts="message"/>
</input>
<output>
<soap:body use="literal" />
</output>
<fault name="errorReport">
<soap:fault name="errorReport" use="literal" />
</fault>
</operation>
</binding>