Hola de nuevo chuidiang:
Código:
Ese mismo cliente de axis debería debería servirte para invocar un web service hecho con cualquier otra herramienta (jax-ws).
Ese es el detalle... que el cliente AXIS no funciona para invocar el WS de JAX-WS...
Me explico... El ws que estoy tratando de invocar es bastante sencillo, es de hecho el ejemplo "HolaMundo" que viene por defecto... mi clase la tengo definida así:
Código Java:
Ver originalpackage mx.org.ws.publicar;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;
@WebService(serviceName = "HolaMundo")
public class HolaMundo {
@WebMethod(operationName = "hello")
return "Hello " + txt + " !";
}
}
Al traer el WSDL (
http://localhost:8084/HolaMundo/HolaMundo?wsdl)
me muestra lo siguiente:
Código XML:
Ver original<!--
Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2-hudson-740-.
-->
<!--
Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2-hudson-740-.
-->
<definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://publicar.ws.org.mx/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://publicar.ws.org.mx/" name="HolaMundo">
<types>
<xsd:schema>
<xsd:import namespace="http://publicar.ws.org.mx/" schemaLocation="http://localhost:8084/HolaMundo/HolaMundo?xsd=1"/>
</xsd:schema>
</types>
<message name="hello">
<part name="parameters" element="tns:hello"/>
</message>
<message name="helloResponse">
<part name="parameters" element="tns:helloResponse"/>
</message>
<portType name="HolaMundo">
<operation name="hello">
<input wsam:Action="http://publicar.ws.org.mx/HolaMundo/helloRequest" message="tns:hello"/>
<output wsam:Action="http://publicar.ws.org.mx/HolaMundo/helloResponse" message="tns:helloResponse"/>
</operation>
</portType>
<binding name="HolaMundoPortBinding" type="tns:HolaMundo">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="hello">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="HolaMundo">
<port name="HolaMundoPort" binding="tns:HolaMundoPortBinding">
<soap:address location="http://localhost:8084/HolaMundo/HolaMundo"/>
</port>
</service>
</definitions>
Es decir, el WS está activo y funcionando... al tratar de utilizar el cliente AXIS desde JDeveloper 10g, lo hago de la siguiente manera:
Código Java:
Ver originalpackage clientews;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
public class cliente {
public cliente() {
}
Service service = null;
Call call = null;
try {
endpoint = "http://localhost:8084/HolaMundo/HolaMundo";
service = new Service();
call = (Call) service.createCall();
call.
setTargetEndpointAddress(new java.
net.
URL(endpoint
)); call.setOperationName("hello");
regresar
=String.
valueOf(call.
invoke(parametros
)); }// try
e.printStackTrace();
}// catch
finally {
return regresar;
}// finally
}
public static void main
(String[] args
) { try {
System.
out.
println("respuesta: --->" + respuesta
); System.
err.
println(e.
toString()); }
}
}
Sin embargo, al ejecutar la clase, me está arrojando el siguiente error:
Código:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
faultSubcode:
faultString: Cannot find dispatch method for {}hello
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:Cannot find dispatch method for {}hello
Este mismo método, publicado en AXIS 1.4 lo tengo de la siguiente manera:
Código Java:
Ver originalpackage mx.org.ws.publicar;
public class HolaMundo {
public HolaMundo() {
}
/**
* @webmethod
*/
return "Hello " + txt + " !";
}
}
al traer su WSDL (
http://localhost:8988/Pruebas/services/HolaMundo?wsdl) me trae lo siguiente:
Código XML:
Ver original<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://localhost:8988/Pruebas/services/HolaMundo" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:intf="http://localhost:8988/Pruebas/services/HolaMundo" targetNamespace="http://localhost:8988/Pruebas/services/HolaMundo">
<!--
WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)
-->
<message name="helloRequest">
<part name="txt" type="xsd:string"/>
</message>
<message name="helloResponse">
<part name="helloReturn" type="xsd:string"/>
</message>
<portType name="HolaMundo">
<operation name="hello" parameterOrder="txt">
<input name="helloRequest" message="impl:helloRequest"/>
<output name="helloResponse" message="impl:helloResponse"/>
</operation>
</portType>
<binding name="HolaMundoSoapBinding" type="impl:HolaMundo">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="hello">
<wsdlsoap:operation soapAction=""/>
<input name="helloRequest">
<wsdlsoap:body use="encoded" namespace="http://publicar.ws.org.mx" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output name="helloResponse">
<wsdlsoap:body use="encoded" namespace="http://localhost:8988/Pruebas/services/HolaMundo" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="HolaMundoService">
<port name="HolaMundo" binding="impl:HolaMundoSoapBinding">
<wsdlsoap:address location="http://localhost:8988/Pruebas/services/HolaMundo"/>
</port>
</service>
</definitions>
Al utilizar el cliente de AXIS, cambiando la URL, si hace la invocación y funciona perfectamente:
Código Java:
Ver originalpackage clientews;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
public class cliente {
public cliente() {
}
Service service = null;
Call call = null;
try {
endpoint = "http://localhost:8988/Pruebas/services/HolaMundo";
service = new Service();
call = (Call) service.createCall();
call.
setTargetEndpointAddress(new java.
net.
URL(endpoint
)); call.setOperationName("hello");
regresar
=String.
valueOf(call.
invoke(parametros
)); }// try
e.printStackTrace();
}// catch
finally {
return regresar;
}// finally
}
public static void main
(String[] args
) { try {
System.
out.
println("respuesta: --->" + respuesta
); System.
err.
println(e.
toString()); }
}
}
el resultado es
Código:
respuesta: --->Hello José !
Por lo tanto, lo que me dices de que el cliente de AXIS debería servir para invocar cualquier otro servicio es incorrecto


No sé si en realidad estoy haciendo algo mal... la verdad es que estoy bastante perdido con este problema.
Saludos y espero que me puedas echar la mano con alguna pista.
Leo.