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:
A simple perl client:<Location /DomainCheck> SetHandler perl-script PerlHandler Apache::SOAP PerlSetVar dispatch_to "DomainCheck" </Location>
Here's the xml sent by the 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");
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> <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>
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)<?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>
Anyhow, here's what a .net client would expect:
Is there a way to make Apache::SOAP generate .net-friendly SOAP messages?<?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>
Cheers,
theblop.
In reply to .net-friendly soap messages with Apache::SOAP by theblop
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |