⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 guidgenclient1.java

📁 java web服务应用开发详解 是java程序员必备的好东东
💻 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 + -