Web services d2010 soap错误元素不包含单个文本节点

Web services d2010 soap错误元素不包含单个文本节点,web-services,delphi,soap,Web Services,Delphi,Soap,我搜索以连接到Web服务,但当我调用该方法时,我获得了这个错误元素OutputObj不包含单个文本节点' 这是我在导入WSDL文件时创建的单元: // ************************************************************************ // // The types declared in this file were generated from data read from the

我搜索以连接到Web服务,但当我调用该方法时,我获得了这个错误元素OutputObj不包含单个文本节点'

这是我在导入WSDL文件时创建的单元:

             // ************************************************************************ //
            // The types declared in this file were generated from data read from the
            // WSDL File described below:
            // WSDL     : D:\SVN\XML IE815\WSDL\DispatcherBean.wsdl
            //  >Import : D:\SVN\XML IE815\WSDL\DispatcherBean.wsdl>0
            //  >Import : D:\SVN\XML IE815\WSDL\DispatcherBean.wsdl>1
            // Encoding : UTF-8
            // Version  : 1.0
            // (16/07/2014 9.33.06 - - $Rev: 25127 $)
            // ************************************************************************ //

            unit UNDispatcherBean;

            interface

            uses InvokeRegistry, SOAPHTTPClient, SOAPHTTPTrans, Types, XSBuiltIns;

            const
              IS_OPTN = $0001;
              IS_UNBD = $0002;
              IS_NLBL = $0004;
              IS_UNQL = $0008;
              IS_REF  = $0080;


            type
              // ************************************************************************ //
              // The following types, referred to in the WSDL document are not being represented
              // in this file. They are either aliases[@] of other types represented or were referred
              // to but never[!] declared in the document. The types from the latter category
              // typically map to predefined/known XML or Embarcadero types; however, they could also
              // indicate incorrect WSDL documents that failed to declare or import a schema type.
              // ************************************************************************ //
              // !:anyType         - "http://www.w3.org/2001/XMLSchema"[Gbl]
              // !:string          - "http://www.w3.org/2001/XMLSchema"[Gbl]
              // !:base64Binary    - "http://www.w3.org/2001/XMLSchema"[Gbl]

              MessageDTO           = class;                 { "http://dto.domest.it.sogei"[GblCplx] }
              XmlDTO               = class;                 { "http://dto.domest.it.sogei"[GblCplx] }

              ArrayOfXmlDTO = array of XmlDTO;              { "http://dto.domest.it.sogei"[GblCplx] }


              // ************************************************************************ //
              // XML       : MessageDTO, global, <complexType>
              // Namespace : http://dto.domest.it.sogei
              // ************************************************************************ //
              MessageDTO = class(TRemotable)
              private
                FinputObj: Variant;
                FoutputObj: Variant;
                FserviceID: string;
                FxmlList: ArrayOfXmlDTO;
              public
                destructor Destroy; override;
              published
                property inputObj:  Variant        Index (IS_NLBL or IS_UNQL) read FinputObj write FinputObj;
                property outputObj: Variant        Index (IS_NLBL or IS_UNQL) read FoutputObj write FoutputObj;
                property serviceID: string         Index (IS_NLBL or IS_UNQL) read FserviceID write FserviceID;
                property xmlList:   ArrayOfXmlDTO  Index (IS_NLBL or IS_UNQL) read FxmlList write FxmlList;
              end;

              // ************************************************************************ //
              // XML       : XmlDTO, global, <complexType>
              // Namespace : http://dto.domest.it.sogei
              // ************************************************************************ //
              XmlDTO = class(TRemotable)
              private
                Fxml: TByteDynArray;
              published
                property xml: TByteDynArray  Index (IS_UNQL) read Fxml write Fxml;
              end;


              // ************************************************************************ //
              // Namespace : http://dispatcher.domest.it.sogei
              // soapAction: dispatcher
              // transport : http://schemas.xmlsoap.org/soap/http
              // style     : document
              // binding   : DispatcherBeanSoapBinding
              // service   : DispatcherBeanService
              // port      : DispatcherBean
              // URL       : https://ws.agenziadogane.it/DomestRouter/services/DispatcherBean
              // ************************************************************************ //
              DispatcherBean = interface(IInvokable)
              ['{2D4F3F8E-969E-CF9A-EBAA-1C558EEF5A88}']
                function  dispatcher(const messaggio: MessageDTO): MessageDTO; stdcall;
              end;

            function GetDispatcherBean(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO=nil; PmTlmAmbiente: Integer=0): DispatcherBean;

            implementation
              uses SysUtils;

            function GetDispatcherBean(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO; PmTlmAmbiente: Integer): DispatcherBean;
            {PmTlmAmbiente
             0 = Ambiente di addestramento
             1 = Ambiente reale}
            const
              defWSDL_test = 'https://wstest.agenziadogane.it/DomestRouter/services/DispatcherBean/?wsdl';
              defWSDL_real = 'https://ws.agenziadogane.it/DomestRouter/services/DispatcherBean/?wsdl';
              defSvc  = 'DispatcherBeanService';
              defPrt  = 'DispatcherBean';
              defURL_real  = 'https://ws.agenziadogane.it/DomestRouter/services/DispatcherBean';
              defURL_test  = 'https://wstest.agenziadogane.it/DomestRouter/services/DispatcherBean';
            var
              RIO: THTTPRIO;
            begin
              Result := nil;
              if (Addr = '') then
              begin
                if UseWSDL then
                  begin
                  // ambiente addestramento
                  if PmTlmAmbiente = 0 then
                     Addr := defWSDL_test;

                  // ambiente reale
                  if PmTlmAmbiente = 0 then
                     Addr := defWSDL_real;
                  end
                else
                  begin
                  // ambiente addestramento
                  if PmTlmAmbiente = 0 then
                     Addr := defURL_test;

                  // ambiente reale
                  if PmTlmAmbiente = 1 then
                     Addr := defURL_real;
                  end;
              end;
              if HTTPRIO = nil then
                RIO := THTTPRIO.Create(nil)
              else
                RIO := HTTPRIO;
              try
                Result := (RIO as DispatcherBean);
                if UseWSDL then
                begin
                  RIO.WSDLLocation := Addr;
                  RIO.Service := defSvc;
                  RIO.Port := defPrt;
                end else
                  RIO.URL := Addr;

              finally
                if (Result = nil) and (HTTPRIO = nil) then
                  RIO.Free;
              end;
            end;

            destructor MessageDTO.Destroy;
            var
              I: Integer;
            begin
              for I := 0 to System.Length(FxmlList)-1 do
                SysUtils.FreeAndNil(FxmlList[I]);
              System.SetLength(FxmlList, 0);
              inherited Destroy;
            end;

            initialization
              InvRegistry.RegisterInterface(TypeInfo(DispatcherBean), 'http://dispatcher.domest.it.sogei', 'UTF-8');
              InvRegistry.RegisterDefaultSOAPAction(TypeInfo(DispatcherBean), 'dispatcher');
              InvRegistry.RegisterInvokeOptions(TypeInfo(DispatcherBean), ioDocument);
              RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOfXmlDTO), 'http://dto.domest.it.sogei', 'ArrayOfXmlDTO');
              RemClassRegistry.RegisterXSClass(MessageDTO, 'http://dto.domest.it.sogei', 'MessageDTO');
              RemClassRegistry.RegisterXSClass(XmlDTO, 'http://dto.domest.it.sogei', 'XmlDTO');

            end.
