Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component

  

  

  Chilkat ActiveX Components

  Chilkat .NET Components

  Chilkat C++ Libraries

  

  

  

  

 

FAQ

Chilkat XML Supports XMLHTTP

The ChilkatXml.HttpPost method provides client-side protocol support for communication with HTTP servers. A client computer can use this method to send an arbitrary HTTP request, receive the response, and have Chilkat XML parse that response.

The request body is sent directly from the Chilkat XML object and the response is parsed directly into the returned Chilkat XML object. When combined with the support for Extensible Stylesheet Language (XSL), this provides an easy way to send structured queries to HTTP servers and efficiently display the results with a variety of presentations.

 Example

The following Visual Basic example posts a document to an Active Server Pages (ASP) page on a server and returns the result as a Chilkat XML document.

      Dim xmlIn As ChilkatXml
    Set xmlIn = New ChilkatXml
    
    ' Load the XML from the text box
    ' return 1 for success, 0 for failed.
    Dim success As Long
    success = xmlIn.LoadXml("<test><name>William</name></test>")
    
    ' Contents of xmlIn are passed in a parameter named "xml"
    Dim xmlOut As ChilkatXml
    Set xmlOut = xmlIn.HttpPost("http://www.myhost.com/test.asp")

    ' XmlResponse is an TextBox control on a VB form.
    If (Not (xmlOut Is Nothing)) Then
        XmlResponse.Text = xmlOut.GetXML()
    End If 

The ASP page on the server loads the posted XML document, processes the order, and builds a resulting XML document. It can be written using ASP XML, or with MSXML. Here are examples for both:

MSXML Example:

<%@ language=javascript %>
<%
    Response.Expires = -1000;
    // Load the posted XML document.
    var doc = Server.CreateObject("Msxml2.DOMDocument");
    doc.load(Request);
    var result = Server.CreateObject("Msxml2.DOMDocument");
    // Now process the order and build the result document.
    Response.ContentType = "text/xml";
    result.save(Response);
%>

ASP XML Example:

<% 

  dim xmldoc
  set xmldoc = Server.CreateObject("AspXml.AspXml")
  ' Get the incoming XML document from the ASP Request object.
  ' This is equivalent to "doc.load(Request)" when using MSXML
  xmldoc.loadRequest()

  dim child
  set child = Server.CreateObject("AspXml.AspXml")
  child.Tag = "info"
  child.Content = "This is some information"
  xmldoc.AddChildTree(child)

  Response.ContentType = "text/xml"
  Response.write(xmldoc.GetXml())
%>


About Chilkat


Privacy Statement. Copyright 2000-2010 Chilkat Software, Inc. All rights reserved.
Send feedback to support@chilkatsoft.com

Components for Microsoft Windows 7, Vista, XP, 2000, 2003 Server, and Windows 95/98/NT4.