0
votes

I am trying to create a Webservice implementation deployed on a WebSphere 8.5 application server. I already created the skeleton and all the stubs but I don't know how to package my application. I noticed that using axis2-wsdl2code-maven-plugin a services.xml file is created and this should replace the old WSDD file from axis1. However I don't know where should I place the services.xml and how to set web.xml (if it is needed).

Everything should be packaged in a simple war file.

I cannot find any simple documentation for this.

UPDATE: I was able to deploy my application but I cannot reach neither the service nor its wsdl (the WSDL is not present inside the archive).

When I'm trying to reach my webservice i get:

org.apache.axis2.AxisFault: The service cannot be found for the endpoint reference

I have the following services.xml file, located under WEB-INF/services fodler of my WAR archive.

<?xml version="1.0" encoding="UTF-8"?><!-- This file was auto-generated from WSDL --><!-- by the Apache Axis2 version: 1.6.2  Built on : Apr 17, 2012 (05:33:49 IST) --><serviceGroup>
    <service name="PagamentoBollettinoPostaleInf">
        <messageReceivers>
            <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="myservice.PagamentoBollettinoPostaleInfMessageReceiverInOut"/>
        </messageReceivers>
        <parameter name="ServiceClass">myservice.PagamentoBollettinoPostaleInfSkeleton</parameter>
        <parameter name="useOriginalwsdl">true</parameter>
        <parameter name="modifyUserWSDLPortAddress">true</parameter>
        <operation name="getPagamentoBollettinoPostaleInf" mep="http://www.w3.org/ns/wsdl/in-out" namespace="******">
            <actionMapping>urn:getPagamentoBollettinoPostaleInf</actionMapping>
            <outputActionMapping>urn:getPagamentoBollettinoPostaleInfResponse</outputActionMapping>
        </operation>
    </service>
</serviceGroup>

This is my WEB.XML file:

<?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" version="3.0">
    <display-name>inviaAnomalia</display-name>
    <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>
</web-app>

This is the endpoint i am trying to connect to: http://localhost:9080/war_context_root/services/PagamentoBollettinoPostaleInf


This happens when I try to get the WSDL file of my webservice by connecting to: http://localhost:9080/war_context_root/services/PagamentoBollettinoPostaleInf?wsdl

404 error

1
If you'd like to use jax-ws instead of axis2, there are samples that can be downloaded here: ibm.com/support/knowledgecenter/SSAW57_8.5.5/…Bruce T.
Unfortunately I cannot change the technology. SOAP clients made with axis2 already exist and they must interact correctly.Francesco Rizzi
A possibility is that since WAS bundles axis2 (for jaxws purposes) it might be interfering. It can be partially disabled, that might be worth a try. That's explained here ibm.com/support/knowledgecenter/SSEQTP_8.5.5/…Bruce T.

1 Answers

2
votes

SOLVED

The solution was to follow the steps shown here: http://maksim.sorokin.dk/it/2011/01/13/axis2-maven-servlets-tomcat/

Then, in order to deploy correctly, WSDL and services.xml descriptor file must be placed inside:

WEB-INF/services/<ServiceName>/META-INF

Furthermore, disabling IBM JAX-WS Engine as suggested by Bruce T. and setting the classloader as shown in the following image solved the issue.

enter image description here