Java 1.6 Maven project with SOAP XML JAX-WS ( WAS Portal 7 ) services to Tomcat Liferay 6.2 GA6 can´t access endpoint

huangapple 未分类评论41阅读模式
英文:

Java 1.6 Maven project with SOAP XML JAX-WS ( WAS Portal 7 ) services to Tomcat Liferay 6.2 GA6 can´t access endpoint

问题

我正在尝试理解我在这里漏掉了什么...需要一些指引。之前我一直在一个遗留系统中开发,这是一个由IBM WAS(Websphere Application Server)Portal 7支持的Maven Java 1.6项目。我并不是从头开始做这个项目的,所以我对它的了解有限。这个项目有/曾经有一个工作中的JAX-WS(SOAP/XML)服务,这些服务可能是生成的,也可能是手动创建的(不清楚)(图1)。这个Web服务接口的实现如下(图2)。

在这个Portal中,如果我访问这个URL,XML模式会显示如图3:

这是为了解释第一部分(如果您需要我展示更多内容来帮助我,请留言)。图片后面是第二部分。顺便说一下,我的IDE是Eclipse Oxygen,带有Tomcat应用服务器。

图1
Java 1.6 Maven project with SOAP XML JAX-WS ( WAS Portal 7 ) services to Tomcat Liferay 6.2 GA6 can´t access endpoint

图2
Java 1.6 Maven project with SOAP XML JAX-WS ( WAS Portal 7 ) services to Tomcat Liferay 6.2 GA6 can´t access endpoint

图3
Java 1.6 Maven project with SOAP XML JAX-WS ( WAS Portal 7 ) services to Tomcat Liferay 6.2 GA6 can´t access endpoint

然后,同样的项目和WAR文件被迁移到了由Tomcat(7)支持的Liferay 6.2 GA6,但是这些Web服务停止工作,或者甚至没有被正确暴露出来,如果我只是将URL从liferay更改为相同的终端点,像这样[ LIFERAYURL_MACHINE/PROJECT_NAME/InternetUser/InternetUser.wsdl ],Liferay会显示找不到。

