import java.net.URL;
import java.rmi.RemoteException;
import java.sql.Date;
import java.util.Calendar;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.ServiceException;
import javax.xml.rpc.encoding.XMLType;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
/**
* 加锁
* @author Wangsong
*
*/
@org.springframework.stereotype.Service
public class CheckDogWebserice {
@SuppressWarnings("deprecation")
public static String GetUserPowerOther() {
String url = "http://198.33.5.221:8001/sdrswebservice/sdrsservice.asmx";
String namespace = "http://tempuri.org/";
String methodName = "UserPower";
String soapActionURI = "http://tempuri.org/UserPower";
Service service = new Service();
Call call;
try {
call = (Call) service.createCall();
call.setTargetEndpointAddress(url);
call.setUseSOAPAction(true);
call.setSOAPActionURI(soapActionURI);
call.setOperationName(new QName(namespace, methodName));
call.addParameter(new QName(namespace, "strType"), XMLType.XSD_STRING,ParameterMode.IN);
call.setReturnType(XMLType.XSD_STRING);
call.addParameter(new QName(namespace, "strPassWord"), XMLType.XSD_STRING,ParameterMode.IN);
call.setReturnType(XMLType.XSD_STRING);
String[] str = new String[2];
str[0] = 1111;
str[1] = 1111;
String obj = (String)call.invoke(str);
return obj;
} catch (ServiceException e) {
e.printStackTrace();
} catch (RemoteException e) {
e.printStackTrace();
}
return "调用webService失败";
}
}