Herong's Tutorial Notes on Web Service and SOAP
Dr. Herong Yang, Version 4.00

Features in SOAP::Lite 0.710

This section provides a tutorial example on how to use the SOAP::Data class to build the request parameter element with correct element name and a namespace. My first SOAP::Lite program works now with the GetSpeech Web service.

By reading the manual, SOAP::Lite 0.710 seems to be quite different than SOAP::Lite 0.55:

  • Package name has been changed to "SOAP::Lite - Perl's Web Services Toolkit" from "SOAP::Lite - Client and server side SOAP implementation".
  • Old uri() function is deprecated. ns() or default_ns() should be used instead of uri().
  • New soapversion() function is introduced to support SOAP 1.2.
  • New send_receive() function is introduced to support generic SOAP messages.
  • SOAP::Lite features support for the SOAP with Attachments specification now.

SOAP::Lite 0.710 manual also gives example codes to support 4 different SOAP message styles:

  • rpc/encoded - Typed, positional parameters. Widely used in scripting languages. The type of the arguments is included in the message. Arrays and the like may be encoded using SOAP encoding rules (or others).
  • rpc/literal - As-is, positional parameters. The type of arguments is defined by some pre-exchanged interface definition.
  • document/encoded - Specified message with typed elements. Rarely used.
  • document/literal - Specified message with as-is elements. The message specification and element types are defined by some pre-exchanged interface definition. Becoming the predominant SOAP message style.

Last update: 2009.

Sections in This Chapter

Installing SOAP::Lite 0.710 to Support SOAP 1.2

Features in SOAP::Lite 0.710

Methods on SOAP::Lite 0.710 Client Object

Testing SOAP::Lite Client Objects

Request Differences between SOAP 1.1 and SOAP 1.2

GetSpeech_localhost.pl - Testing GetSpeech on Local Host

soapversion('1.2') and envprefix('soap12') Must Used Together

default_ns() - Setting Default namespace for Body Elements

SOAP::Data - Utility Class to Generate XML Elements

SOAPAction - Not Needed, But No Way to Remove It

Unsupported Media Type: "application/soap"

DEFAULT_HTTP_CONTENT_TYPE='application/soap+xml'

content_type() method in the HTTP::Headers Class

GetSpeech_SOAP_1_2.pl - SOAP::Lite for SOAP 1.2 Web Service

Dr. Herong Yang, updated in 2009
Features in SOAP::Lite 0.710