0

VB .NETフォローコードを使用するとうまくいきます。しかし、どうすれば Delphi 2010 で実現できますか。私の問題は、r.MessageData.AppData.Any のアナログを見つけることです。

使ってみます

rootNode := otv.MessageData.AppData.ObjectToSOAP(rootNode,rootNode,HttpRIO.Converter,'OrderInfo','otv',[],s);
  or p := otv.MessageData.AppData.DataContext.GetDataPointer(0);

しかし、私は AppData のオブジェクトの属性を見つけることができません - (orderId など)。

appData の属性を読み取って設定する必要があります - Delphi 2010 でそれを行うにはどうすればよいですか

ありがとうございました。

    **part of unit WSDL Importer(CommonAppDataType class is empty)**
unit AisMFCService;

interface

uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;

const
  IS_OPTN = $0001;
  IS_UNBD = $0002;
  IS_NLBL = $0004;
  IS_ATTR = $0010;
  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.
  // ************************************************************************ //
  // !:string          - "http://www.w3.org/2001/XMLSchema"[Gbl]
  // !:anyURI          - "http://www.w3.org/2001/XMLSchema"[Gbl]
  // !:dateTime        - "http://www.w3.org/2001/XMLSchema"[Gbl]
  // !:base64Binary    - "http://www.w3.org/2001/XMLSchema"[Gbl]

  Include              = class;                 { "http://www.w3.org/2004/08/xop/include"[GblCplx] }
  Include2             = class;                 { "http://www.w3.org/2004/08/xop/include"[GblElm] }
  orgExternalType      = class;                 { "http://eos.ru/doc/service"[GblCplx] }
  MessageType          = class;                 { "http://eos.ru/doc/service"[GblCplx] }
  SubMessageType       = class;                 { "http://eos.ru/doc/service"[GblCplx] }
  MessageDataTypeOfCommonAppDataType = class;   { "http://eos.ru/doc/service"[GblCplx] }
  CommonAppDataType    = class;                 { "http://eos.ru/doc/service"[GblCplx] }
  AppDocumentType      = class;                 { "http://eos.ru/doc/service"[GblCplx] }
  ReferenceType        = class;                 { "http://eos.ru/doc/service"[GblCplx] }
  Message_             = class;                 { "http://eos.ru/doc/service"[GblElm] }
  MessageData          = class;                 { "http://eos.ru/doc/service"[GblElm] }
  orgExternalType2     = class;                 { "http://smev.gosuslugi.ru/rev120315"[GblCplx] }
  MessageType2         = class;                 { "http://smev.gosuslugi.ru/rev120315"[GblCplx] }
  SubMessageType2      = class;                 { "http://smev.gosuslugi.ru/rev120315"[GblCplx] }
  MessageDataTypeOfCommonAppDataType2 = class;   { "http://smev.gosuslugi.ru/rev120315"[GblCplx] }
  CommonAppDataType2   = class;                 { "http://smev.gosuslugi.ru/rev120315"[GblCplx] }
  AppDocumentType2     = class;                 { "http://smev.gosuslugi.ru/rev120315"[GblCplx] }
  ReferenceType2       = class;                 { "http://smev.gosuslugi.ru/rev120315"[GblCplx] }
  Message_2            = class;                 { "http://smev.gosuslugi.ru/rev120315"[GblElm] }
  MessageData2         = class;                 { "http://smev.gosuslugi.ru/rev120315"[GblElm] }
  sendRequestMessage   = class;                 { "http://eos.ru/doc/Message"[Lit][GblElm] }
  ResponseMessage      = class;                 { "http://eos.ru/doc/Message"[Lit][GblElm] }
  sendGetStatusRequestMessage = class;          { "http://eos.ru/doc/Message"[Lit][GblElm] }
  GetStatusResponseMessage = class;             { "http://eos.ru/doc/Message"[Lit][GblElm] }
  SubMessage           = class;                 { "http://eos.ru/doc/service"[Alias] }
  SubMessage2          = class;                 { "http://smev.gosuslugi.ru/rev120315"[Alias] }
....

  // ************************************************************************ //
  // XML       : CommonAppDataType, global, <complexType> (AppDAta)
  // Namespace : http://eos.ru/doc/service
  // ************************************************************************ //
  CommonAppDataType = class(TRemotable)
  private
  published
  end;

webService からの xml テキスト

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><ResponseMessage xmlns="http://eos.ru/doc/Message"><Message xmlns="http://smev.gosuslugi.ru/rev120315"><Sender><Code>342703391</Code><Name>Дело</Name></Sender><Recipient><Code>123456789</Code><Name>АИС МФЦ</Name></Recipient><Originator><Code>123456789</Code><Name>АИС МФЦ</Name></Originator><TypeCode>GSRV</TypeCode><Status>ACCEPT</Status><Date>2013-08-07T16:19:26.39125+04:00</Date><ExchangeType>0</ExchangeType></Message><MessageData xmlns="http://smev.gosuslugi.ru/rev120315"><AppData><OrderInfo xmlns=""><orderId>10028894</orderId><statusCode>1</statusCode><comment>Заявление передано в информационную систему "Дело"</comment></OrderInfo></AppData></MessageData></ResponseMessage></s:Body></s:Envelope>

VB.NET コード (その作品)

Dim a As New ais.AisMFCRequestMessage
        Dim doc As New Xml.XmlDocument
        Dim el As Xml.XmlElement
        el = doc.CreateElement("GetStatuesRequest")
        el.InnerXml = TextBox1.Text
        MsgBox(el.InnerXml)
        Dim els() As Xml.XmlElement
        Dim s As ais.IAisMFCService

        s = New ais.AisMFCServiceClient
        a.Message = New ais.MessageType
        a.Message.Sender = New ais.orgExternalType
        a.Message.Sender.Code = "123456789"
        a.Message.Sender.Name = "АИС МФЦ"
        a.Message.Recipient = New ais.orgExternalType
        a.Message.Recipient.Code = "1234567890"
        a.Message.Recipient.Name = "Delo"
        a.Message.Originator = New ais.orgExternalType
        a.Message.Originator.Code = "123456789"
        a.Message.Originator.Name = "АИС МФЦ"
        a.Message.ServiceName = "SN1"
        a.Message.TypeCode = ais.TypeCodeEnum.GSRV
        a.Message.Status = ais.StatusEnum.REQUEST
        a.Message.Date = Now.Date
        a.Message.ExchangeType = ais.ExchangeTypeEnum.Item2
        a.Message.ServiceCode = "01"
        a.Message.CaseNumber = "1"
        a.MessageData = New ais.MessageDataTypeOfCommonAppDataType
        a.MessageData.AppData = New ais.CommonAppDataType
        ReDim els(0)
        els(0) = el
        a.MessageData.AppData.Any = els

        Dim r As ais.AisMFCResponseMessage = s.CreateRequest(a)
        MsgBox(r.Message.Date.ToString)

        Dim m = r.MessageData.AppData.Any.ToArray
        For Each o In m
            el = o
            TextBox1.Text = el.InnerXml
        Next
4

1 に答える 1

0

Delphi の WSDL インポーターで正しいオプションを設定していないため、インポートされたクラスには探しているデータが含まれていません。WSDL インポーターはややこしいので、期待どおりの結果を得るには試行錯誤が必要になる場合があります。多くの場合、あきらめて手作業で行ってきました。

于 2013-08-08T08:18:39.287 に答える