Receiving XML Data

In this section, HTTP Transport for Secure Peer-to-Peer Business Data Interchange over the Internet is addressed. A very simple demo program shows the WebRainbow's capability for this area.

Exchanging structured business data securely using HTTP/HTTPS transport for Electronic Data Interchange (EDI), XML or other data used for business to business data interchange over the Internet is interesting practice. The data is packaged using standard MIME content-types and sent to a Web server using the HTTP POST method by the browser or any application with HTTP POST capability.

Starting from the WebRainbow v1.3, the acceptable content-types for HTTP POST method is extended to allow the application receiving any specified content-type of data POSTed through HTTP. The only extra code needed is to call SpecityContentType to specify the proper content-type, then the POSTed data can be retrieved by calling GetFormData without any parameters.

Here, the sample program HttpPost shows how to use SpecityContentType to make the application accept the specified content-type, and use GetFormData to retrieve the data which transmitted through HTTP POST method. To make the case general, this sample program accept content-type text/xml only, and use a VB program Poster, instead of the browser, to POST the row XML data to the Web server directly. The source code for Poster is also included in the demo.

Note:

To compile this sample, follow the steps listed bellow:

  1. Start Visual Basic

  2. Select Standard EXE as project type

  3. Select Sub Main as Startup Object

  4. Give HttpPost as project name

  5. Set reference to WRHttpB.tlb, WRMimeB.tlb, and WRnbwB.tlb

  6. Remove Form1, which is the default form for new VB project

  7. Add HttpPost.bas (source code for Visual Basic 5 & 6) or HttpPost4.bas (source code for Visual Basic 4 32-bit), corresponding to the version of Visual Basic you used, into the Project HttpPost. These two files are normally in the folder
         C:\Program Files\WebRainbow\demo\httppost\
    if you did not change the installation directory for WebRainbow.

  8. Compile it to HttpPost.exe.

To debug HttpPost:

To compile the Poster, follow the steps listed bellow:

  1. Start Visual Basic

  2. Select Standard EXE as project type

  3. Give Poster as project name

  4. Remove Form1, which is the default form for new VB project

  5. Add poster.frm into the Project Poster. This file are normally in the folder
         C:\Program Files\WebRainbow\demo\httppost\
    if you did not change the installation directory for WebRainbow.

  6. Select frmPoster as Startup Object

  7. Compile it to Poster.exe.

To run this sample, click on the following link for instruction of


For the latest information on WebRainbow, please see:
http://www.dmfsys.com/wrainbow/

For questions / comments please email to:
support@dmfsys.com


Copyright © 2000 - 2005 D.M.F. Systems, Corporation. All rights reserved.

Last modified on March 2, 2005