import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import java.util.*;
public class BedBreakfastClient {
public static void main(String [] args) {
try {
String endpoint = "http://localhost:8080/axis/BedBreakfast.jws";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName("listAvailable");
call.setProperty(javax.xml.rpc.Call.ENCODINGSTYLE_URI_PROPERTY, "http://schemas.xmlsoap.org/soap/encoding/");
QName qVec=new QName( endpoint, "Vector ");
call.setReturnType(qVec);
Vector res = (Vector) call.invoke( new Object[] { } );
System.out.println("Now the Vector size is :" +res.size());
for (int i=0;i<res.size();i++ )
{
System.out.println(res.get(i));
}
} catch (Exception e) {
System.err.println("Execution failed. Exception: " + e);
}
}
}
Partager