English 中文(简体)
重大过失:“服务部门必须具有公众作为进入Modifier”
原标题:Axis fault: "Service class must have public as access Modifier"

I am trying to build a simple Web Service. I follow this tutorial and it works just fine.

但当我改为为<代码>建立接口时。 Converter category, Eclipse auto included both IConverter.nal and Converter.nal, but when I conducted test, it persistent re this result:

<soapenv:Reason>
    <soapenv:Text xml:lang="en-US">
        Service class wtp.IConverter must have public as access Modifier
    </soapenv:Text>
</soapenv:Reason>

我在《召集人守则》及其方法中有着公开的关键词。

这里是我的 j。

接口:

package wtp;
public interface IConverter {
    public float celToF(float cel);
    public float fToCel(float f);
}

执行:

package wtp;

public class Converter implements IConverter {

    @Override
    public float celToF(float cel) {
        return cel * 9 / 5 + 32;
    }

    @Override
    public float fToCel(float f) {
        return (f - 32) * 5 / 9;
    }
}

服务:

<service name="IConverter">
    <Description>
        Test ws
    </Description>
    <messageReceivers>
        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
    </messageReceivers>
    <parameter name="ServiceClass" locked="false">wtp.IConverter
    </parameter>
</service>

web.xml:

<?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" xmlns:web="http://java.sun.com/xml/ns/javaee web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
    <display-name>TestWS</display-name>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
        <welcome-file>/axis2-web/index.jsp</welcome-file>
    </welcome-file-list>
    <servlet>
        <display-name>Apache-Axis Servlet</display-name>
        <servlet-name>AxisServlet</servlet-name>
        <servlet-class>org.apache.axis2.transport.http.AxisServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>AxisServlet</servlet-name>
        <url-pattern>/servlet/AxisServlet</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>AxisServlet</servlet-name>
        <url-pattern>*.jws</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>AxisServlet</servlet-name>
        <url-pattern>/services/*</url-pattern>
    </servlet-mapping>
    <servlet>
        <display-name>Apache-Axis Admin Servlet Web Admin</display-name>
        <servlet-name>AxisAdminServlet</servlet-name>
        <servlet-class>org.apache.axis2.transport.http.AxisAdminServlet</servlet-class>
        <load-on-startup>100</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>AxisAdminServlet</servlet-name>
        <url-pattern>/axis2-admin/*</url-pattern>
    </servlet-mapping>
</web-app>

How can I solve this problem?

问题回答

页: 1 轴2正试图利用思考来创建你服务类别的例子。 服务参数定义如下:

<parameter name="ServiceClass" locked="false"> wtp.Converter </parameter>




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签