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

5311Re: [soaplite] axis client and Soap::Lite server example?

Expand Messages
  • Richard N. Fogle
    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?
      ----- Original Message -----
      Sent: Sunday, March 26, 2006 9:45 AM
      Subject: [soaplite] axis client and Soap::Lite server example?

      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):
      my $soap = SOAP::Lite
          -> uri('Foobar/widgetMaker')
          -> proxy('http://ws.mydomain.org/ws/soap');
      my $result = $soap->getWidgets(var1, var2, var3);
      print $result->result();
      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;
      5   public class TestClient {
      6     public static void main(String [] args) {
      7       try {
      8         String endpoint =
      9             http://ws.mydomain.org/ws/soap;
      11        Service  service = new Service();
      12        Call     call    = (Call) service.createCall();
      14        call.setTargetEndpointAddress( new java.net.URL(endpoint) );
      15        call.setOperationName(new QName("Foobar/widgetMaker", echoString"));
      17        String ret = (String) call.invoke( new Object[] { "Hello!" } );
      19        System.out.println("Sent 'Hello!', got '" + ret + "'");
      20      } catch (Exception e) {
      21        System.err.println(e.toString());
      22      }
      23    }
      24  }
    • Show all 5 messages in this topic