所以我一直在网上搜索这个问题,我发现Liferay有自己的暴露的Web服务在这个URL中[ http://MACHINE:PORT/api/axis ],就像您在图4中看到的。如果我点击其中一个链接,我会在以下URL中获得wsdl文档[ http://MACHINE:8780/api/axis/Portlet_Bookmarks_BookmarksEntryService?wsdl ]。

图4
Java 1.6 Maven project with SOAP XML JAX-WS ( WAS Portal 7 ) services to Tomcat Liferay 6.2 GA6 can´t access endpoint

问题:
所以我对Liferay非常陌生,我需要一些指引,告诉我需要关注什么,需要去哪里搜索等等,以便暴露这些已经创建的Web服务。我需要重新创建它们吗?使用Liferay工具,我需要某种属性吗?此外,我有图5和图6,如果有帮助的话。

注意:这个项目在Liferay的portlet上运行。

图5
Java 1.6 Maven project with SOAP XML JAX-WS ( WAS Portal 7 ) services to Tomcat Liferay 6.2 GA6 can´t access endpoint

图6
Java 1.6 Maven project with SOAP XML JAX-WS ( WAS Portal 7 ) services to Tomcat Liferay 6.2 GA6 can´t access endpoint

英文:

i'm trying to understand what am i missing here...need some pointers from you guys.
So previously i had been developing in a legacy system in a Maven Java 1.6 Project supported by IBM WAS ( Websphere Aplication Server ) Portal 7. I did not start this project so my knowledge about this is limited and this project had/have a working JAX-WS ( SOAP/XML ) services, that were generated or manually made ( don´t know ) (Fig1). Where the implementation of that Web services Interface is like this ( Fig2. ).

In this Portal if i do this URL the XML Schema apears like Fig3:

This is to explain 1st part ( please do comment if i need to show more things for you to help me ). Second part after pictures. BTW my IDE is Eclipse Oxygen with Tomcat App.Server.

Fig1
Java 1.6 Maven project with SOAP XML JAX-WS ( WAS Portal 7 ) services to Tomcat Liferay 6.2 GA6 can´t access endpoint

Fig2
Java 1.6 Maven project with SOAP XML JAX-WS ( WAS Portal 7 ) services to Tomcat Liferay 6.2 GA6 can´t access endpoint

Fig3
Java 1.6 Maven project with SOAP XML JAX-WS ( WAS Portal 7 ) services to Tomcat Liferay 6.2 GA6 can´t access endpoint

So the same project same WAR file was migrated to Liferay 6.2 GA6 supported by Tomcat ( 7 ) but these WS stopped working or are not even exposed properly, if i type the same URL changing only the liferay URL to the same end point like so [ LIFERAYURL_MACHINE/PROJECT_NAME/InternetUser/InternetUser.wsdl ] , liferay says cannot find obviously.

So i have been searching the web about this and i found out that liferay has its own exposed webservices in this URL [ http://MACHINE:PORT/api/axis ] like you can see in Fig4. If i press in one of does links i get the wsdl in following URL [ http://MACHINE:8780/api/axis/Portlet_Bookmarks_BookmarksEntryService?wsdl ]

Fig4
Java 1.6 Maven project with SOAP XML JAX-WS ( WAS Portal 7 ) services to Tomcat Liferay 6.2 GA6 can´t access endpoint

THE QUESTION UFFFFF:
So i'm very "rookie" to liferay and i'm in need off some pointers on what do i need to focuse in, where do i need to go, to search etc.. regarding exposing these already made webservices.
Do i need to recreate them? Using Liferay tools, do i need a propertie of some kind ? Also i have this Fig5, Fig6. if its any help at all.

Note: This project is running on a portlet for liferay.

Fig5.
Java 1.6 Maven project with SOAP XML JAX-WS ( WAS Portal 7 ) services to Tomcat Liferay 6.2 GA6 can´t access endpoint

Fig6.
Java 1.6 Maven project with SOAP XML JAX-WS ( WAS Portal 7 ) services to Tomcat Liferay 6.2 GA6 can´t access endpoint

答案1

得分: 0

如果我理解正确,您希望将您手动实现的 Webservices 添加到 Liferay 的已发布 WSDL 列表中。我从未尝试过这样做,我可以想象这可能不是 Liferay 检索这些端点的方式。

如果您希望实现这些 Webservices 并希望它们显示在 Liferay 提供的 Webservices 列表中,一种安全的方法是使用 Liferay 的 ServiceBuilder,它将为您提供一些默认功能,其中包括将其列在可用 WSDL 列表中。

英文:

If I understand correctly, you're expecting your (manually implemented) Webservices in Liferay's list of published WSDLs. I've never tried this, and could well imagine that this is not the way that Liferay picks up those endpoints.

A safe way to implement these Webservices if you expect them to show up in Liferay's list of provided webservices is to use Liferay's ServiceBuilder, which will provide you with a couple of default features - among them being listed in the list of available WSDLs.

答案2

得分: 0

  1. 要在Liferay中暴露一个JAX-WS web服务,我使用WSServlet
  2. web.xml中添加:
  3. <servlet>
  4. <servlet-name>WebService</servlet-name>
  5. <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet&lt;/servlet-class&gt;
  6. </servlet>
  7. <servlet-mapping>
  8. <servlet-name>WebService&lt;/servlet-name&gt;
  9. <url-pattern>/CoreService17&lt;/url-pattern&gt;
  10. </servlet-mapping>
  11. <listener>
  12. <listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener&lt;/listener-class&gt;
  13. </listener>
  14. 必须在web.xml附近添加sun-jaxws.xml文件,内容如下:
  15. <?xml version="1.0" encoding="UTF-8"?>
  16. <endpoints version="2.0" xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/jax-ws/ri/runtime http://java.sun.com/webservices/docs/2.0/jaxws/sun-jaxws.xsd">
  17. <endpoint implementation="ru.isands.tyva_portlet.web_service.CorePortType17Impl" name="CoreService17" url-pattern="/CoreService17"/>
  18. </endpoints>
  19. ru.isands.tyva_portlet.web_service.CorePortType17Impl实现了WebService接口:
  20. @WebService(name = "CorePortType17", targetNamespace = "urn://x-artefacts-it-ru/dob/poltava/core/1.7", serviceName = "CoreService17", portName = "CoreEndpoint17")
  21. @HandlerChain(file = "handler-chain.xml")
  22. @XmlSeeAlso({ org.w3._2004._08.xop.include.ObjectFactory.class })
  23. public class CorePortType17Impl implements CorePortType17 {
  24. ...
  25. }
  26. CorePortType17.java
  27. @WebService(name = "CorePortType17", targetNamespace = "urn://x-artefacts-it-ru/dob/poltava/core/1.7")
  28. public interface CorePortType17 {
  29. ...
  30. }
  31. 我的handler-chain.xml文件内容:
  32. <?xml version="1.0" encoding="UTF-8"?>
  33. <handler-chains xmlns="http://java.sun.com/xml/ns/javaee">
  34. <handler-chain>
  35. <handler>
  36. <handler-name>SigningSoapHandler</handler-name>
  37. <handler-class>ru.isands.tyva_portlet.web_service.SigningSoapHandler</handler-class>
  38. </handler>
  39. </handler-chain>
  40. </handler-chains>
  41. public class SigningSoapHandler implements SOAPHandler<SOAPMessageContext> {...}
英文:
  1. To expose a JAX-WS web-service in Liferay I use WSServlet.
  2. In web.xml put:
  3. &lt;servlet&gt;
  4. &lt;servlet-name&gt;WebService&lt;/servlet-name&gt;
  5. &lt;servlet-class&gt;com.sun.xml.ws.transport.http.servlet.WSServlet&amp;lt;/servlet-class&gt;
  6. &lt;/servlet&gt;
  7. &lt;servlet-mapping&gt;
  8. &lt;servlet-name&gt;WebService&amp;lt;/servlet-name&gt;
  9. &lt;url-pattern&gt;/CoreService17&amp;lt;/url-pattern&gt;
  10. &lt;/servlet-mapping&gt;
  11. &lt;listener&gt;
  12. &lt;listener-class&gt;com.sun.xml.ws.transport.http.servlet.WSServletContextListener&amp;lt;/listener-class&gt;
  13. &lt;/listener&gt;
  14. There must be sun-jaxws.xml file near web.xml that contains:
  15. &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  16. &lt;endpoints version=&quot;2.0&quot; xmlns=&quot;http://java.sun.com/xml/ns/jax-ws/ri/runtime&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/jax-ws/ri/runtime http://java.sun.com/webservices/docs/2.0/jaxws/sun-jaxws.xsd &quot;&gt;
  17. &lt;endpoint implementation=&quot;ru.isands.tyva_portlet.web_service.CorePortType17Impl&quot; name=&quot;CoreService17&quot; url-pattern=&quot;/CoreService17&quot;/&gt;
  18. &lt;/endpoints&gt;
  19. Class ru.isands.tyva_portlet.web_service.CorePortType17Impl implements WebService interface :
  20. @WebService(name = &quot;CorePortType17&quot;, targetNamespace = &quot;urn://x-artefacts-it-ru/dob/poltava/core/1.7&quot;, serviceName = &quot;CoreService17&quot;, portName = &quot;CoreEndpoint17&quot;)
  21. @HandlerChain(file = &quot;handler-chain.xml&quot;)
  22. @XmlSeeAlso({ org.w3._2004._08.xop.include.ObjectFactory.class })
  23. public class CorePortType17Impl implements CorePortType17 {
  24. ...
  25. }
  26. CorePortType17.java:
  27. @WebService(name = &quot;CorePortType17&quot;, targetNamespace = &quot;urn://x-artefacts-it-ru/dob/poltava/core/1.7&quot;)
  28. public interface CorePortType17 {
  29. ...
  30. }

My handler-chain.xml:

  1. &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  2. &lt;handler-chains xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot;&gt;
  3. &lt;handler-chain&gt;
  4. &lt;handler&gt;
  5. &lt;handler-name&gt;SigningSoapHandler&lt;/handler-name&gt;
  6. &lt;handler-class&gt;ru.isands.tyva_portlet.web_service.SigningSoapHandler&lt;/handler-class&gt;
  7. &lt;/handler&gt;
  8. &lt;/handler-chain&gt;
  9. &lt;/handler-chains&gt;
  10. public class SigningSoapHandler implements SOAPHandler&lt;SOAPMessageContext&gt; {...}

huangapple
  • 本文由 发表于 2020年4月5日 02:44:26
  • 转载请务必保留本文链接:https://java.coder-hub.com/61033088.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定