Delphi Win32 Retrieving Data from an ASP.NET Service

I am creating a Delphi Win32 application that should consume a soap service, which, as it turns out, is a .NET application. One function returns a DataTable. Of course, Delphi Win32 (and not Delphi.NET) cannot figure it out initially.

How can I make it work? I will also deal with XML manually, but I donโ€™t know how to get the original XML response.

WSDL: https://stratus.voxamvia.co.za/api.asmx?WSDL

Function: GetNotifications, which returns GetNotificationsResult, which is created as:

GetNotificationsResult = class(TRemotable) private Fnamespace: WideString; Fnamespace_Specified: boolean; FtableTypeName: WideString; FtableTypeName_Specified: boolean; procedure Setnamespace(Index: Integer; const AWideString: WideString); function namespace_Specified(Index: Integer): boolean; procedure SettableTypeName(Index: Integer; const AWideString: WideString); function tableTypeName_Specified(Index: Integer): boolean; published property namespace: WideString Index (IS_ATTR or IS_OPTN) read Fnamespace write Setnamespace stored namespace_Specified; property tableTypeName: WideString Index (IS_ATTR or IS_OPTN) read FtableTypeName write SettableTypeName stored tableTypeName_Specified; end; 

Any help appreciated!

Would it help me implement RemObjects?

+6
source share
2 answers

You can create your dataset from xml. This should give you a starting point: http://www.gekko-software.nl/DotNet/Art07.htm and http://www.gekko-software.nl/DotNet/Art08.htm .

I have not used DataAbstract from RemObjects, so I can not give him advice.

LE: you can access the web service and write it to .net by following this simple article, well written by drbob - Using C # Web Services with Delphi 7 Professional

which also contains a small example of how to dynamically build and how to use THttpRio (this is the same as Michael Ericsson's answer)

+3
source

How can I make it work? I will be happy to parse the XML manually too, but I donโ€™t know how to get the raw XML response.

You can get it at OnAfterExecuteEvent on THTTPRIO . There you will have SOAPResponse: TStream as a parameter.

Update:

To fire an event, add the THTTPRIO component, create an event handler, and use the RIO component as the third parameter for GetAPISoap .

It worked for me. HTTPRIO1 is a form component.

 procedure TForm7.Button1Click(Sender: TObject); var A: APISoap; begin A := GetAPISoap(False, '', HTTPRIO1); A.Validate_User('', ''); end; 
+1
source

Source: https://habr.com/ru/post/900762/


All Articles