Archived: SOAP 1.2 Request and Response of GetSpeech

This section provides a tutorial example on how to use SocketRequestResponse.pl to send a SOAP 1.1 request for the GetSpeech Web service provided by www.xmlme.com. The response of GetSpeech received looks very nice.

Note that the "GetSpeech" Web service provided by xmlme.com is no longer available.

After finishing SOAP 1.1 test, I continued to use SocketRequestResponseBinary.pl to send a SOAP 1.2 request for the GetSpeech Web service.

According to the instructions given at http://www.xmlme.com/WSShakespeare.asmx?op=GetSpeech, I prepared by first request sample, soap_1_2_GetSpeech.req:

POST /WSShakespeare.asmx HTTP/1.1
Host: www.xmlme.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 416

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetSpeech xmlns="http://xmlme.com/WebServices">
      <Request>Cowards die many times before their deaths</Request>
    </GetSpeech>
  </soap12:Body>
</soap12:Envelope>

I carefully counted the number of bytes of the request content including the last \r\n and entered 416 in the Content-Length header line.

Here is the test result of my sample SOAP 1.2 request:

herong> SocketRequestResponseBinary.pl www.xmlme.com 80 \
   soap_1_2_GetSpeech.req soap_1_2.res

herong> more soap_1_2.res
HTTP/1.1 200 OK
Connection: close
Date: ... 2009
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private, max-age=0
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 725

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <GetSpeechResponse xmlns="http://xmlme.com/WebServices">
      <GetSpeechResult>
        &lt;SPEECH&gt;&lt;PLAY&gt;JULIUS CAESAR&lt;/PLAY&gt;
        &lt;SPEAKER&gt;CAESAR&lt;/SPEAKER&gt;Cowards die many times
        before their deaths; The valiant never taste of death but 
        ...&lt;/SPEECH&gt;
      </GetSpeechResult>
    </GetSpeechResponse>
  </soap:Body>
</soap:Envelope>

Very nice again. My first SOAP 1.2 test with SocketRequestResponseBinary.pl worked correctly.

The SOAP response message received as a single line without any line breaks. I reformatted it before including it here.

Table of Contents

 About This Book

 Introduction to Web Service

 Introduction to SOAP (Simple Object Access Protocol)

 SOAP Message Structure

 SOAP Message Transmission and Processing

 SOAP Data Model

 SOAP Encoding

 SOAP RPC Presentation

 SOAP Properties Model

 SOAP MEP (Message Exchange Patterns)

 SOAP HTTP Binding

 SOAP PHP Implementations

 PHP SOAP Extension Client Programs

 PHP SOAP Extension Server Programs

 PHP SOAP Web Service Example - getTemp

 SOAP Perl Implementations

 Perl SOAP::Lite - SOAP Server-Client Communication Module

 Perl Socket Test Program for HTTP and SOAP

 Perl SOAP::Lite for NumberToWords SOAP 1.1 Web Service

 Perl SOAP::Lite for SOAP 1.2 Web Services

 Perl SOAP::Lite for WSDL

 Python SOAP Client: Zeep

 SOAP Java Implementations

 Java Socket and HttpURLConnection for SOAP

 SAAJ - SOAP with Attachments API for Java

 SoapUI - SOAP Web Service Testing Tool

 WS-Security - SOAP Message Security Extension

 WS-Security X.509 Certificate Token

 Perl SOAP::Lite for GetSpeech SOAP 1.1 Web Service

 Perl SOAP::Lite 0.710 for SOAP 1.2 Web Services

 Perl SOAP::Lite 0.710 for WSDL

 Web Services and SOAP Terminology

Archived Tutorials

 Archived SOAP::Lite 0.55 in ActivePerl 5.8.7

 Archived: SOAP 1.1 Request - Content-Length Too Small

 Archived: SOAP 1.1 Request - Content-Length Too Large

 Archived: SOAP 1.1 Request and Response of GetSpeech

Archived: SOAP 1.2 Request and Response of GetSpeech

 Archived: Calling GetSpeech SOAP 1.1 with SAAJ

 Archived: Calling GetSpeech SOAP 1.2 with SAAJ

 References

 Full Version in PDF/EPUB