Xb2.NET SOAP Server Test

The sample WEBSERVE HTTP server included with Xb2.NET also provides SOAP services. In order to execute a SOAP service, WEBSERVE.EXE must be running. If the server is not running, do this:

  1. Open a DOS prompt.
  2. Change directory to where you installed Xb2.NET.
  3. Type PBUILD to build all samples.
  4. Type WEBSERVE to run sample HTTP server.
  5. Open a web browser and type: localhost in the address field. Hit Enter.
  6. The Xb2.NET "Start Here" page should appear.

The SOAP services can be executed by initiating a request from a SOAP client. A sample SOAP client application SOAPEXEC.EXE is included with Xb2.NET and can be started by clicking here. Alternatively, these tests can also be executed from your web browser by using the generic SOAP Message Builder applet from soapclient.com. NOTE: The generic SOAP client applet can only connect to the server if the server has an external IP address. Proceed as follows:

  1. Go to: http://www.soapclient.com/soapmsg.html (this is the generic SOAP client).
  2. Enter your SOAP server IP address in the "Server Address" field on SOAPClient page.
    If you don't know your server's (external) IP address, you can obtain it here: http://xb2.net/whatsmyip?
  3. Copy and paste the SOAP Action from table below into the "SOAP Action" field.
  4. Copy and paste the associated SOAP Envelope from table below into the "SOAP Message" field.
  5. Click "Execute" button on SOAPClient page.
  6. You should receive an XML response on the SOAPClient page.


The sample WEBSERVE HTTP/SOAP server includes the following services:

SOAP Action

Description

SOAP Envelope

GetDateTime Return current server date and time to remote SOAP client.
<?xml version="1.0" ?>
<env:Envelope xmlns:env="http://www.w3.org/2001/06/soap-envelope">
 <env:Body>
  <m:GetDateTime env:encodingStyle="http://www.w3.org/2001/06/soap-encoding" xmlns:m="http://xb2.net/soap">
  </m:GetDateTime>
 </env:Body>
</env:Envelope>
SaveMessage Save a text message on server.
Message is saved in file SOAPLOG.TXT
<?xml version="1.0" ?>
<env:Envelope xmlns:env="http://www.w3.org/2001/06/soap-envelope">
 <env:Body>
  <m:SaveMessage env:encodingStyle="http://www.w3.org/2001/06/soap-encoding" xmlns:m="http://xb2.net/soap">
    <UserName>Peter Parker</UserName>
    <Message>Here comes the spider man</Message>
  </m:SaveMessage>
 </env:Body>
</env:Envelope>
EchoAll Echo back all parameters.
The sample envelope on the right contains a 3 element integer array.
<?xml version="1.0" ?>
<env:Envelope
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:SOAPEnc="http://schemas.xmlsoap.org/soap/encoding/"
 xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
 <env:Body>
  <m:EchoAll env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:m="http://xb2.net/soap">
    <inputIntegerArray SOAPEnc:arrayType="xsd:int[3]" xsi:type="SOAPEnc:Array">
    <xsd:int xsi:type="xsd:int">1</xsd:int>
    <xsd:int xsi:type="xsd:int">2</xsd:int>
    <xsd:int xsi:type="xsd:int">1234</xsd:int>
    </inputIntegerArray>
  </m:EchoAll>
 </env:Body>
</env:Envelope>

View Source code:
  1. WebServe.prg (HTTP and SOAP server)
  2. SOAPExec.prg (SOAP client)