Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 467257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:33:45+00:00 2026-05-12T23:33:45+00:00

I am attempting to access a web service using SOAP through Perl and am

  • 0

I am attempting to access a web service using SOAP through Perl and am having issues calling the service’s functions that require parameters. The XSD that dictates the SOAP call says,

<xs:complexType name="getVersion"> 
<xs:sequence/> 
</xs:complexType> 
<xs:complexType name="getVersionResponse"> 
<xs:sequence> 
<xs:element minOccurs="0" name="return" type="xs:string"/> 
</xs:sequence> 
</xs:complexType>
...
<xs:complexType name="enumerateEntities"> 
<xs:sequence> 
<xs:element name="entityId" type="xs:int"/> 
<xs:element minOccurs="0" name="entityType" type="tns:entityType"/> 
</xs:sequence> 
</xs:complexType> 
<xs:complexType name="enumerateEntitiesResponse"> 
<xs:sequence> 
<xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:int"/> 
</xs:sequence> 
</xs:complexType> 

According to the docs for the service, the signatures for the two functions are:

String getVersion ()
int[] enumerateEntities (int entityId, EntityType entityType)

I am able to call the first function, which requires no input parameters, using:

#!/usr/bin/perl

use SOAP::Lite;
my $uri = 'http://wsdl.mydomain.com/';
my $service = SOAP::Lite
 -> uri($uri)
 -> on_action(sub { sprintf '"Call by on_action: %s"',shift})
 -> proxy('http://192.168.1.100:8688/MyService/services/MyService.MyServicePort/');

$method = SOAP::Data->name("MyService")->attr({xmlns => $uri});
$getVersion = SOAP::Data->name("getVersion")->attr({xmlns=>$uri});#line 11
my $theResult = $service->getVersion;

unless ($theResult->fault){ print "Version: "; print $theResult->result;}
else {print $theResult->faultstring;}

…but my attempt (below) at calling a function with parameters by changing line 11 on have been futile.

...
@entityId = SOAP::Data->type('int')->name('entityId')->value(0);
@entityType = SOAP::Data->type('EntityType')->name('entityType')->value(NODE);
$enumerateEntities = SOAP::Data->name("enumerateEntities",@entityId,@entityType)->attr({xmlns=>$uri});
my $result2 = $service->enumerateEntities;
print $result2->result;

What am I doing wrong that is preventing me from calling functions of the service with parameters?


Edit:
Here’s the updated sample code with using SOAP::WSDL

#!/usr/bin/perl

use SOAP::WSDL;
use Data::Dumper;

my $service = SOAP::WSDL->new(
   wsdl => 'http://192.168.1.100:8688/MyService/services/MyService.MyServicePort?wsdl',
   outputhash => 1
);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T23:33:45+00:00Added an answer on May 12, 2026 at 11:33 pm

    Use SOAP::WSDL to consume the service wsdl, it also marshals from and (optionally) to plain perl data structures for you. Highly recommended module.

    Something like the following:

    use SOAP::WSDL;
    use Data::Dumper;
    
    my $soap = SOAP::WSDL->new(
      wsdl => 'http://server/pathtoservice?WSDL',
      outputhash => 1
    );
    my $res = $soap->call('method', { foo => 1, bar =>2 });
    die $res->faultstring if $res->fault;
    print Dumper($res->result);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to add BASIC authentication to a RESTful web service that I
I am attempting to set up a web service that uses windows authentication and
I'm attempting to access MS CRM that's exposed via IFD, and I'm having authentication
I am using netTcpBinding to try and access a WCF service. The ASP.NET web
I'm attempting to create Data Access Layer for my web application. Currently, all datatables
Am interoping a c++ dll and am attempting to access it's functions. Below is
I am attempting to test a WCF web service I'm developing by accessing it
I am building an ASP.NET web service that will be used internally in my
I am attempting to consume an intranet web service with WCF. I added reference
I am attempting to use PHP and cURL to: Access a web-form & maintain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.