使用Apache Axis2和Rampart创建WebService客户端(WebService Client creation using Apache Axis2 and Rampart)

编程入门 行业动态 更新时间:2024-10-27 23:22:49
使用Apache Axis2和Rampart创建WebService客户端(WebService Client creation using Apache Axis2 and Rampart)

我们要求在IBM Websphere Integration Developer 6.1中创建具有用户名令牌安全性的Web服务。 现在,为了测试这个,我们必须用Java开发Web服务客户端。 要求是使用Apache Axis2完成此操作。 在对此进行了大量阅读之后,我能够使用Axis2为简单的Web服务生成客户端,该服务不需要身份验证,我能够正确地进行测试。 但我开始知道,为了在axis2中使用UserName令牌安全性,需要使用rampart。

现在我需要知道如何在eclipse中使用Rampart和Axis2。 我们的系统中没有安装apache服务器,但我们在eclipse中部署它。 即使在阅读了很多同样的文章之后,我也无法让Rampart工作。

有人可以指导我完成在eclipse中配置Rampart的步骤,以及如何使用UserName令牌将其用于WebService客户端生成?

到目前为止,使用Axis2我曾经做过以下步骤。 1.创建Java项目并将所需的WSDL导入其中。 2.使用WSDL,我创建WebServiceClient并生成以下类型的文件。 一个java接口文件b。 一个Java代理文件,它实现了ac中提到的接口。一个java存根文件,它扩展了org.apache.axis.client.Stub,并实现了广告中提到的接口。一个java服务文件,它又是一个接口e。 实现上述接口的java ServiceLocator文件。

所以,我还需要知道如何使用这些文件来测试用户名令牌Web服务。

当我使用动态Web项目执行上述操作并右键单击WSDL并单击生成客户端时,将创建ServiceCallBackHandler.java和HttpSrviceStub文件。 我如何使用这些来实现测试?

谢谢。

We have a requirement where a webservice with username token security has been created in IBM Websphere Integration Developer 6.1. Now, in order to test this, we have to develop a Web Service Client in Java. The requirement is to get this done using Apache Axis2. After doing a lot of reading on this, I was able to use Axis2 to generate a client for a simple Web Service which does not require authentication and I was able to test it correctly. But I came to know that in order to use UserName token Security with axis2, rampart is needed.

Now I need to know how to use Rampart with Axis2 in eclipse. We dont have apache server installed in our systems, but we deploy it in eclipse. Even after reading a lot of articles on the same, I havent been able to get Rampart to work.

Can someone please guide me through the steps of configuring Rampart in eclipse and also how to use it for WebService Client Generation using UserName token?

So far, using Axis2 I used to do the following Steps. 1. Create a Java Project and import the required WSDLs into it. 2. Using the WSDLs, I create the WebServiceClient and the following types of files get generated a. A java Interface file b. A Java Proxy file which implements the interface mentioned in a. c. A java stub file which extends org.apache.axis.client.Stub and implements the interface mentioned in a. d. A java Service file which is again an interface e. A java ServiceLocator file which implements the above interface.

So, I also need to know how I can use these files for testing the Username Token Web Service.

When I do the above using a Dynamic Web project and right click on the WSDLs and click on generate client, a ServiceCallBackHandler.java and HttpSrviceStub files are created. How do i use these to achieve the testing?

Thanks.

最满意答案

我没有在用户名令牌中使用rampart,但对于我的服务(签名和加密),IBM文档确实非常有用。 请查看: http : //www.ibm.com/developerworks/java/library/j-jws4/ Java Web服务:Axis2 WS-Security基础知识; 了解如何将Rampart安装到Axis2中并实现UsernameToken处理

对于我的项目,当我使用WS-Security(工作环境)和没有WS-Security(测试环境)时,Java源代码是相同的。 我需要在客户端执行此操作以启用/禁用my_client/axis-repo/conf/axis2.xml配置。 请查看: http : //wso2.org/library/240 ,您将在其中找到可能对您有用的示例配置:

<parameter name="OutflowSecurity"> <action> <items>UsernameToken</items> <user>bob</user> <passwordCallbackClass>org.apache.rampart. samples.sample02.PWCBHandler</passwordCallbackClass> </action> </parameter>

I haven't used rampart for Username Tokens, but for my services (signing and encrypting) IBM documentation was really helpful. Have a look at: http://www.ibm.com/developerworks/java/library/j-jws4/ Java Web services: Axis2 WS-Security basics; See how to install Rampart into Axis2 and implement UsernameToken handling

For my project Java source is the same when I use WS-Security (working environment) and without WS-Security (test environment). All I have to do on client side it to enable/disable rampart configuration from my_client/axis-repo/conf/axis2.xml. Have a look at: http://wso2.org/library/240 where you will find example configuration that may be useful to you:

<parameter name="OutflowSecurity"> <action> <items>UsernameToken</items> <user>bob</user> <passwordCallbackClass>org.apache.rampart. samples.sample02.PWCBHandler</passwordCallbackClass> </action> </parameter>

更多推荐

Axis,Web,电脑培训,计算机培训,IT培训"/> <meta name="description" co

本文发布于:2023-08-04 15:40:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1417870.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:客户端   Rampart   Apache   creation   Client

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!