Sending xml content in body paragraph - Printable Version +- Antwise community forums (https://forums.antwise.com) +-- Forum: Antview (https://forums.antwise.com/forumdisplay.php?fid=11) +--- Forum: Antview for Windows (https://forums.antwise.com/forumdisplay.php?fid=12) +--- Thread: Sending xml content in body paragraph (/showthread.php?tid=146) |
Sending xml content in body paragraph - Vasile - 2022-12-30 Hi, I need to send the content of an xml file in the body part of a message, using the POST method. The requirement is to specify Content-Type=application/xml in the header part. Question: Can this be done with the method: .NavigateWithWebResourceRequest(String uri, String method, String postData, String headers) or .PostWebMessageAsString(String webMessageAsString) A small example would help. Thanks you, Vasile RE: Sending xml content in body paragraph - wila - 2022-12-30 (2022-12-30, 11:48:19)Vasile Wrote: Hi,Hi Vasile, Normally I would use the http post feature in the programming language that I am using in order to do such a thing, but there might be numerous reasons why you can't do that. With that out of the way. You cannot use PostWebMessageAsString for that as webmessages are something for communicating between host application and html/javascript hosted in the browser control. See for example here: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage for more info on that and a code example with AntView is here: https://doc.antview.dev/hs850.htm NavigateWithWebResourceRequest could work for this. Sadly the online help on this is behind, but you've got a private version of AntView where the help is updated. Look in the CHM file that is installed with AntView and look up NavigateWithWebResourceRequest. I think it has all the info you need to get this working. If not then do let me know. -- Wil RE: Sending xml content in body paragraph - Vasile - 2023-01-06 Hi Wila, Sending xml content , .NavigateWithWebResourceRequest() WORK FOR THIS. myUri = 'https://webserviceapl. ...' myVar = '<?xml version="1.0" encoding="UTF-8"?> ... ' .ACTIVEX1.nativeobject.NavigateWithWebResourceRequest( myUri, 'POST', myVar , 'Content-Type: application/xml' ) also can perform .ACTIVEX1.nativeobject.NavigateWithWebResourceRequest( myUri2, 'GET', null , null ) Please, as we have NavigateSync method we can also have NavigateWithWebResourceRequestSync method, which would simplify the program a lot. Now I use the OnNavigationCompleted event along with a timer object, to get the response (content, JSON) from the web server. Thank you Vasile RE: Sending xml content in body paragraph - wila - 2023-01-06 (2023-01-06, 09:59:07)Vasile Wrote: Please, as we have NavigateSync method we can also have NavigateWithWebResourceRequestSync method, which would simplify the program a lot. Vasile, Officially NavigateSync is not even a released method yet. We're in the middle of a release later today though, so it will be very soon. The feature request for also having a NavigateWithWebResourceRequestSync won't make it this release, as it would block today's release, but I have just filed a feature request for that on your behalf. -- Wil RE: Sending xml content in body paragraph - Vasile - 2023-01-06 Thank you very much Vasile |