在JBOSS EJB Service中调用Web服务时出现问题 [英] Problem calling web service from within JBOSS EJB Service

查看:102
本文介绍了在JBOSS EJB Service中调用Web服务时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我们的内部网络上有一个简单的Web服务.我使用SOAPUI进行了一些测试,从WSDL生成了服务类,并编写了一些Java代码来访问服务.正如我能够创建服务代理类和进行调用一样,一切都按预期进行.很简单的东西.唯一的障碍是让Java信任来自提供Web服务的计算机的证书.那不是技术问题,而是我缺乏基于SSL的Web服务的经验. 现在到我的问题.我编写了一个简单的EJB服务并将其部署到JBoss Application Server 4.3中,现在在以前有效的代码中收到以下错误.

I have a simple web service sitting on our internal network. I used SOAPUI to do a bit of testing, generated the service classes from the WSDL , and wrote some java code to access the service. All went as expected as I was able to create the service proxy classes and make calls. Pretty simple stuff. The only speed bump was getting java to trust the certificate from the machine providing the web service. That was not a technical problem, but rather my lack of experience with SSL based web services. Now onto my problem. I coded up a simple EJB service and deployed it into JBoss Application Server 4.3 and now get the following error in the code that previously worked.

12:21:50,235 WARN  [ServiceDelegateImpl] Cannot access wsdlURL: https://WS-Test/TestService/v2/TestService?wsdl

我可以使用错误消息中的URL从与应用程序服务器在同一台机器上运行的Web浏览器访问wsdl文件.我还可以在与应用程序服务器相同的机器上(而不是从内部)运行在应用程序服务器外部访问Web服务的代码.我对从这里去哪里不知所措.我打开了JBOSS中的调试日志,只得到上面显示的内容.我已经在网上进行了一些搜索,但在某些问题中发现了相同的错误,但是这些问题没有答案. Web服务类是使用wsimport ant任务通过JAX-WS 2.2生成的,并放置在ejb包中包含的jar中. JBoss部署在RHEL 5.4中.我将此内容发布在 JBOSS社区论坛上,但截至本文撰写时尚未收到任何回复.

I can access the wsdl file from a web browser running on the same machine as the application server using the URL in the error message. I can also run the code that access the webservice outside of the application server on the same machine as the application server ( just not from within ). I am at a loss as to where to go from here. I turned on the debug logs in JBOSS and got nothing more than what I showed above. I have done some searching on the net and found the same error in some questions, but those questions had no answers. The web services classes where generated with JAX-WS 2.2 using the wsimport ant task and placed in a jar that is included in the ejb package. JBoss is deployed in RHEL 5.4. I posted this on the JBOSS community forum but have had no responses as of this writing.

推荐答案

看看它尝试做的ServiceDelegateImpl:

Having a look at ServiceDelegateImpl it tries to do:

InputStream是= wsdlURL.openStream();

InputStream is = wsdlURL.openStream();

其中wsdlURL是非null的URL.这意味着问题出在openStream()上.我希望问题出在https根证书上.我可以想象JBoss在某个地方拥有自己的可接受的根证书存储,而您的根不在其中.

where wsdlURL is a non-null URL. That means the trouble lies in the openStream(). I expect the problem to be with the https root certificate; I can imagine that JBoss has it's own store of acceptable root certificates somewhere, and that your root is not in there.

我要测试的是将服务部署在HTTP服务器上,并将wsdlURL设置为http URL.如果可行,那就是SSL层.

What I would do to test this is to deploy the service on a HTTP server, and make the wsdlURL a http URL. If that works, it's the SSL layer.

如果它是SSL层,请尝试通过在命令行上对其进行定义来手动添加keyStore,就像在

If it is the SSL layer, try to manually add a keyStore, by defining it on the command line, like in the answer to this SO question.

这篇关于在JBOSS EJB Service中调用Web服务时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