简体   繁体   中英

Deploying SOAP web-service on JBOSS 6.1.0

I use JBOSS final 6.1.0 on RHEL and have no problems with deploying servlets on server. But when trying to deploy SOAP web-service I can't find it in http://[serverName]:8080/jbossws/ . First of all I created dynamic web project SoapTestService for JBOSS 6.1.0 server and wrote simple web-service:

package com.glowbyte.soapWS;

import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;

@WebService
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class TestSoapService
{
    @WebMethod
    public int add(int x)
    {
        return x+1;
    }
}

I export project to TestSoapService.war file, put this war to [PathToJBOSS]/jboss-6.1.0.Final/server/default/deploy and restarted Jboss server.

After restarting I analyze http://[ServerName]:8080/jbossws/ => View a list of deployed services and found There are currently no endpoints deployed .

Explain please why I can't deploy the service.

The problem is resolved by adding web.xml to WEB-INF directory with following contents:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
  <display-name>SoapTestService</display-name>
   <servlet>
    <servlet-name>TestSoapService</servlet-name>
    <servlet-class>com.glowbyte.soapWS.TestSoapService</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>TestSoapService</servlet-name>
    <url-pattern>/TestSoapService</url-pattern>
  </servlet-mapping>
</web-app>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM