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

Perl SOAP::Lite 0.710 for SOAP 1.2 Web Services

This chapter provides tutorial examples and notes on using SOAP::Lite for SOAP 1.2 Web services. Topics include installing SOAP 7.10; testing methods available on client objects; using soapversion() and envprefix() to generate SOAP 1.2 requests; using default_ns() to set default namespace; using DEFAULT_HTTP_CONTENT_TYPE constant to fix content type header line.

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

Conclusions:

  • SOAP::Lite does support SOAP 1.2 protocol.
  • envprefix('soap12') must be called to provide correct SOAP 1.2 envelope namespace.
  • SOAPAction header line is not needed in SOAP 1.2. But there is no easy way to remove it.
  • "application/soap+xml" is the required media type in the Content-Type header line for SOAP 1.2.

Dr. Herong Yang, updated in 2009
Perl SOAP::Lite 0.710 for SOAP 1.2 Web Services