Solved

XML and VB6

Posted on 2007-11-27
6
3,329 Views
Last Modified: 2008-02-27
Hi Experts,

      I have a program in vb6 that can create an xml file. There are two things that I am having
problems with.

      1. How to embed image to xml file/encode image to base64 string. Please tell me what are the
steps that needs to do first to encode image directly to base64.

      2. Send xml file to url using POST method. I am really having problem with this as I
cannot tell if the xml has been successfully sent to the url.
      And I think but not sure that it was not sent as I am getting a response text of
"No xml file to parse! Debug file written" when I tried to send the xml at this url
http://utility.gcdtech.com/propertyUpload.php, but when I tried to change the url to any url
I got a response text in something html format.

      Below are the lines of code that I used to send an xml:

      Const SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS = 13056
      Dim xmlHttp As New ServerXMLHTTP
      Set xmlHttp = New ServerXMLHTTP
      xmlHttp.Open "POST", "http://utility.gcdtech.com/propertyUpload.php", False
      xmlHttp.setRequestHeader "Content-Type", "text/xml"
      xmlHttp.SetOption 2, SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS
      xmlHttp.send pXMLDoc.xml
      If xmlHttp.ReadyState = 4 Then
          If xmlHttp.Status = 200 Then
              XML_Send = xmlHttp.responseText
              MsgBox xmlHttp.responseText
              Set XML_Send = xmlHttp.responseXML.xml
              MsgBox XML_Send
          End If
      End If

      Every comments and suggestions are much appreciated.

Thanks,

Marj
0
Comment
Question by:barman78
6 Comments
 
LVL 10

Accepted Solution

by:
Dxpert earned 125 total points
ID: 20360488
Some links to help you get started:

VB6: Free, Easy and Quick Base64 Encoding and Decoding in Visual Basic
http://www.nonhostile.com/howto-encode-decode-base64-vb6.asp

Binary XML
http://www.stylusstudio.com/binary_xml.html

Images in Open XML documents
http://blogs.msdn.com/dmahugh/archive/2006/12/10/images-in-open-xml-documents.aspx

RFC 2397 - Embed image data inside a URL
http://www.hackszine.com/blog/archive/2006/11/rfc_2397_embed_image_data_insi.html

0
 

Author Comment

by:barman78
ID: 20365015
What about my problem no. 2? I had already found a solution for the no. 1 all is left now is to POST xml. I always got a response text of "No xml to parse! Debug file written." . Is it in the code or is it the url not be able to accept xml posting?

0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 20365091
if post failed, check xmlhttp.status and xmlhttp.statustext and err.number
0
 

Author Comment

by:barman78
ID: 20365458
The xmlHttp.ReadyState was 4 and xmlHttp.Status was 200 and there's no error number. but still getting a response text of "No xml to parse! Debug file written.".  I would like to try posting it using urlencoded as content-type. Do you know how to do it? Tell me what to do how to set xml as url.
0
 
LVL 1

Expert Comment

by:Computer101
ID: 21000166
Forced accept.

Computer101
EE Admin
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

762 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

21 Experts available now in Live!

Get 1:1 Help Now