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

Re: [soaplite] java client for SOAP::Lite server

Expand Messages
  • Paul Kulchenko
    Hi, Christof! ... If you do NOT have User class on client side, then this method call will be dispatched remotely and executed on server side. if you want to
    Message 1 of 5 , May 16, 2001
    • 0 Attachment
      Hi, Christof!

      > i got it working in java, up to the new(id => 1), which is received
      > by
      > the server. the server then returns a User object. I can't find an
      > easy way to access the name() method from there though.
      If you do NOT have User class on client side, then this method call
      will be dispatched remotely and executed on server side. if you want
      to dispatch it locally, you need to have User class on client side
      (as in examples/pingpong.pl).

      > all the examples i found on the net don't seem to return objects,
      > just simple types (temperature, stockquote, ...)
      You may take a look into examples/oo-apache.pl which accesses object
      returned by ApacheSOAP implementation.

      Hope it helps.

      Best wishes, Paul.

      --- Christof Damian <cdamian@...> wrote:
      > Hi,
      > does someone have experience with this setup ? what i am trying to
      > do
      > looks like this in perl with SOAP::Lite :
      >
      > #!/usr/bin/perl -w
      > use strict;
      > use SOAP::Lite +autodispatch =>
      > uri => "http://localhost:8000/",
      > proxy => "http://localhost:8000/server.pl",
      > ;
      > my $u = User->SOAP::new(id => 1);
      > print "ggid = ".$u->name()."\n";
      >
      >
      > i got it working in java, up to the new(id => 1), which is received
      > by
      > the server. the server then returns a User object. I can't find an
      > easy way to access the name() method from there though.
      >
      > all the examples i found on the net don't seem to return objects,
      > just
      > simple types (temperature, stockquote, ...)
      >
      > christof
      > --
      > Christof Damian [ we are looking for perl and linux
      > Technical Director programmers, more information @
      > guideguide ltd. http://guideguide.com/wanted.html ]
      >
      > 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! Auctions - buy the things you want at great prices
      http://auctions.yahoo.com/
    • Christof Damian
      ... no, i want to dispatch them remotely. ... i saw that, but i want it the other way around. i would like to see a java client for a SOAP::Lite server. the
      Message 2 of 5 , May 16, 2001
      • 0 Attachment
        Paul Kulchenko wrote:
        >
        > Hi, Christof!
        >
        > > i got it working in java, up to the new(id => 1), which is received
        > > by
        > > the server. the server then returns a User object. I can't find an
        > > easy way to access the name() method from there though.
        > If you do NOT have User class on client side, then this method call
        > will be dispatched remotely and executed on server side. if you want
        > to dispatch it locally, you need to have User class on client side
        > (as in examples/pingpong.pl).

        no, i want to dispatch them remotely.

        >
        > > all the examples i found on the net don't seem to return objects,
        > > just simple types (temperature, stockquote, ...)
        > You may take a look into examples/oo-apache.pl which accesses object
        > returned by ApacheSOAP implementation.

        i saw that, but i want it the other way around. i would like to see a
        java client for a SOAP::Lite server.

        the client should dispatch them remotely.

        christof
        --
        Christof Damian [ we are looking for perl and linux
        Technical Director programmers, more information @
        guideguide ltd. http://guideguide.com/wanted.html ]
      • Douglas Bonar
        ... I know this is the brute force way, but it works if you control the server. Just set the server to dump incoming and outgoing messages to a file and then
        Message 3 of 5 , May 16, 2001
        • 0 Attachment
          Christof Damian wrote:
          >
          > > > all the examples i found on the net don't seem to return objects,
          > > > just simple types (temperature, stockquote, ...)
          > > You may take a look into examples/oo-apache.pl which accesses object
          > > returned by ApacheSOAP implementation.
          >
          > i saw that, but i want it the other way around. i would like to see a
          > java client for a SOAP::Lite server.
          >
          > the client should dispatch them remotely.
          >
          > christof

          I know this is the brute force way, but it works if you control
          the server. Just set the server to dump incoming and outgoing messages
          to a file and then use the Perl client to talk to it. After you have
          captured the messages, you can use whatever Java XML or SOAP package
          you want to send equivalent messages. SOAP-Lite isn't doing anything
          magical (though it sometimes looks that way), it is just serializing
          the function arguments into SOAP and reconstructing them at the
          other end. (And I don't mean that disparagingly at all.) Underneath
          it is all just specially formatted text strings.

          I'ld include an example, but my Java clients have all used
          a locally produced library so my examples wouldn't help. The effect
          was more like working with SOAP::Data and SOAP::Serializer classes
          directly to make a message and LWP::UserAgent to send it rather than
          using autodispatch. But it was fairly workable.

          Doug
        • Paul Kulchenko
          Hi, Douglas! Right. It works this way. The only thing that SOAP::Lite server does magically is returning modified object back on client side. Say you have an
          Message 4 of 5 , May 16, 2001
          • 0 Attachment
            Hi, Douglas!

            Right. It works this way. The only thing that SOAP::Lite server does
            magically is returning modified object back on client side. Say you
            have an object on client side. When you make a call object itself can
            be modified, but there is no way to return modified object (because
            result of call is returned), so SOAP::Lite returns object as a SOAP
            Header. Client side will recover it and update your object
            accordingly. You can do the same thing in Java client, but you need
            to write this code yourself. Everything will work WITHOUT this piece,
            only Java client won't be able to see changes in object that came
            from server side (if any).

            Everything else is just "formatted text strings", no magic there :))

            > directly to make a message and LWP::UserAgent to send it rather
            In fact you can reuse Client libraries calling send_receive method,
            in that case you can get M-POST, redirects, and all low level code.
            Almost all components can be used separately. Be warned however about
            planned changes in send_receive interface. There will be more
            communications between Serializer, Transport and Deserializer. I'm
            making those changes as much compatible with current code as
            possible, but undocumented features may not work as worked before.

            Best wishes, Paul.

            --- Douglas Bonar <Doug.Bonar@...> wrote:
            > Christof Damian wrote:
            > >
            > > > > all the examples i found on the net don't seem to return
            > objects,
            > > > > just simple types (temperature, stockquote, ...)
            > > > You may take a look into examples/oo-apache.pl which accesses
            > object
            > > > returned by ApacheSOAP implementation.
            > >
            > > i saw that, but i want it the other way around. i would like to
            > see a
            > > java client for a SOAP::Lite server.
            > >
            > > the client should dispatch them remotely.
            > >
            > > christof
            >
            > I know this is the brute force way, but it works if you control
            > the server. Just set the server to dump incoming and outgoing
            > messages
            > to a file and then use the Perl client to talk to it. After you
            > have
            > captured the messages, you can use whatever Java XML or SOAP
            > package
            > you want to send equivalent messages. SOAP-Lite isn't doing
            > anything
            > magical (though it sometimes looks that way), it is just
            > serializing
            > the function arguments into SOAP and reconstructing them at the
            > other end. (And I don't mean that disparagingly at all.)
            > Underneath
            > it is all just specially formatted text strings.
            >
            > I'ld include an example, but my Java clients have all used
            > a locally produced library so my examples wouldn't help. The
            > effect
            > was more like working with SOAP::Data and SOAP::Serializer classes
            > directly to make a message and LWP::UserAgent to send it rather
            > than
            > using autodispatch. But it was fairly workable.
            >
            > Doug
            >
            > 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! Auctions - buy the things you want at great prices
            http://auctions.yahoo.com/
          Your message has been successfully submitted and would be delivered to recipients shortly.