Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sending xml content in body paragraph
#1
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
Reply
#2
(2022-12-30, 11:48:19)Vasile Wrote: 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
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...ostMessage
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
Reply
#3
Thumbs Up 
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
Reply
#4
(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.
Now I use the OnNavigationCompleted event along with a timer object, to get the response (content, JSON) from the web server.

Thank you
Vasile

Vasile,

Officially NavigateSync is not even a released method yet. Tongue
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
Reply
#5
Smile 
Thank you very much
Vasile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)