WebService不是“可见的”。在WebLogic 10.3中 [英] WebService is not "visible" in WebLogic 10.3

查看:128
本文介绍了WebService不是“可见的”。在WebLogic 10.3中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试让我的应用程序提供Web服务。
应用程序使用spring并在Weblogic 10.3实例下运行。

I am currently trying to let my application provide a webservice. The application uses spring and is running under a Weblogic 10.3 instance.

我按照合同优先的方法构建了web服务。
所以我基本上有一个生成的WS-Interface,我对该接口的实现,定义servlet绑定的web.xml和定义端点的sun-jaxws.xml。
(或多或少类似于: http://www.mkyong.com/webservices/jax-ws/deploy-jax-ws-web-services-on-tomcat/ )。

I built the webservice following the "contract first" approach. So what I basicaly have is a generated WS-Interface, my implementation of that interface, a web.xml defining the servlet-bindings and a sun-jaxws.xml defining the endpoint. (more or less similar to this: http://www.mkyong.com/webservices/jax-ws/deploy-jax-ws-web-services-on-tomcat/).

现在,在将我的应用程序部署到weblogic之后,实际上一切都很好。
我可以在我的浏览器中输入WebService的URL,我看到了WSDL,我可以调用它的方法。
如果这不是一个小的化妆品事实:
在WL的部署概述中,当我点击部署时,它会显示一个WebServices列表...它是空的。所以我的网络服务没有在那里列出。

Now, after deploying my application to weblogic, actualy everything is workign fine. I can type the URL of the WebService into my browser, I see the WSDL, I can call it's methods. If the weren't a small cosmetic fact: In the deployments overview of WL when I click on the deployment, it shows me a list of WebServices...which is empty. So my webservice is NOT listed there.

那么,有谁能告诉我,我必须做些什么才能让网络服务出现在那里?

So, can anyone tell me, what I have to do to get the webservice to show up there?

推荐答案

虽然为JAX-WS提供Web服务描述符并不是必不可少的,但Weblogic有时无法识别Web服务(无法找到原因)对于这个)

Though it's not really essential to have a webservice descriptor for JAX-WS, Weblogic at times fails to identify the WebServices(was not able to find a reason for this)

以下是我为使其工作所做的工作。在Web.xml中将WebService实现类添加为Servlet

Below is what I did to get it working. Add the WebService implementation class as a Servlet in web.xml

<?xml version='1.0' encoding='UTF-8'?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" id="WebApp_ID">
  <display-name>MyWebService</display-name>
  <servlet>
    <servlet-name>serviceServlet</servlet-name>
    <servlet-class>com.aneesh.WebServiceImpl</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>serviceServlet</servlet-name>
    <url-pattern>/Service</url-pattern>
  </servlet-mapping>
</web-app>

并添加webservice描述符(webservices.xml)

and add the webservice descriptor (webservices.xml)

<?xml version='1.0' encoding='UTF-8'?>
<webservices xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1">
  <webservice-description>
    <webservice-description-name>MyWebService</webservice-description-name>
    <port-component>
      <port-component-name>MyWebServiceSoapPort</port-component-name>
      <wsdl-port xmlns:an="http://www.aneesh.com/service">an:MyWebServiceSoapPort</wsdl-port>
      <service-endpoint-interface>com.aneesh.WebService</service-endpoint-interface>
      <service-impl-bean>
        <servlet-link>serviceServlet</servlet-link>
      </service-impl-bean>
    </port-component>
  </webservice-description>
</webservices>

这篇关于WebService不是“可见的”。在WebLogic 10.3中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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