Code:
Import javax. xml. namespace. QName;
Import org. apache. axis. client. Call;
Import org. apache. axis. client. Service;
Public class IPreventIndulge {
Public boolean getValidateInfo (String UUid ){
Try {
String endpoint = "http://game.qidian.com/RemoteWebService/IPreventIndulge.asmx ";
// Create a service call)
Service service = new Service ();
Call call = (Call) service. createCall (); // create a call object through the service
// Set the URL of the service
Call. setTargetEndpointAddress (new java.net. URL (endpoint ));
Call. setUseSOAPAction (true );
Call. setSOAPActionURI ("http://tempuri.org/GetIndulgeInfo"); // This should also be noted that it is to Add the method to be called Add, otherwise it will also report an error
Call. setOperationName (new QName ("http://tempuri.org/", "GetIndulgeInfo "));
// GetIndulgeInfo method name
Call. addParameter (new QName ("http://tempuri.org/", "idType "),
Org. apache. axis. encoding. XMLType. XSD_STRING,
Javax. xml. rpc. ParameterMode. IN );
Call. addParameter (new QName ("http://tempuri.org/", "UUId "),
Org. apache. axis. encoding. XMLType. XSD_STRING,
Javax. xml. rpc. ParameterMode. IN );
Call. setReturnType (org. apache. axis. encoding. XMLType. SOAP_STRING); // type of the returned Parameter
// The Object array encapsulates parameters. The parameter is "This is Test! ", Call processService (String arg)
String ret = (String) call. invoke (new Object [] {UUid, "0 "});
System. out. println (ret );
} Catch (Exception e ){
E. printStackTrace ();
}
Return false;
}
Public static void main (String [] args ){
New IPreventIndulge (). getValidateInfo ("411668171 ");
}
}