Solved

XML and VB6

Posted on 2007-11-27
6
3,355 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
[X]
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
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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

This is an explanation of a simple data model to help parse a JSON feed
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. 

726 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