1

Un cliente me ha enviado un archivo .WSDL para la creación de un servicio web, lo he validado usando el software altanova SPY y parece que és un fichero valido.

No obstante, cuando le envió datos a la función CreateVoucher mi programa no recibe nada (solo el machineHandle).

Este archivo .WSDL ha sido creado juntando diferentes .xsd con el software altanova SPY.

Aunque este validado, puede ser lo que haya juntado mal y no este funcionando correctamente? Yo no entiendo de XML por lo que no puedo decir si és problema del fichero .WSDL o del servicio web que estoy creando (no quiero molestar al cliente).

Si algún entendido de XML puede confirmarme que este archivo funciona correctamente se lo agradecería mucho.

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://xml.hugwi.ch/2018/07/spider/voucher" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://xml.hugwi.ch/2018/07/spider/voucher">
    <wsdl:types>
        <xsd:schema targetNamespace="http://xml.hugwi.ch/2018/07/spider/voucher/Imports">
            <xsd:import namespace="http://xml.hugwi.ch/2018/07/spider/voucher"/>
            <xsd:import namespace="http://schemas.datacontract.org/2004/07/Hugwi.SpiderCloud.Voucher"/>
            <xsd:import namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
        </xsd:schema>
        <xs:schema xmlns:tns="http://schemas.datacontract.org/2004/07/Hugwi.SpiderCloud.Voucher" elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/Hugwi.SpiderCloud.Voucher" xmlns:xs="http://www.w3.org/2001/XMLSchema">
            <xs:complexType name="MachineInfo">
                <xs:sequence>
                    <xs:element name="Id" nillable="true" type="xs:string"/>
                    <xs:element minOccurs="0" name="ProjectId" nillable="true" type="xs:string"/>
                    <xs:element minOccurs="0" name="SerialNumber" nillable="true" type="xs:string"/>
                </xs:sequence>
            </xs:complexType>
            <xs:element name="MachineInfo" nillable="true" type="tns:MachineInfo"/>
            <xs:complexType name="DataFault">
                <xs:complexContent mixed="false">
                    <xs:extension base="tns:Fault">
                        <xs:sequence/>
                    </xs:extension>
                </xs:complexContent>
            </xs:complexType>
            <xs:element name="DataFault" nillable="true" type="tns:DataFault"/>
            <xs:complexType name="Fault">
                <xs:sequence>
                    <xs:element minOccurs="0" name="Code" type="xs:int"/>
                    <xs:element minOccurs="0" name="Message" nillable="true" type="xs:string"/>
                </xs:sequence>
            </xs:complexType>
            <xs:element name="Fault" nillable="true" type="tns:Fault"/>
            <xs:complexType name="ProcessingFault">
                <xs:complexContent mixed="false">
                    <xs:extension base="tns:Fault">
                        <xs:sequence/>
                    </xs:extension>
                </xs:complexContent>
            </xs:complexType>
            <xs:element name="ProcessingFault" nillable="true" type="tns:ProcessingFault"/>
            <xs:complexType name="VoucherData">
                <xs:sequence>
                    <xs:element minOccurs="0" name="Address" nillable="true" type="xs:string"/>
                    <xs:element minOccurs="0" name="ArticleNumber" nillable="true" type="xs:int"/>
                    <xs:element minOccurs="0" name="Currency" nillable="true" type="xs:string"/>
                    <xs:element minOccurs="0" name="Email" nillable="true" type="xs:string"/>
                    <xs:element minOccurs="0" name="MessageId" nillable="true" type="xs:int"/>
                    <xs:element minOccurs="0" name="PhoneNumber" nillable="true" type="xs:string"/>
                    <xs:element minOccurs="0" name="Price" type="xs:decimal"/>
                </xs:sequence>
            </xs:complexType>
            <xs:element name="VoucherData" nillable="true" type="tns:VoucherData"/>
        </xs:schema>
        <xs:schema xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
            <xs:element name="anyType" nillable="true" type="xs:anyType"/>
            <xs:element name="anyURI" nillable="true" type="xs:anyURI"/>
            <xs:element name="base64Binary" nillable="true" type="xs:base64Binary"/>
            <xs:element name="boolean" nillable="true" type="xs:boolean"/>
            <xs:element name="byte" nillable="true" type="xs:byte"/>
            <xs:element name="dateTime" nillable="true" type="xs:dateTime"/>
            <xs:element name="decimal" nillable="true" type="xs:decimal"/>
            <xs:element name="double" nillable="true" type="xs:double"/>
            <xs:element name="float" nillable="true" type="xs:float"/>
            <xs:element name="int" nillable="true" type="xs:int"/>
            <xs:element name="long" nillable="true" type="xs:long"/>
            <xs:element name="QName" nillable="true" type="xs:QName"/>
            <xs:element name="short" nillable="true" type="xs:short"/>
            <xs:element name="string" nillable="true" type="xs:string"/>
            <xs:element name="unsignedByte" nillable="true" type="xs:unsignedByte"/>
            <xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt"/>
            <xs:element name="unsignedLong" nillable="true" type="xs:unsignedLong"/>
            <xs:element name="unsignedShort" nillable="true" type="xs:unsignedShort"/>
            <xs:element name="char" nillable="true" type="tns:char"/>
            <xs:simpleType name="char">
                <xs:restriction base="xs:int"/>
            </xs:simpleType>
            <xs:element name="duration" nillable="true" type="tns:duration"/>
            <xs:simpleType name="duration">
                <xs:restriction base="xs:duration">
                    <xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?"/>
                    <xs:minInclusive value="-P10675199DT2H48M5.4775808S"/>
                    <xs:maxInclusive value="P10675199DT2H48M5.4775807S"/>
                </xs:restriction>
            </xs:simpleType>
            <xs:element name="guid" nillable="true" type="tns:guid"/>
            <xs:simpleType name="guid">
                <xs:restriction base="xs:string">
                    <xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}"/>
                </xs:restriction>
            </xs:simpleType>
            <xs:attribute name="FactoryType" type="xs:QName"/>
            <xs:attribute name="Id" type="xs:ID"/>
            <xs:attribute name="Ref" type="xs:IDREF"/>
        </xs:schema>
        <xs:schema xmlns:tns="http://xml.hugwi.ch/2018/07/spider/voucher" elementFormDefault="qualified" targetNamespace="http://xml.hugwi.ch/2018/07/spider/voucher" xmlns:xs="http://www.w3.org/2001/XMLSchema">
            <xs:import namespace="http://schemas.datacontract.org/2004/07/Hugwi.SpiderCloud.Voucher"/>
            <xs:element name="RegisterMachine">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="vendingMachine" nillable="true" xmlns:q1="http://schemas.datacontract.org/2004/07/Hugwi.SpiderCloud.Voucher" type="q1:MachineInfo"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="RegisterMachineResponse">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="RegisterMachineResult" type="xs:int"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="CreateVoucher">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="machineHandle" type="xs:int"/>
                        <xs:element minOccurs="0" name="voucherData" nillable="true" xmlns:q2="http://schemas.datacontract.org/2004/07/Hugwi.SpiderCloud.Voucher" type="q2:VoucherData"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="CreateVoucherResponse">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="CreateVoucherResult" nillable="true" type="xs:string"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="UploadPicture">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="machineHandle" type="xs:int"/>
                        <xs:element minOccurs="0" name="voucherId" nillable="true" type="xs:string"/>
                        <xs:element minOccurs="0" name="backgound" nillable="true" type="xs:int"/>
                        <xs:element minOccurs="0" name="image" nillable="true" type="xs:base64Binary"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="UploadPictureResponse">
                <xs:complexType>
                    <xs:sequence/>
                </xs:complexType>
            </xs:element>
            <xs:element name="Ping">
                <xs:complexType>
                    <xs:sequence/>
                </xs:complexType>
            </xs:element>
            <xs:element name="PingResponse">
                <xs:complexType>
                    <xs:sequence/>
                </xs:complexType>
            </xs:element>
        </xs:schema>
    </wsdl:types>
    <wsdl:message name="IVoucher_RegisterMachine_InputMessage">
        <wsdl:part name="parameters" element="tns:RegisterMachine"/>
    </wsdl:message>
    <wsdl:message name="IVoucher_RegisterMachine_OutputMessage">
        <wsdl:part name="parameters" element="tns:RegisterMachineResponse"/>
    </wsdl:message>
    <wsdl:message name="IVoucher_RegisterMachine_DataFaultFault_FaultMessage">
        <wsdl:part name="detail" element="q1:DataFault" xmlns:q1="http://schemas.datacontract.org/2004/07/Hugwi.SpiderCloud.Voucher"/>
    </wsdl:message>
    <wsdl:message name="IVoucher_RegisterMachine_ProcessingFaultFault_FaultMessage">
        <wsdl:part name="detail" element="q2:ProcessingFault" xmlns:q2="http://schemas.datacontract.org/2004/07/Hugwi.SpiderCloud.Voucher"/>
    </wsdl:message>
    <wsdl:message name="IVoucher_CreateVoucher_InputMessage">
        <wsdl:part name="parameters" element="tns:CreateVoucher"/>
    </wsdl:message>
    <wsdl:message name="IVoucher_CreateVoucher_OutputMessage">
        <wsdl:part name="parameters" element="tns:CreateVoucherResponse"/>
    </wsdl:message>
    <wsdl:message name="IVoucher_CreateVoucher_DataFaultFault_FaultMessage">
        <wsdl:part name="detail" element="q3:DataFault" xmlns:q3="http://schemas.datacontract.org/2004/07/Hugwi.SpiderCloud.Voucher"/>
    </wsdl:message>
    <wsdl:message name="IVoucher_CreateVoucher_ProcessingFaultFault_FaultMessage">
        <wsdl:part name="detail" element="q4:ProcessingFault" xmlns:q4="http://schemas.datacontract.org/2004/07/Hugwi.SpiderCloud.Voucher"/>
    </wsdl:message>
    <wsdl:message name="IVoucher_UploadPicture_InputMessage">
        <wsdl:part name="parameters" element="tns:UploadPicture"/>
    </wsdl:message>
    <wsdl:message name="IVoucher_UploadPicture_OutputMessage">
        <wsdl:part name="parameters" element="tns:UploadPictureResponse"/>
    </wsdl:message>
    <wsdl:message name="IVoucher_UploadPicture_DataFaultFault_FaultMessage">
        <wsdl:part name="detail" element="q5:DataFault" xmlns:q5="http://schemas.datacontract.org/2004/07/Hugwi.SpiderCloud.Voucher"/>
    </wsdl:message>
    <wsdl:message name="IVoucher_UploadPicture_ProcessingFaultFault_FaultMessage">
        <wsdl:part name="detail" element="q6:ProcessingFault" xmlns:q6="http://schemas.datacontract.org/2004/07/Hugwi.SpiderCloud.Voucher"/>
    </wsdl:message>
    <wsdl:message name="IVoucher_Ping_InputMessage">
        <wsdl:part name="parameters" element="tns:Ping"/>
    </wsdl:message>
    <wsdl:message name="IVoucher_Ping_OutputMessage">
        <wsdl:part name="parameters" element="tns:PingResponse"/>
    </wsdl:message>
    <wsdl:portType name="IVoucher">
        <wsdl:operation name="RegisterMachine">
            <wsdl:input message="tns:IVoucher_RegisterMachine_InputMessage" wsaw:Action="http://xml.hugwi.ch/2018/07/spider/voucher/IVoucher/RegisterMachine"/>
            <wsdl:output message="tns:IVoucher_RegisterMachine_OutputMessage" wsaw:Action="http://xml.hugwi.ch/2018/07/spider/voucher/IVoucher/RegisterMachineResponse"/>
            <wsdl:fault name="DataFaultFault" message="tns:IVoucher_RegisterMachine_DataFaultFault_FaultMessage" wsaw:Action="http://xml.hugwi.ch/2018/07/spider/voucher/IVoucher/RegisterMachineDataFaultFault"/>
            <wsdl:fault name="ProcessingFaultFault" message="tns:IVoucher_RegisterMachine_ProcessingFaultFault_FaultMessage" wsaw:Action="http://xml.hugwi.ch/2018/07/spider/voucher/IVoucher/RegisterMachineProcessingFaultFault"/>
        </wsdl:operation>
        <wsdl:operation name="CreateVoucher">
            <wsdl:input message="tns:IVoucher_CreateVoucher_InputMessage" wsaw:Action="http://xml.hugwi.ch/2018/07/spider/voucher/IVoucher/CreateVoucher"/>
            <wsdl:output message="tns:IVoucher_CreateVoucher_OutputMessage" wsaw:Action="http://xml.hugwi.ch/2018/07/spider/voucher/IVoucher/CreateVoucherResponse"/>
            <wsdl:fault name="DataFaultFault" message="tns:IVoucher_CreateVoucher_DataFaultFault_FaultMessage" wsaw:Action="http://xml.hugwi.ch/2018/07/spider/voucher/IVoucher/CreateVoucherDataFaultFault"/>
            <wsdl:fault name="ProcessingFaultFault" message="tns:IVoucher_CreateVoucher_ProcessingFaultFault_FaultMessage" wsaw:Action="http://xml.hugwi.ch/2018/07/spider/voucher/IVoucher/CreateVoucherProcessingFaultFault"/>
        </wsdl:operation>
        <wsdl:operation name="UploadPicture">
            <wsdl:input message="tns:IVoucher_UploadPicture_InputMessage" wsaw:Action="http://xml.hugwi.ch/2018/07/spider/voucher/IVoucher/UploadPicture"/>
            <wsdl:output message="tns:IVoucher_UploadPicture_OutputMessage" wsaw:Action="http://xml.hugwi.ch/2018/07/spider/voucher/IVoucher/UploadPictureResponse"/>
            <wsdl:fault name="DataFaultFault" message="tns:IVoucher_UploadPicture_DataFaultFault_FaultMessage" wsaw:Action="http://xml.hugwi.ch/2018/07/spider/voucher/IVoucher/UploadPictureDataFaultFault"/>
            <wsdl:fault name="ProcessingFaultFault" message="tns:IVoucher_UploadPicture_ProcessingFaultFault_FaultMessage" wsaw:Action="http://xml.hugwi.ch/2018/07/spider/voucher/IVoucher/UploadPictureProcessingFaultFault"/>
        </wsdl:operation>
        <wsdl:operation name="Ping">
            <wsdl:input message="tns:IVoucher_Ping_InputMessage" wsaw:Action="http://xml.hugwi.ch/2018/07/spider/voucher/IVoucher/Ping"/>
            <wsdl:output message="tns:IVoucher_Ping_OutputMessage" wsaw:Action="http://xml.hugwi.ch/2018/07/spider/voucher/IVoucher/PingResponse"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="DefaultBinding_IVoucher" type="tns:IVoucher">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="RegisterMachine">
            <soap:operation soapAction="http://xml.hugwi.ch/2018/07/spider/voucher/IVoucher/RegisterMachine" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
            <wsdl:fault name="DataFaultFault">
                <soap:fault name="DataFaultFault" use="literal"/>
            </wsdl:fault>
            <wsdl:fault name="ProcessingFaultFault">
                <soap:fault name="ProcessingFaultFault" use="literal"/>
            </wsdl:fault>
        </wsdl:operation>
        <wsdl:operation name="CreateVoucher">
            <soap:operation soapAction="http://xml.hugwi.ch/2018/07/spider/voucher/IVoucher/CreateVoucher" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
            <wsdl:fault name="DataFaultFault">
                <soap:fault name="DataFaultFault" use="literal"/>
            </wsdl:fault>
            <wsdl:fault name="ProcessingFaultFault">
                <soap:fault name="ProcessingFaultFault" use="literal"/>
            </wsdl:fault>
        </wsdl:operation>
        <wsdl:operation name="UploadPicture">
            <soap:operation soapAction="http://xml.hugwi.ch/2018/07/spider/voucher/IVoucher/UploadPicture" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
            <wsdl:fault name="DataFaultFault">
                <soap:fault name="DataFaultFault" use="literal"/>
            </wsdl:fault>
            <wsdl:fault name="ProcessingFaultFault">
                <soap:fault name="ProcessingFaultFault" use="literal"/>
            </wsdl:fault>
        </wsdl:operation>
        <wsdl:operation name="Ping">
            <soap:operation soapAction="http://xml.hugwi.ch/2018/07/spider/voucher/IVoucher/Ping" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
