String url = "Http://192.168.0.90:8088/wsServerExample"; String namespace = "http://webserver.server.com/"; try {org.apache.axis.client.Service Service = new Org.apache.axis.client.Service (); Call calls Service.createcall ();//Set the calling service address call.settargetendpointaddress (new Java.net.URL (URL));// It is important to configure the WSDL namespace parameter call.setoperationname (new QName (namespace, "Queryobjectout") here);//You need to configure the incoming parameter type and the parameter name here. If Jax-WS is not set, the parameter cannot be accepted and the passed argument is considered null
The parameter name must be arg0, otherwise it will not accept the parameter Call.addparameter ("arg0", Org.apache.axis.encoding.XMLType.XSD_STRING, Javax.xml.rpc.ParameterMode.IN); Call.addparameter ("Arg1", Org.apache.axis.encoding.XMLType.XSD_STRING, Javax.xml.rpc.ParameterMode.IN); Call.addparameter ("Arg2", Org.apache.axis.encoding.XMLType.XSD_STRING, Javax.xml.rpc.ParameterMode.IN); Call.addparameter ("Arg3", Org.apache.axis.encoding.XMLType.XSD_STRING, Javax.xml.rpc.ParameterMode.IN);//If you set the class to pass in the parameter type, you also need to set the return parameter type Call.setreturntype ( Org.apache.axis.encoding.XMLType.XSD_STRING); Call.setusesoapaction (true); Call.setsoapactionuri (URL); String result = (string) call.invoke (new object[] {transno, inxml, "11", "21321"}); SYSTEM.OUT.PRINTLN (result);} catch (Exception e) {e.printstacktrace ();}
Java call WebService cannot find parameter considerations when using axis mode