You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by frenchStudent <ha...@gmail.com> on 2009/07/23 12:48:52 UTC

error when calling a webService provided by axis installation

Hello,

I try to understand how a client can call a web service.

For that, I have just modify the exemple provided by axis (exactly, this
class : axis-1_4\samples\userguide\example1\TestClient) to call the web
service "Version", provided also by default with axis.

[code]
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

import javax.xml.namespace.QName;

public class TestClient
{
   public static void main(String [] args) {
       try {
           String endpoint = 
                    "http://localhost:8080/axis/services/Version";
     
           Service  service = new Service();
           Call     call    = (Call) service.createCall();

           call.setTargetEndpointAddress( new java.net.URL(endpoint) );
           call.setOperationName(new QName("http://xml.apache.org/xml-soap",
"getVersion") );

           // Call to addParameter/setReturnType as described in
user-guide.html
           //call.addParameter("testParam",
           //                  org.apache.axis.Constants.XSD_STRING,
           //                  javax.xml.rpc.ParameterMode.IN);
           //call.setReturnType(org.apache.axis.Constants.XSD_STRING);

           String ret = (String) call.invoke( new Object[] { "Hello!" } );

           System.out.println("Sent 'Hello!', got '" + ret + "'");
       } catch (Exception e) {
           System.err.println(e.toString());
       }
   }
}
[/code]

I have the following error message : "No such operation 'getVersion'.

Nevertheless, in the wsdl file, I have the tag : <wsdl:operation
name="getVersin">.


Thanks in advance.

Best regards.


-- 
View this message in context: http://www.nabble.com/error-when-calling-a-webService-provided-by-axis-installation-tp24623364p24623364.html
Sent from the Axis - Dev mailing list archive at Nabble.com.