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

Re: [soaplite] (unknown)

Expand Messages
  • Duncan Cameron
    ... Try the map type: SOAP::Data- type(map = $hashref)- name( myhash ); With Apache SOAP, the Java deserializer will convert this to a hashtable (I think).
    Message 1 of 2 , Mar 29, 2002
      On 2002-03-29 loundry2000 wrote:
      >
      >Hello All,
      >
      >I am new to SOAP and I am developing a perl client to
      >communicate to a Java (AXIS) SOAP server using SOAP::Lite. The
      >immediate problem is how to get perl to send a hash and have Java
      >receive it as a HashTable object. Then the server can reply with a
      >HashTable object and have perl receive a hash. Does anyone know of any
      >good resources that cover this?
      >
      Try the 'map' type:

      SOAP::Data->type(map => $hashref)->name('myhash');
      With Apache SOAP, the Java deserializer will convert this to a hashtable (I think).
      AXIS might do the same.


      Regards,
      Duncan Cameron
    • Paul Kulchenko
      Hi John, ... Then you need to fix it on your side. You can update the empty value to something more reasonable: BEGIN { package MyDeserializer; use vars
      Message 2 of 2 , Oct 28, 2002
        Hi John,

        > Dublin refuses to change anything they've done. I'm stuck.
        Then you need to fix it on your side. You can update the empty value
        to something more reasonable:

        BEGIN {
        package MyDeserializer;
        use vars qw(@ISA); @ISA = 'SOAP::Deserializer';

        sub decode_object {
        my $attrs = $_[1]->[1];

        # search for the "bad" attribute and fix it
        for my $key (keys %$attrs) {
        $attrs->{$key} = "http://fix.org/FooBar" if $key =~ /:/ &&
        $attrs->{$key} eq '';
        }
        shift->SUPER::decode_object(@_);
        }
        }

        now register this new deserializer:

        my $soap = SOAP::Lite
        ...
        ->deserializer(MyDeserializer->new)
        ...

        and you should be okay. Just document the reasons for that hack ;)

        Best wishes, Paul.

        --- John Griffin <johng@...> wrote:
        > Thanks for replying Paul. Our server side code is maintained in
        > Dublin Ireland and I am responsible for writing client side example
        > code for our clients. Dublin defined a null for VB since that's
        > all it will work with. Java doesn't care and neither does PHP.
        > PERL, as you saw in the error message I sent, can't deserialize.
        > Dublin refuses to change anything they've done. I'm stuck.
        >
        > John G.
        > ----- Original Message -----
        > From: Paul Kulchenko
        > To: john_griffin12 ; soaplite@yahoogroups.com
        > Sent: Monday, October 28, 2002 1:17 PM
        > Subject: Re: [soaplite] (unknown)
        >
        >
        > Hi John,
        >
        > > I need a little help with this one. The deployment descriptors
        > I
        > > MUST
        > > use map the serializers/deserializers to a null namespace
        >
        > I'm not sure why you need to do this, but it's not legal
        > according to
        > XML Namespaces spec to have prefix that points to no-namespace:
        > xmlns:n1="" is NOT allowed, whereas xmlns="" is fine.
        >
        > Why do you need to point to empty namespace?
        >
        > Best wishes, Paul.
        >
        > --- john_griffin12 <jgriffin@...> wrote:
        > > I need a little help with this one. The deployment descriptors
        > I
        > > MUST
        > > use map the serializers/deserializers to a null namespace
        > > (xmlns:z=""). This causes me problems when I try to ser/deser
        > a
        > > data type. I know that the null namespace is not standard but
        > I
        > > have
        > > no choice. How can I workaround this problem, force a certain
        > > deser,
        > > etc.
        > >
        > > Here's the error message:
        > > Unresolved prefix 'ns3' for attribute value 'ns3:campaign[1]'
        > >
        > > Here's the returned message(partial):
        > > <SOAP-ENV:Body>
        > > <ns1:getCampaignsResponse
        > xmlns:ns1="urn:CampaignService"
        > >
        > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
        > > <return
        > xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/"
        > > xsi:type="ns2:Array" xmlns:ns3=""
        > ns2:arrayType="ns3:campaign[1]">
        > > ...
        > >
        > > Again I know the problem is that the deserializer can't be
        > found
        > > due
        > > to the null namespace. Any help would be greatly appreciated.
        > > Thanks
        > > in advance.
        > >
        > > J.G
        > >
        > >
        > >
        > >
        > > ------------------------ Yahoo! Groups Sponsor
        > >
        > > To unsubscribe from this group, send an email to:
        > > soaplite-unsubscribe@yahoogroups.com
        > >
        > >
        > >
        > > Your use of Yahoo! Groups is subject to
        > > http://docs.yahoo.com/info/terms/
        > >
        > >
        >
        >
        > __________________________________________________
        > Do you Yahoo!?
        > Y! Web Hosting - Let the expert host your web site
        > http://webhosting.yahoo.com/
        >
        > Yahoo! Groups Sponsor
        > ADVERTISEMENT
        >
        >
        >
        >
        > To unsubscribe from this group, send an email to:
        > soaplite-unsubscribe@yahoogroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to the Yahoo! Terms of
        > Service.
        >


        __________________________________________________
        Do you Yahoo!?
        HotJobs - Search new jobs daily now
        http://hotjobs.yahoo.com/
      Your message has been successfully submitted and would be delivered to recipients shortly.