0
votes

I have Tomcat 5.5 + Axis2 1.5.5 + 2 servlets running. One of my servlet is a custom servlet that runs axis2 too. I have WEB-INF and all subdirectories under it (conf, lib, services and modules).

Now, one of my class is EntityWebService which is the one supposed to be exposed as a WS. So i have made this services.xml file :

<service name="EntityWebService" scope="application">
    <description>
    service web sur les entites
    </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">com.webservice.EntityWebService</parameter>
 </service>  

This one throws this :

 <soapenv:Reason>
<soapenv:Text xml:lang="en-US">
The service cannot be found for the endpoint reference (EPR) /myServlet/services/EntityWebService/getEntityList
</soapenv:Text>
</soapenv:Reason>

I had also tried a simpler one :

<service name="EntityWebService">
    <description>Web Service</description>
    <parameter name="ServiceClass" locked="xsd:false">com.webservice.EntityWebService
    </parameter>
    <operation name="getEntityList">
        <messageReceiver
            class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver" />
    </operation>
    <operation name="getEntityDescription">
        <messageReceiver
            class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver" />
    </operation>
    <operation name="searchInstanceEntity">
        <messageReceiver
            class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver" />
    </operation>
    <operation name="entityWriter">
        <messageReceiver
            class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver" />
    </operation>
</service>

This one throws the same too.

Both of these xml are supposed (at least it's what i understood from all web stuff) to expose these methods :

  • public OMElement getEntityDescription(String entityName)
  • public OMElement getEntityList()
  • public OMElement searchInstanceEntity(String login, String password, String role, String entityName, String property, String criteria)
  • public OMElement entityWriter(String login, String password, String role,String entityName, String actionType, String property)

Ideally i want to call these methods directly from my URL like :

http://localhost:8080/myServlet/services/EntityWebService/searchInstanceEntity?login=jmm&password=jmm&role=AdminRol&entityName=beans.Personnel.Salarie&property=all&criteria=null

I have made EntityWebService class like this so it can run with WS standards :

package com.webservice;

[imports]

@WebService
public class EntityWebService extends AbstractWebService
{


    @WebMethod
    public OMElement getEntityList(OMElement e) throws RemoteException
    {
               [...]

    }

    @WebMethod
    public OMElement getEntityDescription(OMElement omEntityParam) throws RemoteException
    {
               [...]
    }

    @WebMethod
    public OMElement searchInstanceEntity(OMElement omParam) throws RemoteException
    {
        [...]
    }

    @WebMethod
    public OMElement entityWriter(OMElement omParam) throws RemoteException
    {
        [...]
    }

    @Override
    public String getServiceName()
    {
        return "EntityWebService";
    }

}

Now my question. How can I expose my 4 methods with URL encoded parameter enabled?

My configuration doesn't work, seems like I'm missing something. I've managed once to make them callable but without parameters input. I retrieved Axis2.xml from last 1.5.5 release but no better results. We had an old configuration which worked with RPC messaging and XML but i wanted to get rid of AAR containers. I have a friend who have the XMLInOut messaging services.xml i showed you above and it works for him. He just made a directory under services like this : /myServlet/services/EntityWebService/META-INF/services.xml

Help me please, I need this for my work. thx

1

1 Answers

0
votes

Apparently, upgrading Axis2 config and using 1.6 axis release solved the problem. dunno how and why but whatever...