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

5299axis client and Soap::Lite server example?

Expand Messages
  • Richard N. Fogle
    Mar 26 7:45 AM
    • 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
    • Show all 5 messages in this topic