MidLifeXis has asked for the wisdom of the Perl Monks concerning the following question:
I am having a hard time with sending SOAP / .NET "complex" structures. If I send the following response, my .NET (well, .NET WebServiceStudio) does not recognize the response -- it comes back with a "null" as the value of the string.
<?xml version="1.0" encoding="utf-16"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" x +mlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="h +ttp://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.x +mlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soa +p/envelope/"> <soap:Body> <Test1Response xmlns="urn:TESTServices"> <OutData xsi:type="typens:MyStringType" xmlns:typens="urn:TESTSe +rvices"> <MyStringType xsi:type="xsd:string">Hi There</MyStringType> </OutData> </Test1Response> </soap:Body> </soap:Envelope>
If I hardcode the return string to the above, I get the same response. However, if I change the attributes on the "Test1Response" tag above to be <namesp1:Test1Response xmlns:namesp1="urn:TESTServices">, all works fine.
<?xml version="1.0" encoding="utf-16"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" x +mlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="h +ttp://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.x +mlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soa +p/envelope/"> <soap:Body> <namesp1:Test1Response xmlns:namesp1="urn:TESTServices"> <OutData xsi:type="typens:MyStringType" xmlns:typens="urn:TESTSe +rvices"> <MyStringType xsi:type="xsd:string">Hi There</MyStringType> </OutData> </namesp1:Test1Response> </soap:Body> </soap:Envelope>
My function in my handler is:
sub Test1 { my $self = shift; my $envelope = pop; my $indata = $envelope->valueof('/Envelope/Body/*/InData'); my $d= ( SOAP::Data ->name( 'OutData' => \SOAP::Data ->value( SOAP::Data->name('MyStringType' => 'Hi There') ) ) ->attr({ 'xmlns:typens' => 'urn:TESTServices', 'xsi:type' => 'typens:MyStringType', }, ) ); return $d; }
Does anyone have a good example of how to add the explicit namespace tag to the service name (the first child of the Body tag) using SOAP::Lite? I am not specifying the tag, I think it is supplied by SOAP::Lite.
Thanks,
update: Missed name space on closing tag.
--MidLifeXis
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: SOAP::Lite, .NET, and complex structures
by szbalint (Friar) on Aug 09, 2007 at 06:32 UTC | |
by MidLifeXis (Monsignor) on Aug 09, 2007 at 16:42 UTC | |
|
Re: SOAP::Lite, .NET, and complex structures
by erroneousBollock (Curate) on Aug 10, 2007 at 05:06 UTC | |
by MidLifeXis (Monsignor) on Aug 10, 2007 at 14:20 UTC | |
by erroneousBollock (Curate) on Aug 11, 2007 at 04:12 UTC | |
by MidLifeXis (Monsignor) on Aug 15, 2007 at 15:26 UTC | |
by erroneousBollock (Curate) on Aug 16, 2007 at 04:38 UTC | |
| |
|
Re: SOAP::Lite, .NET, and complex structures
by ForgotPasswordAgain (Vicar) on Aug 09, 2007 at 07:40 UTC |