Delphi 如果没有对象soap,我如何读取/设置数据
如果我使用VB.NET遵循代码,它的工作很好。但我如何在delphi 2010上实现它呢。 我的问题是找到r.MessageData.AppData.Any 我试着用Delphi 如果没有对象soap,我如何读取/设置数据,delphi,soap,delphi-2010,indy10,webservices-client,Delphi,Soap,Delphi 2010,Indy10,Webservices Client,如果我使用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.GetDataPoi
rootNode := otv.MessageData.AppData.ObjectToSOAP(rootNode,rootNode,HttpRIO.Converter,'OrderInfo','otv',[],s);
or p := otv.MessageData.AppData.DataContext.GetDataPointer(0);
但我找不到AppData对象的atribut(例如orderId)
我必须阅读和设置appData,但对于appData,我如何在Delphi2010上执行它
多谢各位
**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;
VB.NEt代码(其工作)
您没有在Delphi的WSDL导入器上设置正确的选项,因此导入的类不包含您要查找的数据。WSDL导入器相当繁琐,可能需要一些尝试和错误才能获得预期的结果。在许多情况下,我已经放弃并手动完成了它。如果我在VB.NET上完成,问题是相同的(我没有看到这些参数)。但是我可以从r.MessageData.AppData.Any.ToArray读取。其中.Any是VB.Net的属性。我想在Delphi2010中也可以找到这个属性。正如我已经解释过的,Delphi2010 WSDL导入器非常挑剔。我不知道VB.NET是怎么做到的。您的问题是为什么不能在Delphi中访问属性,我说您需要在WSDL导入器中尝试导入选项。您是否尝试过不同的导入选项?
<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>
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