webserviceclient.java

来自「BEA WebLogic Server 8.1大全 = BEA webLogic」· Java 代码 · 共 40 行

JAVA
40
字号
package com.wlsunleashed.webservices.javaclass;

/**
 * Class WebServiceClient
 * Description: A static Web Service client for the TestWS Web Service
 */

public class WebServiceClient {
	public static void main(String[] args) {
	    // Setup the global JAXM message factory    
	    System.setProperty("javax.xml.soap.MessageFactory",      
	    	"weblogic.webservice.core.soap.MessageFactoryImpl");    
	    // Setup the global JAX-RPC service factory    
	    System.setProperty( "javax.xml.rpc.ServiceFactory",      
	    	"weblogic.webservice.core.rpc.ServiceFactoryImpl");    
	    	
	    // Parse the argument list    
	    WebServiceClient client = new WebServiceClient();
	    String wsdl = (args.length > 0? args[0] : null);    
	    client.callWS(wsdl);  
	}
	
	public void callWS(String wsdlURI) {
		try {
			TestWSPort testWS = null;
			if (wsdlURI == null) {
				testWS = new TestWS_Impl().getTestWSPort();
			} else {
				testWS = new TestWS_Impl(wsdlURI).getTestWSPort();
			}
	
			String str = testWS.getGreeting("Jessie Marin");
			System.out.println(str);			
			
		} catch (Exception e) {
			e.printStackTrace();
		}
			
	}        
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?