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

  • SEARCH
  • Home
  • 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 6554943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:45:36+00:00 2026-05-25T12:45:36+00:00

So here’s my SOAP::Lite code #!/usr/bin/perl use 5.006; use strict; use warnings; use SOAP::Lite

  • 0

So here’s my SOAP::Lite code

#!/usr/bin/perl
use 5.006;
use strict;
use warnings;
use SOAP::Lite +trace => [ 'debug' ];

my $req1 = SOAP::Lite->new(
    readable => 1,
    autotype => 0,
    proxy    => 'https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor',
);

$req1->requestMessage(
    \SOAP::Data->new(
        name => 'item',
        attr => { foo => '0' },
        value => \SOAP::Data->new(
            name => 'foo',
            value => 1,
        ),
     ),
);

It generates this XML

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<requestMessage>
  <c-gensym9>
    <item foo="0">
      <foo>1</foo>
    </item>
  </c-gensym9>
</requestMessage>
</soap:Body>
</soap:Envelope>

How can I generate the same thing (without the gensym’s) using XML::Compile::SOAP?

  • 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-25T12:45:36+00:00Added an answer on May 25, 2026 at 12:45 pm

    Try

    cpan BERLE/SOAP-Simple-0.00_03.tar.gz
    

    then

    #!/usr/bin/perl --
    use strict; use warnings;
    use Data::Dumper;
    use SOAP::Simple;
    my $wsdlfile = '...';
    my $soap = SOAP::Simple->new($wsdlfile);
    print Dumper(
        $soap->requestMessage(
            item => [
                { foo => 1  },
            ],
        )
    );
    

    or see http://cpansearch.perl.org/src/MARKOV/XML-Compile-SOAP-2.24/t/53wsdlrpclit.t and copy http://cpansearch.perl.org/src/MARKOV/XML-Compile-SOAP-2.24/t/examples/rpc-literal/element.pl and use

    schema2example -s element.wsdl -s type.wsdl -x requestMessage.xml
    

    to generate a %request for element.pl, so in the end you end up with something like

    #!/usr/bin/perl
    use warnings;
    use strict;
    
    # general debugging of XML::Compile modules
    #~ use Log::Report mode => 3;
    
    # Data::Dumper is your friend in understanding the answer
    use Data::Dumper;
    $Data::Dumper::Indent = 1;
    
    # The features we use
    use XML::Compile::WSDL11;
    use XML::Compile::SOAP11;
    use XML::Compile::Transport::SOAPHTTP;  # we fake an HTTP server
    
    #
    # During initiation 'compile time'
    #
    
    my $wsdl = XML::Compile::WSDL11->new('element.wsdl');
    my $call = $wsdl->compileClient('using_element'
    #~   , transport_hook => \&fake_server # hook simulates a remote server at test
      );
    
    #
    # Reuse often at 'run time'
    #
    
    my %request =
     ( item =>
       [ { foo => 1}
       ]
     );
    
    my $answer = $call->( requestMessage => \%request);
    
    # Useful for debugging.  Also useful to report to syslog
    #    my ($answer, $trace) = $call->(\%request);
    #    $trace->printTimings;
    
    # When you do not know how the answer is structured
    #print Dumper $answer;
    
    if($answer->{Fault})
    {   print "Oops\n";
    }
    else
    {   print "*** RESULT=$answer->{answer_via_element}{result}\n";
    }
    
    exit 0;
    

    Once you’re generating the xml you want, try it live

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

here are 2 screen shots when i try to debug my code in visual
Here a simple question : What do you think of code which use try
Here is my code, which takes two version identifiers in the form 1, 5,
Here is my code...I have two dimensional matrices A,B. I want to develop the
Here is my code sample, let me know if it can be further improved?
Here is my code (Say we have a single button on the page that
Here is my code: <?php $variable1 = 00001; $variable2 = (sprintf('%04d', $variable1 + 1));
Here's my code: x = 1.0 y = 100000.0 print x/y My quotient displays
Here's my situation. I've noticed that code gets harder to maintain when you keep
Here's my code: // Not all headers are relevant to the code snippet. #include

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.