Hi,
I'm trying to use IWebBrowser2>>navigate2:flags:targetFrameName:postData:headers: to put some data to a php url. This is all working fine from someone else's VB application. I capured the tcp stream and found that everytime I navigated2, the control executed a GET rather than a PUT. MDSN says: (http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/webbrow ser/reference/ifaces/iwebbrowser2/iwebbrowser2.asp ) PostData [in] Pointer to data to send with the HTTP POST transaction. For example, the POST transaction is used to send data gathered by an HTML form. If this parameter does not specify any post data, IWebBrowser2::Navigate issues an HTTP GET transaction. This parameter is ignored if URL is not an HTTPURL. So it looks like it will PUT if the URL is not properly formed, or there is no post data. Everything navigates fine for ordinary URLs, and I can see my post data in the debugger, so I think I'm most likely having trouble with the representation of the post data. The content of the strings for headers, url, and post data seems identical to that in the working VB app. So I may be getting the type of the parameter wrong. I caputured the tcp stream using ethereal, and verified that a GET was being sent by my app, and a PUT by the blasted VB app :( Can anyone help with this? Regards, --Peter Goodall |
Mumbling to myself again...
Solved the problem - need to get the right variant type by following the right path of transformations This worked for original String of post data : dataToSend asByteArray asSAFEARRAY asVariant "Peter Goodall" <[hidden email]> wrote in message news:3fb04073$0$9282$[hidden email]... > Hi, > > I'm trying to use > IWebBrowser2>>navigate2:flags:targetFrameName:postData:headers: to put some > data to a php url. This is all working fine from someone else's VB > application. > > I capured the tcp stream and found that everytime I navigated2, the control > executed a GET > rather than a PUT. > > MDSN says: > (http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/webbrow > ser/reference/ifaces/iwebbrowser2/iwebbrowser2.asp ) > > > PostData [in] > > Pointer to data to send with the HTTP POST transaction. For example, the > POST > transaction is used to send data gathered by an HTML form. If this > parameter does not > specify any post data, IWebBrowser2::Navigate issues an HTTP GET > transaction. This > parameter is ignored if URL is not an HTTPURL. > > So it looks like it will PUT if the URL is not properly formed, or there > no post data. > Everything navigates fine for ordinary URLs, and I can see my post data in > the debugger, so I > think I'm most likely having trouble with the representation of the post > data. The content of > the strings for headers, url, and post data seems identical to that in the > working VB app. So I > may be getting the type of the parameter wrong. > > I caputured the tcp stream using ethereal, and verified that a GET was > sent by my app, > and a PUT by the blasted VB app :( > > Can anyone help with this? > > Regards, > > --Peter Goodall > > |
"Peter Goodall" <[hidden email]> wrote in message
news:3fb04886$0$3504$[hidden email]... > Mumbling to myself again... > > Solved the problem - need to get the right variant type by following the > right path of transformations > > This worked for original String of post data : dataToSend asByteArray > asSAFEARRAY asVariant > ... Yes the key bit of the documentation is in the remarks for Navigate2: "The post data specified by PostData is passed as a SAFEARRAY Data Type structure. The variant should be of type VT_ARRAY and point to a SAFEARRAY Data Type. The SAFEARRAY Data Type should be of element type VT_UI1, dimension one, and have an element count equal to the number of bytes of post data." In plain english this means the post data must be a byte array. Why, then, the parameter is declared as a VARIANT*, is anybody's guess. Anyway I'm glad you mentioned this because I think that #asVariant when sent to a ByteArray should produce a VARIANT holding a SAFEARRAY of UI1 (as required for this call) without needing to first send it #asSAFEARRAY. Recorded as #1387. Regards Blair |
In reply to this post by Peter Goodall-4
I should have said POST rather than PUT.
I found that using ethereal (http://www.ethereal.com/) following the tcp stream of the transaction, and saving it to disk, allowed me to use diff tools to compare the VB and Dolphin transaction contents. The most useful diff tool I found was http://www.ajcsoft.com/ProductsAJCDiff.php. It provides both binary and text comparisons. Its all working well. "Peter Goodall" <[hidden email]> wrote in message news:3fb04886$0$3504$[hidden email]... > > > > I captured the tcp stream and found that every time I navigated2, the > control > > executed a GET > > rather than a PUT. [...] |
In reply to this post by Peter Goodall-4
|
In reply to this post by Peter Goodall-4
I am using IWebBrowser2 Interface in ActiveX to automate Webbased applications. For one of the application I uses the Navigate2 to POST information to the web server and automate a login process. For doing the same I have additional header information ( "Content Type : application-encoded-url ... " ) along with user name and password in Post data.
The Problem: Every thing works fine , If the user logged into the computer have local admin rights. If the user doesnt have admin rights, I found that when the navigation proceeds to OnBeforeNavigate () , the Header information is missing. I really wonder whether this has anything to do with recent service packs or security updates for IE. Any help is greatly appreciated |
Free forum by Nabble | Edit this page |