一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

Java 与 .NET 的基于 WS-Security的Web Services集成实现(下)

时间:2022-07-02 11:19:49 编辑:袖梨 来源:一聚教程网

Java 与 .NET 的基于 WS-Security的Web Services集成实现(下)
rottenapple
4. 打开Jbuilder9 ,新建一个java 类,命名为TestNetService。并将axis-wsse-1.0的jar包添加到Jbuilder的jdk中(Tools->configions jdks->class tab->add)代码如下:
package MyWebServiceJavaClient;
import java.util.Date;
import java.text.DateFormat;
import org.apache.axis.MessageContext;
import org.apache.axis.message.*;
import org.apache.axis.client.*;
import org.apache.axis.utils.*;
import javax.xml.namespace.QName;
import java.lang.Integer;
import javax.xml.rpc.ParameterMode;
import net.vitale.filippo.axis.handlers.WsseClientHandler;
/**
*

Title:


*

Description:


*

Copyright: Copyright (c) 2004


*

Company:


* @author not attributable
* @version 1.0
*/

public class TestNetService {
static String usernameS = null;
static String passwordS = null;
public TestNetService() {
}

public static void main(String[] args) {
try {
Integer i = new Integer(2);
Integer j = new Integer(2);
String endpoint="http://localhost/MyServices/WebServiceTest/SumService.asmx";

Service service = new Service();
Call call = (Call)service.createCall();

call.setTargetEndpointAddress(new java.net.URL(endpoint));

热门栏目