Subject: | Missing XML declaration in request [patch] |
The XML generated by SOAP::WSDL::Serializer::XSD does not include a declaration at the start.
Some web services will not accept requests without a declaration.
W3C recommendation states "XML documents should begin with an XML declaration which specifies the version of XML being used."
See: http://www.w3.org/TR/xml/#sec-prolog-dtd
The attached patch adds a declaration to the generated XML.
Subject: | add_xml_declaration.diff |
--- SOAP/WSDL/Serializer/XSD.pm.orig 2013-06-11 12:31:19.000000000 +0100
+++ SOAP/WSDL/Serializer/XSD.pm 2013-06-14 11:45:11.000000000 +0100
@@ -30,7 +30,7 @@
my $soap_prefix = $opt->{ namespace }->{ $SOAP_NS };
# envelope start with namespaces
- my $xml = "<$soap_prefix\:Envelope ";
+ my $xml = qq|<?xml version="1.0" ?><$soap_prefix\:Envelope |;
while (my ($uri, $prefix) = each %{ $opt->{ namespace } })
{