Solved

XML and VB6

Posted on 2007-11-27
6
3,335 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A short article about a problem I had getting the GPS LocationListener working.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
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…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

919 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

18 Experts available now in Live!

Get 1:1 Help Now