SOAP::Lite <-> JBoss Interoperability : changing default encoding of HASH refs from SOAP-Structs
Duncan Cameron <[email protected]> Thu, 3 Apr 2003 13:46:10 +0000
| Newsgroups | gmane.comp.windows.devel.soap.general |
|---|---|
| Organization | At Home |
| Message-ID | <20030403124610.MHVD9882.mta02-svc.ntlworld.com@pavilion-8670> |
On 2003-04-03 Jim Cromie wrote:
>Ive got a stable and functional SOAP server under development which
>serves a JBOSS java client.
>
>early in the interop tests, we found that SOAP::Lite returns a
>soap-struct object for hashes,
>which caused JBOSS to toss cookies (ie an exception).
>
>Following perldoc, I reblessed all my return hashes with the following code,
>and everything worked after that..
>
>########
>sub mkmap {
> # in order to accommodate JBoss failure to handle SOAP-Structs
> # bless each hash in data-structure to a map.
> my $it = shift;
>
> if (ref $it eq 'HASH') {
> bless $it, 'map';
> foreach my $v (values %$it) {
> mkmap($v) if ref $v;
> }
> return $it;
> }
> elsif (ref $it eq 'ARRAY') {
> foreach my $item (@$it) {
> mkmap ($item) if ref $item;
> }
> return $it;
> }
>}
>
>
>BUT, THAT WAS THEN.
>
>Now that Ive started tossing exceptions, im getting the same
>interoperabilty problems,
>but without the same easy fix.
>
>
>I partly solved it by subclassing myError with 2 base-classes
>
>package myError;
>our @ISA = qw (Error map);
>
>but it doesnt descend into nested structures to convert HASHs to map's,
>I can prolly do that, but still...
>
>
>Is there a way to cause HASHes to be converted to Maps by default,
>instead of SOAP structs.
>
Jim
You're probably better off posting to the Yahoo SOAP::Lite list,
see this discussion of hashes to Java =>
http://groups.yahoo.com/group/soaplite/message/1742
Regards,
Duncan
===================================
This list is hosted by DevelopMentorĀ® http://www.develop.com
You may be interested in Guerrilla Web Services .NET, 14 April 2003, in Torrance, CA
http://www.develop.com/courses/gwsdotnet
View archives and manage your subscription(s) at http://discuss.develop.com