📄 client.java
字号:
package bible.webservices.message.consumer.client;
import javax.naming.Context;
import javax.naming.InitialContext;
import java.net.URL;
import java.util.Properties;
import weblogic.soap.WebServiceProxy;
import weblogic.soap.SoapMethod;
import weblogic.soap.SoapType;
import weblogic.soap.codec.CodecFactory;
import weblogic.soap.codec.SoapEncodingCodec;
/**
* Class client
*
*
* @author
* @version %I%, %G%
*/
public class Client {
/**
* Constructor client
*
*
*/
public Client() {}
/**
* Method main
*
*
* @param args
*
*/
public static void main(String[] args) {
try {
CodecFactory factory = CodecFactory.newInstance();
factory.register(new SoapEncodingCodec());
WebServiceProxy proxy =
WebServiceProxy
.createService(new URL("http://localhost:7001/consumerWS/sendMsg"));
proxy.setCodecFactory(factory);
proxy.setVerbose(false);
SoapType param = new SoapType("message", String.class);
proxy.addMethod("send", null, new SoapType []{ param });
SoapMethod method = proxy.getMethod("send");
String message =
"Sending data to the JMS queueReader from the client";
Object result = method.invoke(new Object []{ message });
} catch (Exception e) {
e.printStackTrace();
}
}
}
/*--- Formatted in Bible Style on Thu, Sep 6, '01 ---*/
/*------ Formatted by Jindent 3.24 Gold 1.02 --- http://www.jindent.de ------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -