Loading ...
Sorry, an error occurred while loading the content.

3611RE: SOAP::Lite hash references

Expand Messages
  • Maurice McCabe
    May 27, 2004
    • 0 Attachment
      One suggestion is to patch the outgoing envelope to insert the xsi:type.
      This could be done by inheriting from the 'envelope' method and
      inserting at the appropriate place. See Alberto's serializer for an
      example of inheriting from 'envelope'. There may be other ways to patch
      the outgoing envelope.

      Maurice

      -----Original Message-----
      From: andrew_tfcc [mailto:andrew_tfcc@...]
      Sent: Thursday, May 27, 2004 8:12 AM
      To: Maurice McCabe
      Subject: Re: SOAP::Lite hash references


      Thanks for the response. The only problem is that in this situation,
      complex types cannot be built on the server side using the SOAP::Data
      constructor. Instead the function on the server only returns (and must
      return) a hash reference. Somehow I need SOAP::Lite to be able to give
      this a xsi:type when it serializes it. Is this possible?

      Thanks,
      Andrew


      --- In soaplite@yahoogroups.com, "Maurice McCabe" <mmccabe@o...> wrote:
      > I have used SOAP::Lite with Java (Axis SOAP toolkit). I have been able

      > to use it with Coldfusion MX which uses the Axis SOAP toolkit and it
      > works seamlessly. The same SOAP::Lite server will work with .NET and
      > Java. I am using a WSDL to connect and I am able to send complex
      > datatypes in either direction between the SOAP::Lite server and a Java

      > or .NET client.
      >
      > In my SOAP::Lite server implementation I have standardized on
      > 'document/literal' instead of 'rpc/encoded'. I am using Alberto's
      > serializer ( <http://ads.harvard.edu/~alberto/SOAP/>
      > http://ads.harvard.edu/~alberto/SOAP/)
      > and building any required complex types explicitly on the server side.

      > So for example to build what you are describing I would use something
      > like:
      >
      > SOAP::Data->name('getResponse' =>
      > \convertHashOfHashesToSOAP('myHashName', %myHash);
      >
      > where 'convertHashOfHashesToSOAP' might be implemented as something
      > like:
      >
      >
      > sub convertHashOfHashesToSOAP {
      > my ($myHashName, %myHash) = @_;
      > my @mySOAP;
      >
      > for my $myHashKey (keys %myHash) {
      > if isRef($myHashItem)
      >
      > push @mySOAP, SOAP::Data->name($myHashName =>
      > \SOAP::Data->value(SOAP::Data->name($myHashKey =>
      > \SOAP::value(convertHashOfHashesToSOAP($myHashKey, %{myHashItem})));
      > else
      > push @mySOAP, SOAP::Data->name($myHashName =>
      > \SOAP::Data->value(SOAP::Data->name($myHashKey =>
      $myHash($myHashKey));
      > }
      > return @mySOAP;
      > }
      >
      > sub isRef {
      > # not implemented (getting late)
      > }
      >
      > The WSDL has to be built for this. Then use wsdl2java to build the
      > java stubs (Coldfusion MX does this for you when you first invoke the
      > web service).
      >
      > Maurice
      >
    • Show all 3 messages in this topic