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
In reply to SOAP::Lite, .NET, and complex structures by MidLifeXis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |