soapversion('1.2') Sets Correct Envelope namespace

This section provides a tutorial example on how to use soapversion('1.2') to tell service() to use the correct namespace for the Envelope.

From previous tutorial, I learned that the service() function uses SOAP 1.1 by default and it put the wrong namespace to the Envelope. Now let me force it to use SOAP 1.2 and see what happens:

#- Copyright (c) All Rights Reserved.
#- All rights reserved
   use SOAP::Lite +trace;
   my $client = SOAP::Lite->new()
#- Overriding the constant for SOAP 1.2
      = 'application/soap+xml';

   $client->GetSpeech('To be, or not to be');

Result of

POST http://localhost/soap11 HTTP/1.1
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 831
Content-Type: application/soap+xml; charset=utf-8
SOAPAction: ""

<?xml version="1.0" encoding="UTF-8"?>
      <Request xsi:type="s:string">To be, or not to be</Request>
500 Can't connect to localhost:80 (connect: Unknown error)

Note that:

The request looks good to me now. I will try it with the real Web service server at in the next tutorial.

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

 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

 First WSDL Test Failed with SOAP::Lite

 Downloading and Editing WSDL Document

 Testing service() Function Locally

soapversion('1.2') Sets Correct Envelope namespace

 Error: Object reference not set to an instance of an object

 Web Services and SOAP Terminology

 Outdated Tutorials


 Full Version in PDF/EPUB