Thread

Posted on Sun Aug 24 07:54:32 2008 by butchie
how to add namespace to envelope
Hello all,
I need to add a namespace to the envelope,
namely
xmlns:xsd="http://www.w3.org/2001/XMLSchema",
but I don't have a clue as to how to add this.
I've used wsdl2perl.pl to set up my program (wonderful tool, by the way. It has helped me learn faster than otherwise).

Also, I noticed, when I trace the outbound SOAP call, that
the typical <?xml version="1.0" encoding="utf-8" ?> is not there.
I think one of the servers that I'm trying to access is not responding because it's not there.
How do I make sure it's there at the beginning?
I tried
$soap->set_content_type('application/xml; charset: utf8');
but that didn't seem to make a difference.

Thanks,
butchie
Direct Responses: 8660 | Write a response
Posted on Sun Aug 24 09:19:41 2008 by mkutter in response to 8659
Re: how to add namespace to envelope
hi butchie,
Unfortunately, SOAP::WSDL's XML serializer doesn't give you fine grained control over namespaces right now, so the only way is to write your own serializer class. That's not really difficult - you'll need to write something similar to SOAP::WSDL::Serializer::XSD and put the relevant information into the envelope.
Then, all you need to do is to register your new serializer class with SOAP::WSDL::Factory::Serializer (see the man page on how to do that).

Martin
Write a response