Solved

VB6 WEBBROWSER

Posted on 2014-04-25
14
356 Views
Last Modified: 2014-06-10
I'm writing a program where I need to navigate to a web page and upload an xml file at the same time. The xml file is complete, and contains username and password along with other info required by the web page.
I am writing in VB6.
The company that handles the web page has a test page setup where I can paste my xml to a text box and then post to the web page, and that works great.
I just cannot get this to happen from within my code
0
Comment
Question by:jamesguy99
  • 6
  • 6
14 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 40022712
without seeing your VB6 code, it will be difficult to comment on what could go wrong.
0
 

Author Comment

by:jamesguy99
ID: 40022947
'WB is my webbrowser
'strXMLFile contains the xml statement itself
'the web address is strWebPageEstimate - 'http://iseisi.staging.activant.com/Service/GenLogin.aspx

'I have tried
 WB.Navigate strWebPageEstimate, , , strXMLFile

i have also tried -
WB.Navigate strWebPageEstimate
WB.Document.Write.strXMLFile

Can someone tell me if I'm even close?
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 40023171
your call looks like it's basically correct, except that presumably the page requires some "headers"...
however, it's the page specs that you need to retrieve from them, which shall indicate what exactly you need to specify
http://support.microsoft.com/kb/172998
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:jamesguy99
ID: 40026067
Gary - Your comments have been helpful, but I still am not there. I read the Microsoft article you noted above, but I'm still not getting a connection. Not certain what you mean by 'page specs', and who do I retrieve them from? This is a fairly large job for me, so I really need to work through this somehow. Thanks.
0
 

Author Comment

by:jamesguy99
ID: 40026070
Guy - one other thing - i have no problem giving you my xml code (which I know is correct and complete). If that could help somehow, just let me know. Thanks again.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 40027030
the XML alone won't help, as I would have to "guess" what "header" are to be send.
0
 

Author Comment

by:jamesguy99
ID: 40027139
Guy, should the people who developed the web page be able to tell me what 'headers' I am needing?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 40027222
Yes, absolutely
0
 

Author Comment

by:jamesguy99
ID: 40049900
Anyone who may be interested - this code runs -

    Dim strXMLFile As String
    Dim flags As Long
    Dim TargetFrame As String
    Dim PostData() As Byte
    Dim strData As String
    Dim Headers As String
    Call CreateXMLFile(strXMLFile)
    PostData = strXMLFile
    flags = 0
    TargetFrame = ""
    Headers = "Content-Type: application/x-www-form-urlencoded" & vbCrLf
    WebBrowser.Navigate strWebPageEstimate, flags, TargetFrame, PostData, Headers
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 40049912
so indeed it was some headers to put :)
glad you got the last bit for your application code to work
0
 

Author Comment

by:jamesguy99
ID: 40050438
Guy - thanks again for your insight.
It let me know where to direct my search.
As you might expect, I am now needing some sample code to download some html code from that same web site.
Once again I am using the ActiveX Webbrowser in VB6.
I have Googled some but have not found exactly what I am looking for.
Any ideas?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 40061464
you use the .Navigate (or .Navigate2) method to open the URL, and catch the document on the NavigateComplete2 event of the browser control
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 40124060
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Email Issue 3 98
MS SQL store procedure to calculate and return result 6 63
How to make an ADE file by code? 11 94
MsgBox 4 69
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The advancement in technology has been a great source of betterment and empowerment for the human race, Nevertheless, this is not to say that technology doesn’t have any problems. We are bombarded with constant distractions, whether as an overload o…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question