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

Re : [soaplite] Custom SOAP::Serializer for complexTyp e

Expand Messages
  • Sylvain St-Germain
    Thanks Paul, I ll give it a try on monday, looks rather simple... I am happy to undertand I shouldn t have to implement the serialization for my complexTypes
    Message 1 of 2 , Jun 14, 2002
    • 0 Attachment
       
      Thanks Paul, I'll give it a try on monday, looks rather simple...
      I am happy to undertand I shouldn't have to implement the serialization for my complexTypes as sugested by Duncan.  I have a dozen or so of them....
       
      I have been generating my stubs using stubmaker, and I was wondering if there are plans to support WSDL complexType generation and soap:header any time soon? 
       
      Regards,
      Sylvain.
       
      ----- Message d'origine -----
      De : Paul Kulchenko
      Envoyé : 14 juin, 2002 17:30
      À : sylvainstg; soaplite@yahoogroups.com
      Objet : Re: [soaplite] Custom SOAP::Serializer for complexType
       
      Hi, Sylvain!

      > What I want is my own namespace (not perl's one) like:
      all you need to do is this:

      $soap->maptype->{'biBusHeader'} = 'http://.../bibus/2';

      If you don't do this, SOAP::Lite will use default namespace. Hope it
      helps.

      Best wishes, Paul.

      --- sylvainstg <sylvainstg@...> wrote:
      > Hi all,
      >
      > When I write:
      > my $header = SOAP::Header->name('biBusHeader' => new
      > biBusHeader());
      >
      > my SOAP header is being serialized as:
      > <biBusHeader xsi:type="namesp2:biBusHeader">...
      >
      > (where namesp2 is defined as http://namespaces.soaplite.com/perl)
      >
      > What I want is my own namespace (not perl's one) like:
      >
      > <biBusHeader xsi:type="bus:biBusHeader"
      > xmlns:bus="http://.../bibus/2">...
      >
      > I can achieve this by setting the type and and attribute on the
      > SOAP::Header object :
      > ->attr({'xmlns:bus' => 'http://.../bibus/2'})
      > ->type('bus:biBusHeader');
      >
      > This is rather ugly to me since I have a quite complex header and I
      >
      > would have to ask my users to do this for each of them.  So, I
      > looked
      > into hacking into the SOAP::Serializer.
      >
      > I simply added my type 'biBusHeader' in the _typeLookup hash:
      >
      >    biBusHeader => [51, sub {1}, 'as_biBusHeader'],
      >
      > And implemented the as_biBusHeader method:
      >
      > sub as_biBusHeader {
      >   my $self = shift;
      >   my($value, $name, $type, $attr) = @_;
      >   return [
      >      $name,
      >      {'xsi:type' => 'bus:biBusHeader',
      >       'xmlns:bus' => 'http://.../bibus/2', %$attr},
      >
      >      ### SEE (1) below
      >      #$self->encode_object($value, $name, $type, $attr)];
      >
      >      ### SEE (2) below
      >      $value];
      > }
      >
      > When I use form (1) serialization fails.  When I use form (2) I get
      > a
      > reference to my object: 'SOAP::Header=HASH(0x34bec78)'...
      >
      > Am I taking the appropriate approach or not?  If so what should my
      > custom serialiser be doing to serialize properly?
      >
      > Many thanks
      > Sylvain.
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      > ------------------------ Yahoo! Groups Sponsor
      > ---------------------~-->
      > Will You Find True Love?
      > Will You Meet the One?
      > Free Love Reading by phone!
      > http://us.click.yahoo.com/Deo18C/zDLEAA/Ey.GAA/W6uqlB/TM
      >
      ---------------------------------------------------------------------~->
      >
      > 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!?
      Yahoo! - Official partner of 2002 FIFA World Cup
      http://fifaworldcup.yahoo.com


      Profitez pleinement du Web. Téléchargez gratuitement : http://explorer.msn.fr/intl.asp#fr
    • sylvainstg
      Paul, Is there a way to set the namespace a little more globally? I must have roughly 100 types or so... Sylvain.
      Message 2 of 2 , Jun 17, 2002
      • 0 Attachment
        Paul,
        Is there a way to set the namespace a little more globally? I must
        have roughly 100 types or so...

        Sylvain.

        --- In soaplite@y..., "Sylvain St-Germain" <sylvainstg@h...> wrote:
        >
        > ----- Message d'origine -----
        > De : Paul Kulchenko
        > Envoyé : 14 juin, 2002 17:30
        > À : sylvainstg; soaplite@y...
        > Objet : Re: [soaplite] Custom SOAP::Serializer for complexType
        >
        > Hi, Sylvain!
        >
        > > What I want is my own namespace (not perl's one) like:
        > all you need to do is this:
        >
        > $soap->maptype->{'biBusHeader'} = 'http://.../bibus/2';
        >
        > If you don't do this, SOAP::Lite will use default namespace. Hope it
        > helps.
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.