📄 guidgenclient1.java
字号:
package samples.guidgen;
import java.io.*;
import java.net.*;
import java.util.*;
import org.apache.soap.*;
import org.apache.soap.rpc.*;
public class GuidGenClient1 {
public static void main (String[] args) throws Exception {
URL url = new URL("http://www.itfinity.net/soap/guid/Default.asp");
// Build the call.
Call call = new Call ();
call.setTargetObjectURI ("http://www.itfinity.net/soap/guid/guid.xsd");
call.setMethodName ("NextGUID");
call.setEncodingStyleURI("http://schemas.xmlsoap.org/soap/encoding/");
// make the call: note that the action URI is empty because the
// XML-SOAP rpc router does not need this. This may change in the
// future.
Response resp = call.invoke (/* router URL */ url,
/* actionURI */ "http://www.itfinity.net/soap/guid/Default.asp" );
// Check the response.
if (resp.generatedFault ()) {
Fault fault = resp.getFault ();
System.out.println ("Ouch, the call failed: ");
System.out.println (" Fault Code = " + fault.getFaultCode ());
System.out.println (" Fault String = " + fault.getFaultString ());
} else {
Parameter result = resp.getReturnValue ();
System.out.println (result.getValue ());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -