如何使用axis2为jaxws服务制作junit

时间:2023-01-19 09:56:49

I'm developing jaxws annotated webservice and I'm deploying it to axis2 (1.5.1) running at tomcat (6.0.20) in a folder named 'servicejars'. So far so good. But it is undeployable to the SimpleAxis2Server to make junit tests. Deploying as service archive (.aar) doesn't run for jaxws webservice as discussed here https://issues.apache.org/jira/browse/AXIS2-4611.

我正在开发jaxws注释的webservice,我正在将它部署到运行在tomcat(6.0.20)的名为'servicejars'的文件夹中的axis2(1.5.1)。到现在为止还挺好。但是,SimpleAxis2Server无法进行junit测试。部署为服务存档(.aar)不适用于jaxws webservice,如https://issues.apache.org/jira/browse/AXIS2-4611所述。

How to make junit for jaxws service with axis2? Any suggestions?

如何使用axis2为jaxws服务制作junit?有什么建议?

2 个解决方案

#1


0  

Your description contains two problems.

您的描述包含两个问题。

First problem is that bug. If your web services cannot be deployed at all and no client can call them, you have to find a workaround! I cannot help with that part.

第一个问题是bug。如果您的Web服务根本无法部署,并且没有客户可以调用它们,您必须找到解决方法!我无法帮助那部分。

The second problem is finding the right junit test strategy. My advice is the following: if you can avoid it, don't call real web services with junit tests on the client side. Find a way to call your annotated methods from junit tests sitting on the server side. Your unit tests will be more efficient and won't depend on a jaxws client.

第二个问题是找到正确的junit测试策略。我的建议如下:如果可以避免,请不要在客户端使用junit测试调用真正的Web服务。找到一种方法从坐在服务器端的junit测试中调用带注释的方法。您的单元测试将更有效,并且不依赖于jaxws客户端。

#2


0  

I've solved my problem. I use the onboard solution of java6 (Endpoint.publish(..)) to publish the webservice from within junit. It is very easy.

我已经解决了我的问题。我使用java6(Endpoint.publish(..))的板载解决方案从junit中发布web服务。这很容易。

#1


0  

Your description contains two problems.

您的描述包含两个问题。

First problem is that bug. If your web services cannot be deployed at all and no client can call them, you have to find a workaround! I cannot help with that part.

第一个问题是bug。如果您的Web服务根本无法部署,并且没有客户可以调用它们,您必须找到解决方法!我无法帮助那部分。

The second problem is finding the right junit test strategy. My advice is the following: if you can avoid it, don't call real web services with junit tests on the client side. Find a way to call your annotated methods from junit tests sitting on the server side. Your unit tests will be more efficient and won't depend on a jaxws client.

第二个问题是找到正确的junit测试策略。我的建议如下:如果可以避免,请不要在客户端使用junit测试调用真正的Web服务。找到一种方法从坐在服务器端的junit测试中调用带注释的方法。您的单元测试将更有效,并且不依赖于jaxws客户端。

#2


0  

I've solved my problem. I use the onboard solution of java6 (Endpoint.publish(..)) to publish the webservice from within junit. It is very easy.

我已经解决了我的问题。我使用java6(Endpoint.publish(..))的板载解决方案从junit中发布web服务。这很容易。