any tricks to sending XML to .NET web service?

J

jims

I'm trying to use SOAP::Lite to send an XML argument to a .NET web
method that looks like this:

POST /solsat/Default.asmx HTTP/1.1
Host: www.clean-power.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction:
"http://www.clean-power.com/solsat/PutSatelliteInsolationData"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<PutSatelliteInsolationData xmlns="http://www.clean-power.com">
<insolationData>
<xsd:schema>schema</xsd:schema>xml</insolationData>
</PutSatelliteInsolationData>
</soap:Body>
</soap:Envelope>

I've gotten a method under the same service to work fine -- that method
only takes a simple string as input. So I've got all the usual
SOAP::Lite -> .NET snags worked out.

But when I put XML in between the argument tags <insolationData> and
</insolationData> I get all kinds of problems. At first blush it
looked as though SOAP::Lite encoding of the outgoing XML was causing
problems (i.e., '<' gets transmitted as '&lt;') but I'm not sure that's
a problem.

I disabled the encode_data() sub in Lite.pm and tried it that way. But
clearly .NET is parsing the XML when I send it unencoded. At what
level that parsing is taking place, I don't know. If I send (what
appears to be) well formed XML to the service I get back the "Object
reference not set to an instance of an object" error. Which is little
help. But perhaps this means that the XML argument string *is* getting
through but just doesn't parse.

I don't have access to the web service code -- it's a black box to me.


Has anybody had troubles *sending* XML as a web service argument from
SOAP::Lite?

Thanks,

-jim
 
M

Mark Clements

jims said:
I'm trying to use SOAP::Lite to send an XML argument to a .NET web
method that looks like this:

POST /solsat/Default.asmx HTTP/1.1
Host: www.clean-power.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction:
"http://www.clean-power.com/solsat/PutSatelliteInsolationData"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<PutSatelliteInsolationData xmlns="http://www.clean-power.com">
<insolationData>
<xsd:schema>schema</xsd:schema>xml</insolationData>
</PutSatelliteInsolationData>
</soap:Body>
</soap:Envelope>

I've gotten a method under the same service to work fine -- that method
only takes a simple string as input. So I've got all the usual
SOAP::Lite -> .NET snags worked out.

But when I put XML in between the argument tags <insolationData> and
</insolationData> I get all kinds of problems. At first blush it
looked as though SOAP::Lite encoding of the outgoing XML was causing
problems (i.e., '<' gets transmitted as '&lt;') but I'm not sure that's
a problem.

I disabled the encode_data() sub in Lite.pm and tried it that way. But
clearly .NET is parsing the XML when I send it unencoded. At what
level that parsing is taking place, I don't know. If I send (what
appears to be) well formed XML to the service I get back the "Object
reference not set to an instance of an object" error. Which is little
help. But perhaps this means that the XML argument string *is* getting
through but just doesn't parse.

You'll need to post some code. There may be something you can do with
SOAP::Data to get it to play nice. What happens when you use another
client (eg .NET or Java) to send the same data?

Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top