Calling GetSpeech SOAP 1.1 Web Service

This section provides a tutorial example on how to run HttpURLConnectionGetSpeech11.java to call the GetSpeech SOAP 1.1 Web service provided by xmlme.com.

After reviewed the HTTP request generated from HttpURLConnectionGetSpeech11.java with my socket server test program, I want to try it with the real server at xmlme.com now.

\herong>java HttpURLConnectionGetSpeech11
   http://www.xmlme.com/WSShakespeare.asmx
   soap_1_1_GetSpeech_req.xml res.xml

Request length: 384
Response length: 1942

\herong>type res.xml
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/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;HAMLET&lt;/PLAY&gt;
        &lt;SPEAKER&gt;HAMLET&lt;/SPEAKER&gt;To be, or not to be: that
        is the question: Whether 'tis nobler in the mind to suffer
        ...&lt;/SPEECH&gt;
      </GetSpeechResult>
    </GetSpeechResponse>
  </soap:Body>
</soap:Envelope>

This confirms that my HttpURLConnectionGetSpeech11.java works perfectly.

Last update: 2009.

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 Message Exchange Patterns

 SOAP HTTP Binding

 SOAP Perl Implementations

 SOAP PHP Implementations

 SOAP Java Implementations

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

 Perl Socket Test Program for HTTP and SOAP

 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

 PHP SOAP Extension Client Programs

 PHP SOAP Extension Server Programs

Java Socket and HttpURLConnection for SOAP

 SocketRequestResponse.java - Socket Client Testing Program

 SocketRequestResponseServer.java - Socket Server Testing Program

 Capturing the HTTP Request from a Browser

 "read(byteBuf) = -1" Not Working

 Using java.net.HttpURLConnection to Send SOAP Messages

 Using HttpURLConnection to Call GetSpeech SOAP 1.1

 Capturing HTTP Request Generated by the HttpURLConnection Class

Calling GetSpeech SOAP 1.1 Web Service

 Using HttpURLConnection to Call GetSpeech SOAP 1.2

 Calling GetSpeech SOAP 1.2 Web Service

 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

 Web Services and SOAP Terminology

 References

 PDF Printing Version