Hi fellow monks,

I'm writing a soap server using Apache::SOAP (part of SOAP::Lite).
The SOAP server provides an interface to a method DomainCheck->Check($domain) which performs various checks on a domain name. Check() returns an anon hash: { error => $int, severity => $int, text => $string }

It works great with a SOAP::Lite client but .Net clients are confused by the xml sent back by the server.

Here's my Apache::SOAP config in httpd.conf:

<Location /DomainCheck> SetHandler perl-script PerlHandler Apache::SOAP PerlSetVar dispatch_to "DomainCheck" </Location>
A simple perl client:
#!/usr/bin/perl use strict; use SOAP::Lite; my $proxy = "https://10.191.110.64:8443/DomainCheck"; my $uri = "http://10.191.110.64/DomainCheck"; my $soap = SOAP::Lite->uri($uri)->proxy($proxy); $soap->on_debug(sub{print@_}); my $result = $soap->Check("perl.com");
Here's the xml sent by the perl client:
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instanc +e" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:S +OAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http:/ +/www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xm +lsoap.org/soap/encoding/"> <SOAP-ENV:Body> <namesp1:Check xmlns:namesp1="http://10.191.110.64/DomainCheck"> <c-gensym3 xsi:type="xsd:string">perl.com</c-gensym3> </namesp1:Check> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
and the xml sent back by the server:
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instanc +e" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:S +OAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http:/ +/www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xm +lsoap.org/soap/encoding/"> <SOAP-ENV:Body> <namesp7:CheckResponse xmlns:namesp7="http://10.191.110.64/DomainC +heck"> <s-gensym27> <text xsi:type="xsd:string">Valid Domain</text> <error xsi:type="xsd:int">0</error> <severity xsi:type="xsd:int">0</severity> </s-gensym27> </namesp7:CheckResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
What confuses the .net client is mainly the <s-gensym27> tag and the <namesp7> namespace. I have no idea where these tags come from, and why the number after them seem random (they change after each call)

Anyhow, here's what a .net client would expect:

<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <CheckResponse xmlns="http://snoogen/DomainCheck"> <severity>0</severity> <error>0</error> <text>ok</text> </CheckResponse> </soap:Body> </soap:Envelope>
Is there a way to make Apache::SOAP generate .net-friendly SOAP messages?

Cheers,
theblop.


In reply to .net-friendly soap messages with Apache::SOAP by theblop

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.