这是来自Web服务的XML响应:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <ns2:dispatcherResponse xmlns:ns2="http://dispatcher.domest.it.sogei">
         <dispatcherReturn>
            <inputObj xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
            <outputObj xsi:type="ns4:XmlDTO" xmlns:ns4="http://dto.domest.it.sogei" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
             <xml>Nzd1L1BEOTRiV3dnZG1WeWMybHZiajBpTVM0d0lpQmxibU52WkdsdVp6MGlkWFJtTFRnaVB6NEtQ</xml>
            </outputObj>
            <serviceID>D1</serviceID>
            <xmlList>
               <XmlDTO>
              <xml>Nzd1L1BEOTRiV3dnZG1WeWMybHZiajBpTVM0d0lpQmxibU52WkdsdVp6MGlkWFJtTFRnaVB6NEtQ</xml>
               </XmlDTO>
            </xmlList>
         </dispatcherReturn>
      </ns2:dispatcherResponse>
   </soapenv:Body>
</soapenv:Envelope>
当我调用GetDispatcherBeanFalse、、HTTPRIO1、0.dispatcherSOAP_RequestMsg时,我获得了错误

在RIO的BeforeExecute上,我只是控制XML请求,就像使用SoapUI的XML请求一样

在RIO的后期执行中,我只是控制XML响应,就像使用SoapUI的XML响应一样

GetDispatcherBeanFalse,,HTTPRIO1,0.dispatcherSOAP_RequestMsg返回一个MessageDTO,该类在UNDispatcherBean单元中定义,但我认为Delphi没有正确解析对对象MessageDTO的XML响应

你知道这个错误吗?我必须在哪里查找原因

这是我第一个使用Web服务和SOAP的项目,我希望不要写estupid之类的东西

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <ns2:dispatcherResponse xmlns:ns2="http://dispatcher.domest.it.sogei">
         <dispatcherReturn>
            <inputObj xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
            <outputObj xsi:type="ns4:XmlDTO" xmlns:ns4="http://dto.domest.it.sogei" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
             <xml>Nzd1L1BEOTRiV3dnZG1WeWMybHZiajBpTVM0d0lpQmxibU52WkdsdVp6MGlkWFJtTFRnaVB6NEtQ</xml>
            </outputObj>
            <serviceID>D1</serviceID>
            <xmlList>
               <XmlDTO>
              <xml>Nzd1L1BEOTRiV3dnZG1WeWMybHZiajBpTVM0d0lpQmxibU52WkdsdVp6MGlkWFJtTFRnaVB6NEtQ</xml>
               </XmlDTO>
            </xmlList>
         </dispatcherReturn>
      </ns2:dispatcherResponse>
   </soapenv:Body>
</soapenv:Envelope>