1. Lucía Quiñones
  2. PowerBuilder
  3. Thursday, 28 July 2022 05:07 AM UTC

Hello

we have a problem in power builder 2017 or power builder 11.5 with internet explorer and edge.

Using the ole_browser object of type microsoft web browser and using microsoft internet explorer as web browser it works and we can upload files to a java servlet connecting as follows:

    ole_object_upload.object.connecttonewobject("InternetExplorer.Application")

    ole_object_upload.object.Navigate(ls_url,0,4,lblobParam,lBlobHeader)

    ole_object_upload.object.disconnectobject( )

Being ls_url the URL of the servlet, for example "https://xxxxxxxxxxxxxxxxx", in the BLOB field we send the attached file.

However, disabling Microsoft Internet Explorer in Windows 10 and setting Microsoft Edge as the default browser and enabling Edge Compatibility Mode with Microsoft Internet Explorer works randomly and does not give any errors.

We have tried to Change this: connecttonewobject("InternetExplorer.Application") by connecttonewobject("Edge.Application") and it doesn't work or give an error.

Thanks

Accepted Answer
René Ullrich Accepted Answer Pending Moderation
  1. Thursday, 28 July 2022 10:54 AM UTC
  2. PowerBuilder
  3. # Permalink

Do you need this only to send a blob to server?

What should work in both versions: MSXML2.XMLHTTP or MSXML2.ServerXMLHTTP

XMLHttp is easy because it uses some windows settings. ServerXMLHTTP has more options.

A very easy example:

OLEObject lole_XmlHttp
lole_XmlHttp = Create OLEObject
lole_XmlHttp.ConnectToNewObject ("Msxml2.XMLHTTP")
lole_XmlHttp.Open ("POST", ls_url, FALSE, ls_authuser, ls_authpwd)
lole_XmlHttp.Send (lblob_data)
MessageBox ("HTTP status", string (lole_XmlHttp.status))
lole_XmlHttp.DisconnectObject ()
DESTROY lole_XmlHttp

Comment
  1. Lucía Quiñones
  2. Friday, 29 July 2022 05:15 AM UTC
Thanks for your reply.



My answer to your question is yes. I do this to send a file to the server.



I have some questions.

Does the Ole Browser object have to be of a specific type? Mine is of type 'Microsoft Web Browser'.

Are the username and password of the Open function not mandatory? It could be called like this?: "lole_XmlHttp.Open("POST", ls_url, FALSE)"



I've tried it on PB 11.5 and PB 2017 and it doesn't work for me, it fails when calling the Open function. The error it gives me is: "Name not found calling external object function open".



I have tested it with this code:

ole_doc.object.ConnectToNewObject ("Msxml2.XMLHTTP")

ole_doc.object.Open ("POST", ls_url, FALSE)

ole_doc.object.Send (lblobparam)

ole_doc.object.DisconnectObject ()



Thank you very much.
  1. Helpful
  1. René Ullrich
  2. Friday, 29 July 2022 05:59 AM UTC
You don't need to specify username and password. Open ("POST", ls_url, FALSE) should work.

The XMLHttp object is not a control that you can embed like the webbrowser control.

Use OLEObject instead. I will enhance my posting to show it.



  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.