I was mistakenly blaming Perl for my problem. It seems that the real cause lies within the XML generated by the SOAP call:
<?xml version="1.0" encoding="UTF-8"?>
<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><loadPathwayForId><identifier xsi:type="xsd:i
+nt">68886</identifier></loadPathwayForId></soap:Body></soap:Envelope>
I just have to somehow get xsi:type to say "xsd:long" instead of "xsd:int". | [reply] [d/l] |
demo for xsd:long, how soap::lite guesses and how to overcome with strings
My soap tips (I hate soap), SOAP::Lite is too much work, SOAP::Simple is less work (but its simple, when stuck go to XML::Compile::SOAP, more verbose, but you want verbose with SOAP ) ... its built on XML::Compile::SOAP/http://perl.overmeer.net/xml-compile/#doc , see my treasure trove of soap examples and lost knowledge,$soap->transport->add_handler("request_send", \&pp_dump );, http://cookbook.soaplite.com/, SOAP endpoint , Re^3: SOAP::Lite login setup, Re: I do not understand how to write a SOAP server., An XML Overview Towards Understanding SOAP, Re^3: SOAP::Lite and custom envelopes, The XML FIles: Understanding XML Namespaces, How to Call a .NET-based Web Service Using the SOAP::Lite Perl Library (don't use XML::Compile )
| [reply] [d/l] |
Thanks for the thorough reply!
I used SOAP::Data -> name(identifier => $identifier ) -> type('xsd:long'); and obliterated the type error.
Unfortunately, now it seems I'm getting another error from SOAP::Lite when the returned XML is too long... I am stuck with SOAP since that is the only way for me to retrieve the data I want. I'll check out the other SOAP modules that you proposed, maybe they will better handle large amount of data!
| [reply] |
It wants bytes as long (int64) type. Giving it sprintf '%09x', 12; gives me the error org.xml.sax.SAXException: Bad types (class java.lang.String -> long). Similarly, when I give it a number that can be represented as int32 (not big enough for int64), it gives org.xml.sax.SAXException: Bad types (int -> long). | [reply] |
It wants bytes as long (int64) type. But that isn't bytes, it doesn't say byte order (little or big endian). Have you see pack? pack'q<', $d64
pack 'q>', $d64
| [reply] |
Thanks for the suggestions, really appreciate it! I've tried using pack but the returned data type still doesn't match that required by the web service, regardless of byte order. I get the error org.xml.sax.SAXException: Bad types (class [B -> long).
So far, the only case where I don't receive the "Bad types" error is when I supply an integer greater than 2,147,483,647, which is the maximum value of a 32int. It seems that Perl is dynamically assigning the size of the integer depending on the value and I have no control over it. The web service, on the other hand, is in Java, and doesn't seem to accept anything other than the long that it demands!
I guess I will explore other options to avoid this challenge.
| [reply] |