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

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

问题描述

我目前正在尝试让我的应用程序提供网络服务.该应用程序使用 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.

我按照合同优先"的方法构建了网络服务.所以我基本上拥有的是一个生成的 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 提供一个 webservice 描述符并不是必不可少的,但 Weblogic 有时无法识别 WebServices(无法找到原因))

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天全站免登陆