[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3389
  • Last Modified:

XML and VB6

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
barman78
Asked:
barman78
1 Solution
 
DxpertCommented:
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
 
barman78Author Commented:
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
 
EDDYKTCommented:
if post failed, check xmlhttp.status and xmlhttp.statustext and err.number
0
 
barman78Author Commented:
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
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now