Hi all,

I would like to develop a Perl Web CLient consuming Web Service made in Java (apache CFX).

THe Web Server produces WSDL in localhost.

I have two questions:
1. Are there ways other than SOAP that I can use to develop this Web Client?
2. I have tried using SOAP::Lite.
The Web Service (WSDL) has operation called Hello which accept input(input:Hello) and output the input(output:HelloResponse).

Here is my Perl code:

Expected: Input: Jimmy Output: Jimmy
$svc = SOAP::Lite -> service('http://localhost:8000/Hello.wsdl') -> proxy('http://localhost:8000/Hello') -> on_action(sub {sprintf '%s/%s', @_}); $resp = $svc->Hello("Jimmy");

However, this code will produce empty result.
Executing "print $resp" produces empty result.

I have tried using SOAP::Data as below:
<readmore title ="See the code"> $resp = $svc->call(SOAP::Data->name('Hello') ->attr ({'xmlns'=>'sth'}) => SOAP::Data->name('')->value("Jimmy"));


But this results in extra tags
<Hello xmlns="sth"><c-gensym3>Jimmy</c-gensym3></Hello>
which again resulted in empty final result:
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xsi=htt +p://www.w3.org/1999/XMLSchema-instance xmlns:SOAP-ENC=http://schemas. +xmlsoap.org/soap/encoding/ xmlns:SOAP-ENV="http://schemas.xmlsoap.org +/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-EN +V:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV +:Body><Hello xmlns="sth"><c-gensym3>Jimmy</c-gensym3></Hello></SOAP-E +NV:Body></SOAP-ENV:Envelope>
[download]


What i would like to have is:
<Hello xmlns="sth">Jimmy</Hello>
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xsi=htt +p://www.w3.org/1999/XMLSchema-instance xmlns:SOAP-ENC=http://schemas. +xmlsoap.org/soap/encoding/ xmlns:SOAP-ENV="http://schemas.xmlsoap.org +/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-EN +V:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV +:Body><Hello xmlns="sth">Jimmy</Hello></SOAP-ENV:Body></SOAP-ENV:Enve +lope>
[download]


Do you know how to remove the tags <c-gensym3> entirely?

Could you please help me in solving this issue?

Thank you very much

In reply to Perl Web Service by bubles_88

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.