Dear Monks,
Y have read as much as can about this problem and can't find a solution to it. Hope I can explain it clearly. I'm consuming a web service on .Net server. And they have the following request format for there service.
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope ...>
<soap:Body>
<getStamp xmlns="http://tempuri.org/">
...XML FILE...
</getStamp>
</soap:Body>
</soap:Envelope>
When I execute my code to consume the service SOAP::Lite generates the following request XML.
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope ...>
<soap:Body>
<getStamp xmlns="http://tempuri.org/">
<c-gensym2>
...XML FILE...
</c-gensym2>
</getStamp>
</soap:Body>
</soap:Envelope>
The section of code that produces the above XML is:
$client = SOAP::Lite
-> proxy($endpoint);
$client->soapversion('1.1');
$client->on_action(sub {"http://tempuri.org/getStamp"});
$client->autotype(0);
$client->default_ns($namespace);
$res = $client->getStamp($xml_file);
If I rewrite the call to
$method = SOAP::Data->name('getStamp')->attr({xmlns => $namespace});
$res = $client->call('getStamp',
SOAP::Data->name('getStamp')->attr({xmnls => $namespace})->value($xml_
+file)
);
Then the the request XML becomes this
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope ...>
<soap:Body>
<getStamp xmlns="http://tempuri.org/">
<getStamp xmlns="http://tempuri.org/">
...XML FILE...
</getStamp>
</getStamp>
</soap:Body>
</soap:Envelope>
So. If I add a Data name, the gensym tag is removed but now I have an extra getStamp tag.
If I understand this, apparently SOAP::Lite enforces the use of a variable name after the Method name tag (if I interpret the XML correctly). If I do not explicitly set one it adds the gensym tag. In any case I end up with an extra tag all the time (generic or named)
The options I'm seeking help for are:
1) If there is a way to tell SOAP::Lite that I have a method call with no parameter name? or
2) A way to parse the soap envelope before sending it to the web service and remove those tags my self.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.