2012-05-15 13 views
5

Ho problemi a generare un WS da un WSDL tramite wsimport.Genera webservice da WSDL con Documento/formato letterale

Il WSDL è la specifica standard V3.0 TMDD (file XSD correlati WSDL e possono essere trovati here)

Secondo this article from IBM WSDL sembra essere in formato documento/letterale.

al fine di ottenere il WSDL compilato ho creato alcune altre associazioni/tweaks però io sono bloccato in questo errore (che non genera un metodo in quanto l'operazione ha più di una parte):

[WARNING] Ingoring operation "DlFullEventUpdateSubscription": more than one part 
bound to body 
    line 17 of file:/O:/temp/wsdltest/TMDD-stripped.wsdl 

Per semplificare, questa è la versione ridotta del WSDL con solo la definizione operazione interessante

<?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> 

il file di binding:

<?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 riga di comando per richiamare wsimport è il seguente:

O:\temp\wsdltest>wsimport -extension -Xdebug -s src -b bindings.xjb TMDD-stripped.wsdl 

Che cosa posso fare per ottenere l'operazione "DlFullEventUpdateSubscription" creata correttamente? Esistono alternative per generare il servizio Web Java? Non riesco a modificare la definizione dell'operazione, poiché ciò non sarebbe conforme allo standard.

Aggiornamento . Soluzione

sono riuscito a farlo funzionare modificando WSDL così ogni parte del messaggio è assegnato intestazione e corpo:

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

risposta

2

Document-Literal non può avere operazioni messaggio concatenato. Puoi usare sotto le alternative.

  • Usa stile documento/letterale avvolto - Avvolgere più parti in un unico documento .
  • Usa stile RPC/Letter - Nessuna restrizione per il binding di più parti nel corpo del sapone.

Grazie, Sreehari.

+0

Come configurare una di queste alternative in wsdl? Grazie –

+0

Inserisci c2cMessageSubscription e eventRequestMsg in un altro elemento. ' \t ... \t ... ' quindi aggiungere "root" come solo una parte della MSG_EventSubscription. – sreehari

Problemi correlati