Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

XML and VB6

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
RUNRMTCMD from AS/400 12 69
Selenium docs api java index 3 48
adding "ungroup sheets" to existing vbs code 5 31
Programming Language for Wordpress 7 38
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
A short article about problems I had with the new location API and permissions in Marshmallow
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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…

829 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