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

axis client and Soap::Lite server example?

Expand Messages
  • Richard N. Fogle
    Hello, ... my $soap = SOAP::Lite - uri( Foobar/widgetMaker ) - proxy( http://ws.mydomain.org/ws/soap ); my $result = $soap- getWidgets(var1, var2, var3);
    Message 1 of 5 , Mar 26, 2006
    • 0 Attachment
      Hello,
       
      I'm a bit new to Soap::Lite, and I've been busy writing web services so we can fuse perl and Java together.  However, I've run into a bit of a snag and I can't find any examples anywhere to give to our Java devs (who use Apache Axis).  Given the followin----g successful client in Perl for Package Foobar::widgetMaker (using Apache2::SOAP/mod_perl2):
       
      ---SNIP---
      my $soap = SOAP::Lite
          -> uri('Foobar/widgetMaker')
          -> proxy('http://ws.mydomain.org/ws/soap');
       
      my $result = $soap->getWidgets(var1, var2, var3);
      print $result->result();
      ---SNIP---
       
      How does this translate into Java/Axis?  I have the example but I keep getting method denied.  Anyone with any experience in this would be much appreciated:
       
      1   import org.apache.axis.client.Call;
      2   import org.apache.axis.client.Service;
      3   import javax.xml.namespace.QName;
      4   
      5   public class TestClient {
      6     public static void main(String [] args) {
      7       try {
      8         String endpoint =
      9             http://ws.mydomain.org/ws/soap;
      10  
      11        Service  service = new Service();
      12        Call     call    = (Call) service.createCall();
      13  
      14        call.setTargetEndpointAddress( new java.net.URL(endpoint) );
      15        call.setOperationName(new QName("Foobar/widgetMaker", echoString"));
      16  
      17        String ret = (String) call.invoke( new Object[] { "Hello!" } );
      18  
      19        System.out.println("Sent 'Hello!', got '" + ret + "'");
      20      } catch (Exception e) {
      21        System.err.println(e.toString());
      22      }
      23    }
      24  }
      Regards,
      Rich
    • Richard N. Fogle
      Ok, perhaps this was a bit of a tough one or something that could be submitted to the Apache Axis list. One other quick question, I m new to WSDL and I can t
      Message 2 of 5 , Mar 29, 2006
      • 0 Attachment
        Ok, perhaps this was a bit of a tough one or something that could be submitted to the Apache Axis list.  One other quick question, I'm new to WSDL and I can't use WSDL::Generator due to perl 5.8.  Any tips?  I suppose I can open VI and start typing after finding an example on google, but is there a more elegant way to get started?
         
        Regards,
         
        Rich
        ----- Original Message -----
        Sent: Sunday, March 26, 2006 9:45 AM
        Subject: [soaplite] axis client and Soap::Lite server example?

        Hello,
         
        I'm a bit new to Soap::Lite, and I've been busy writing web services so we can fuse perl and Java together.  However, I've run into a bit of a snag and I can't find any examples anywhere to give to our Java devs (who use Apache Axis).  Given the followin----g successful client in Perl for Package Foobar::widgetMaker (using Apache2::SOAP/mod_perl2):
         
        ---SNIP---
        my $soap = SOAP::Lite
            -> uri('Foobar/widgetMaker')
            -> proxy('http://ws.mydomain.org/ws/soap');
         
        my $result = $soap->getWidgets(var1, var2, var3);
        print $result->result();
        ---SNIP---
         
        How does this translate into Java/Axis?  I have the example but I keep getting method denied.  Anyone with any experience in this would be much appreciated:
         
        1   import org.apache.axis.client.Call;
        2   import org.apache.axis.client.Service;
        3   import javax.xml.namespace.QName;
        4   
        5   public class TestClient {
        6     public static void main(String [] args) {
        7       try {
        8         String endpoint =
        9             http://ws.mydomain.org/ws/soap;
        10  
        11        Service  service = new Service();
        12        Call     call    = (Call) service.createCall();
        13  
        14        call.setTargetEndpointAddress( new java.net.URL(endpoint) );
        15        call.setOperationName(new QName("Foobar/widgetMaker", echoString"));
        16  
        17        String ret = (String) call.invoke( new Object[] { "Hello!" } );
        18  
        19        System.out.println("Sent 'Hello!', got '" + ret + "'");
        20      } catch (Exception e) {
        21        System.err.println(e.toString());
        22      }
        23    }
        24  }
        Regards,
        Rich
      • Eric Bridger
        I ve had some succes with Pod::WSDL http://search.cpan.org/~tareka/Pod-WSDL-0.03/ It is far from automatic and has some problems. No SoapAction attribute gets
        Message 3 of 5 , Mar 29, 2006
        • 0 Attachment
          I've had some succes with Pod::WSDL
          http://search.cpan.org/~tareka/Pod-WSDL-0.03/

          It is far from automatic and has some problems. No SoapAction attribute
          gets set, anyUri xsd type should be anyURI. But it will produce somethig
          that you can then take VI to.

          Richard N. Fogle said:
          > Ok, perhaps this was a bit of a tough one or something that could be
          > submitted to the Apache Axis list. One other quick question, I'm new to
          > WSDL and I can't use WSDL::Generator due to perl 5.8. Any tips? I
          > suppose I can open VI and start typing after finding an example on google,
          > but is there a more elegant way to get started?
          >
          > Regards,
          >
          > Rich
          > ----- Original Message -----
          > From: Richard N. Fogle
          > To: soaplite@yahoogroups.com
          > Sent: Sunday, March 26, 2006 9:45 AM
          > Subject: [soaplite] axis client and Soap::Lite server example?
          >
          >
          > Hello,
          >
          > I'm a bit new to Soap::Lite, and I've been busy writing web services so
          > we can fuse perl and Java together. However, I've run into a bit of a
          > snag and I can't find any examples anywhere to give to our Java devs
          > (who use Apache Axis). Given the followin----g successful client in
          > Perl for Package Foobar::widgetMaker (using Apache2::SOAP/mod_perl2):
          >
          > ---SNIP---
          > my $soap = SOAP::Lite
          > -> uri('Foobar/widgetMaker')
          > -> proxy('http://ws.mydomain.org/ws/soap');
          >
          > my $result = $soap->getWidgets(var1, var2, var3);
          > print $result->result();
          > ---SNIP---
          >
          > How does this translate into Java/Axis? I have the example but I keep
          > getting method denied. Anyone with any experience in this would be much
          > appreciated:
          >
          > 1 import org.apache.axis.client.Call;
          > 2 import org.apache.axis.client.Service;
          > 3 import javax.xml.namespace.QName;
          > 4
          > 5 public class TestClient {
          > 6 public static void main(String [] args) {
          > 7 try {
          > 8 String endpoint 9 http://ws.mydomain.org/ws/soap;
          > 10
          > 11 Service service = new Service();
          > 12 Call call = (Call) service.createCall();
          > 13
          > 14 call.setTargetEndpointAddress( new java.net.URL(endpoint) );
          > 15 call.setOperationName(new QName("Foobar/widgetMaker",
          > echoString"));
          > 16
          > 17 String ret = (String) call.invoke( new Object[] { "Hello!" } );
          > 18
          > 19 System.out.println("Sent 'Hello!', got '" + ret + "'");
          > 20 } catch (Exception e) {
          > 21 System.err.println(e.toString());
          > 22 }
          > 23 }
          > 24 }Regards,Rich
          >
          > ------------------------------------------------------------------------------
          > YAHOO! GROUPS LINKS
          >
          > a.. Visit your group "soaplite" on the web.
          >
          > b.. To unsubscribe from this group, send an email to:
          > soaplite-unsubscribe@yahoogroups.com
          >
          > c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of
          > Service.
          >
          >
          > ------------------------------------------------------------------------------
          >
          >
        • paulb
          Richard, I only just saw your email. I noticed the Perl program method and arguments were different from the Java program. The Java program should have
          Message 4 of 5 , Mar 30, 2006
          • 0 Attachment
            Richard,

            I only just saw your email. I noticed the Perl program method and
            arguments were different from the Java program.

            The Java program should have something like this:

            15 call.setOperationName(new QName("Foobar/widgetMaker",
            "getWidgets"));
            ...
            17 String ret = (String) call.invoke( new Object[] { "var1",
            "var2", "var3" } );


            Cheers
            ----------------------------------------------------------------------
            He who slings mud generally loses ground.
            -- Adlai Stevenson
            ----------------------------------------------------------------------
            Paul Bizannes
          • Richard N. Fogle
            Thank you very much! Just as I was debugging my first WSDL. That worked perfectly, I can return to the back-end programming now! It s amusing sometimes, we
            Message 5 of 5 , Apr 2 7:38 PM
            • 0 Attachment
              Thank you very much!  Just as I was debugging my first WSDL.  That worked perfectly, I can return to the back-end programming now!  It's amusing sometimes, we sysadmin/perl types tend to go learn just enough to get something done so we can get back to the "real" work (ahem, HTML), and I frustratingly found out that isn't all that possible with WSDL.  Perhaps we'll see something like this for Foo::Bar type web services:
               
              my $soap = SOAP::Lite
                  -> uri(Foo/bar)
                  -> proxy(http://ws.mydomain.com/ws);
               
              my $wsdl = $soap->magicWSDL("poof");
               
              Regards,
               
              Rich
               
              ----- Original Message -----
              From: paulb
              Sent: Friday, March 31, 2006 12:39 AM
              Subject: Re: [soaplite] axis client and Soap::Lite server example?

              Richard,

              I only just saw your email. I noticed the Perl program method and
              arguments were different from the Java program.

              The Java program should have something like this:

                15        call.setOperationName(new QName("Foobar/widgetMaker",
              "getWidgets"));
                ...
                17        String ret = (String) call.invoke( new Object[] { "var1",
              "var2", "var3" } );


              Cheers
              ----------------------------------------------------------------------
              He who slings mud generally loses ground.
                  -- Adlai Stevenson
              ----------------------------------------------------------------------
              Paul Bizannes
            Your message has been successfully submitted and would be delivered to recipients shortly.