users@jax-rpc.java.net

error using DII

From: Fabian Gutierrez <fagossa_at_gmail.com>
Date: Thu, 3 May 2007 17:37:23 -0500

  Hi all,

i'm trying to create a DII client which use document/literal style, but a
can't get it to work.

If a run it as is



*private* *static* String BODY_NAMESPACE_VALUE = "http://servicios.ejemplo.com";

ServiceFactory factory = ServiceFactory.newInstance();
Service service = factory.createService(*new* QName(qnameService));
QName port = *new* QName(qnamePort);
Call call = service.createCall(port);
 call.setTargetEndpointAddress(endpointAddress);call.setProperty(Call.SOAPACTION_USE_PROPERTY,
*new* Boolean(*true*));call.setProperty(Call.SOAPACTION_URI_PROPERTY,
"");//call.setProperty(ENCODING_STYLE_PROPERTY,
URI_ENCODING);call.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY,
    NamespaceConstants.NSURI_SOAP_ENCODING);
 // define parametros
QName qNameParametro = *new* QName(
    "http://servicios.ejemplo.com/consultarTelefonosServiceTypes",
    "tns:ConsultaTelefonosDto");call.addParameter("ConsultaTelefonosDto_1",
qNameParametro, ParameterMode.IN);
 // define tipo retorno
QName qNameTipoRetorno = *new* QName(
    "http://servicios.ejemplo.com/consultarTelefonosServiceTypes",
    "tns:RespuestaConsultaTelefonosDto");call.setReturnType(qNameTipoRetorno);
 call.setOperationName(*new* QName(BODY_NAMESPACE_VALUE, "consultarTelefonos"));

Object[] inParams = *new* Object[] { obtenerObjetoPeticion() };
Object ret = call.invoke(inParams);



i get this

*java.rmi.RemoteException: JAXRPCTIE01: caught exception while handling
request: unrecognized operation:
{**http://servicios.ejemplo.com*<http://servicios.ejemplo.com/>
*}consultarTelefonos
at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:507)
at com.davivienda.procesadortransacciones.performance.SqpClient.main(
SqpClient.java:71)*

An extract of my wsdl is:

<?xml version="1.0" encoding="UTF-8"?><definitions xmlns="
http://schemas.xmlsoap.org/wsdl/" xmlns:tns="
http://servicios.ejemplo.com/consultarTelefonosService" xmlns:ns2="
http://servicios.ejemplo.com/consultarTelefonosServiceTypes" xmlns:xsd="
http://www.w3.org/2001/XMLSchema" xmlns:soap="
http://schemas.xmlsoap.org/wsdl/soap/" name="ConsultarTelefonosService"
targetNamespace="http://servicios.ejemplo.com/consultarTelefonosService">

<types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="
http://servicios.ejemplo.com/consultarTelefonosServiceTypes"
xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="
http://schemas.xmlsoap.org/wsdl/" targetNamespace="
http://servicios.ejemplo.com/consultarTelefonosServiceTypes">

   </schema>
</types>
...


obviously the operation
*{**http://servicios.ejemplo.com*<http://servicios.ejemplo.com/>
*}consultarTelefonos* could not be found, hovewer i generate some stubs with
jbuilder and there was no problem at all, so, it means that the wsdl is fine
and the problem is in the above code, so? what i'm doing wrong?

ps
i'm using jwsdp-1.6. I've already generate stubs to consume this ws and
works perfect, but i really need to use DII.


Best regards,

Fabian