Solved

VB6 WEBBROWSER

Posted on 2014-04-25
14
350 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 142

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 142

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
 

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 142

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
Integrate social media with email signatures

Is your company active on social media? Do you also use email signatures? Including social media icons in your email signature is a great way to get fans for free. Let all your email users know you’re on social media quickly and easily, in a single click.

 

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 142

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 142

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 142

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

Why are Office 365 signatures so complicated?

Trying to setup transport rules for Office 365 email signatures and can’t quite figure it out? Having to test the signature over and over? Make things simple by using Exclaimer Cloud - Signatures for Office 365.

Question has a verified solution.

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

The biggest nightmare for any Exchange Server Administrator is to keep the server running without any issue. But the problems often come and they need to be resolved efficiently and timely. Here are important troubleshooting points: Define the Pr…
A high-level exploration of how our ever-increasing access to information has changed the way we do our jobs.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

929 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now