SOAP::Lite <-> JBoss Interoperability : changing default encoding of HASH refs from SOAP-Structs

Jim Cromie <[email protected]> Wed, 2 Apr 2003 14:47:18 -0700
Newsgroups gmane.comp.windows.devel.soap.general
Message-ID <[email protected]>
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.

===================================
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