</wsdl:definitions>

Pongo el XML que estoy enviando, falla la parte de voucherData, no recibo ningún elemento de dentro.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:vouc="http://xml.hugwi.ch/2018/07/spider/voucher" xmlns:hug="http://schemas.datacontract.org/2004/07/Hugwi.SpiderCloud.Voucher">
   <soapenv:Header/>
   <soapenv:Body>
      <vouc:CreateVoucher>
         <!--Optional:-->
         <vouc:machineHandle>2</vouc:machineHandle>
         <!--Optional:-->
         <vouc:voucherData>
            <!--Optional:-->
            <hug:Address>as</hug:Address>
            <!--Optional:-->
            <hug:ArticleNumber>12</hug:ArticleNumber>
            <!--Optional:-->
            <hug:Currency>12</hug:Currency>
            <!--Optional:-->
            <hug:Email>12</hug:Email>
            <!--Optional:-->
            <hug:MessageId>12</hug:MessageId>
            <!--Optional:-->
            <hug:PhoneNumber>?12</hug:PhoneNumber>
            <!--Optional:-->
            <hug:Price>12</hug:Price>
         </vouc:voucherData>
      </vouc:CreateVoucher>
   </soapenv:Body>
</soapenv:Envelope>

3
  • 1
    Según un validador xml, está todo bien a nivel de etiquetas. Podrías añadir un ejemplo de lo que estás enviando?
    – rencinas
    Commented el 13 sept. 2018 a las 16:00
  • 1
    pon también el xml que envías al servicio para cotejar
    – shop350
    Commented el 13 sept. 2018 a las 16:21
  • Edito con el XML que estoy enviando.
    – talendguy
    Commented el 14 sept. 2018 a las 8:07

0

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

Examina otras preguntas con la etiqueta o formula tu propia pregunta.