NumberToWords Failed - Unexpected Parameter "c-gensym3"

This section provides a tutorial example on how to use a SOAP::Lite client to reach a Web service end point with the proxy parameter. But the test failed with an error: Unexpected parameter 'c-gensym3'.

In previous SOAP::Lite tutorials, we learned how to create a simple dummy SOAP server, create a simple SOAP client and make them work together.

Now let's try to write a SOAP::Lite client program to talk to a real Web service, NumberToWords, provided at NumberToWords returns the word corresponding to the positive number passed as parameter.

Based on the above description I wrote my first version of

#- Copyright (c) 2005 All Rights Reserved.
   use SOAP::Lite +trace;
   my $client = SOAP::Lite->new();
   my $som = $client->NumberToWords(101);
   my $output = $som->result;
   print $output . "\n";

When executed, I got this:


SOAP::Transport::new: ()
SOAP::Serializer::new: ()
SOAP::Deserializer::new: ()
SOAP::Parser::new: ()
SOAP::Lite::new: ()
SOAP::Transport::HTTP::Client::new: ()
SOAP::Lite::call: ()
SOAP::Serializer::envelope: ()
SOAP::Serializer::envelope: NumberToWords 101
SOAP::Data::new: ()
SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x2eafea0)
   POST ...
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 443
Content-Type: text/xml; charset=utf-8
SOAPAction: "#NumberToWords"

<?xml version="1.0" encoding="UTF-8"?>
            <c-gensym3 xsi:type="xsd:int">101</c-gensym3>

SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x2ad6770)
   HTTP/1.1 500 Internal Server Error

Cache-Control: private, max-age=0
Connection: close
Server: Microsoft-IIS/8.0
Content-Length: 348
Content-Type: text/xml; charset=utf-8
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: content-type
Access-Control-Allow-Methods: GET, POST
Client-Response-Num: 1
Strict-Transport-Security: max-age=31536000
Web-Service: DataFlex 18.1

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="">
        <faultstring>Error processing request: 
        Unexpected parameter 'c-gensym3'</faultstring>
SOAP::Deserializer::deserialize: ()
SOAP::Parser::decode: ()
SOAP::SOM::new: ()

Obviously, the Web service server failed with a "HTTP/1.1 500 Internal Server Error". It was actually caused by an exception in the Web service process: "Error processing request: Unexpected parameter 'c-gensym3'".

The issue is obvious. The server is expecting the parameter to be named as "ubiNum". But Perl SOAP::Lite is sending "c-gensym3". I will try to fix the issue 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

NumberToWords Failed - Unexpected Parameter "c-gensym3"

 NumberToWords Failed - Invalid namespace ""

 NumberToWords Worked - Setting Namespace and Parameter

 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


 Full Version in PDF/EPUB