Skip to main content

How can I do a WS using JAX-WS than works in an Axis Client?

Please note these forums are being decommissioned and use the new and improved forums at
1 reply [Last post]
Joined: 2013-06-26

Hi everybody...

I'm trying to do a simple Hello World Web Service using JAX-WS than can be called by an Axis 1.4 client... I'm working with Netbeans 7.3 and a got this.


import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;

@WebService(serviceName = "HolaMundo")
public class HolaMundo {

@WebMethod(operationName = "hello")
public String hello(@WebParam(name = "name") String txt) {
return "Hello " + txt + " !";

When I browse the URL for WS (http://localhost:8084/HolaMundo/HolaMundo?wsdl) I got something like this:

Published by JAX-WS RI at RI's version is JAX-WS RI 2.2-hudson-740-.
Generated by JAX-WS RI at RI's version is JAX-WS RI 2.2-hudson-740-.
<definitions xmlns:wsu="" xmlns:wsp="" xmlns:wsp1_2="" xmlns:wsam="" xmlns:soap="" xmlns:tns="" xmlns:xsd="" xmlns="" targetNamespace="" name="HolaMundo">
<xsd:import namespace="" schemaLocation="http://localhost:8084/HolaMundo/HolaMundo?xsd=1"/>
<message name="hello">
<part name="parameters" element="tns:hello"/>
<message name="helloResponse">
<part name="parameters" element="tns:helloResponse"/>
<portType name="HolaMundo">
<operation name="hello">
<input wsam:Action="" message="tns:hello"/>
<output wsam:Action="" message="tns:helloResponse"/>
<binding name="HolaMundoPortBinding" type="tns:HolaMundo">
<soap:binding transport="" style="document"/>
<operation name="hello">
<soap:operation soapAction=""/>
<soap:body use="literal"/>
<soap:body use="literal"/>
<service name="HolaMundo">
<port name="HolaMundoPort" binding="tns:HolaMundoPortBinding">
<soap:address location="http://localhost:8084/HolaMundo/HolaMundo"/>

A few of customers has Axis 1.4 client's to comsume the Web service... like this.

package clientews; 
import org.apache.axis.client.Call; 
import org.apache.axis.client.Service; 
public class cliente { 
    public cliente() { 
    public static String consumir(Object[] parametros){ 
        String regresar = null; 
        Service service = null;    
        Call call       = null; 
        String endpoint = null; 
        try { 
          endpoint = "http://localhost:8084/HolaMundo/HolaMundo";          
          service = new Service(); 
          call = (Call) service.createCall(); 
        }// try 
        catch (Exception e) { 
        }// catch 
        finally { 
          return regresar; 
        }// finally 
    public static void main(String[] args) { 
        try {            
            String parametro = "Jos

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2013-06-26

Hi everybody...

I find a possible solution for my problem, but it isn't exactly what I want...

In this page I find another way to invoce the Web Service from Axis 1.4 client:

ie instead of doing this:


Must do especify the namespace in the constuctor, like this:

call.setOperationName(new QName("http://localhost:8988/Pruebas/services/HolaMundo", "hello"));

However, this solution means that customers who consume the web service have to modify their code, which is not feasible at all.

The question remains the same, is there any way to modify the Web Service to be called from Axis 1.4 client without having to make any changes?

Best Regards