Tengo problemas para generar WS de un WSDL mediante wsimport.Generar webservice desde WSDL con formato de documento/literal
El WSDL es la especificación estándar v3.0 TMDD (WSDL y XSD archivos relacionados se pueden encontrar here)
Según this article from IBM el WSDL parece estar en formato de documento/literal.
el fin de obtener el WSDL compilado he creado algunas fijaciones/retoques Sin embargo, estoy atascado en este error (no se genera un método ya que la operación tiene más de una parte):
[WARNING] Ingoring operation "DlFullEventUpdateSubscription": more than one part
bound to body
line 17 of file:/O:/temp/wsdltest/TMDD-stripped.wsdl
Para simplificar, esta es la versión simplificada del WSDL con solamente la definición de operación interesante
<?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>
el archivo de enlaces:
<?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>
La línea de comandos para invocar wsimport es la siguiente:
O:\temp\wsdltest>wsimport -extension -Xdebug -s src -b bindings.xjb TMDD-stripped.wsdl
¿Qué puedo hacer para que la operación "DlFullEventUpdateSubscription" creado correctamente? ¿Hay alguna alternativa para generar el servicio web Java? No puedo modificar la definición de la operación, ya que eso no cumpliría con el estándar.
Actualización. Solución
he conseguido que funcione mediante la modificación de WSDL forma que se asigne cada parte del mensaje de cabecera y el cuerpo:
<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>
¿Cómo configuraría cualquiera de esas alternativas en wsdl? Gracias –
Ponga c2cMessageSubscription y eventRequestMsg en otro elemento. ' \t ... c2cMessageSubscription> \t ... eventRequestMsg> ' luego añadir "root" como sólo una parte de MSG_EventSubscription. –
sreehari