This discussion is archived
0 Replies Latest reply: Apr 29, 2008 8:56 AM by 807574 RSS

WS and format

807574 Newbie
Currently Being Moderated
Hi,

after too much time searching by myself, i'm throw a bottle...

I must request on a Web Service (provided by a partner) and i have an error :
Le s�rialiseur/d�s�rialiseur pour le num�ro de param�tre : 0, nomm� : "{http://schemas.xmlsoap.org/soap/encoding/}string", type : "{http://schemas.xmlsoap.org/soap/encoding/}string", est ambigu car sa classe n'a pas pu �tre d�termin�e
that's mean, in an approximative english : the serializer for the parameter (QName) "{http://schemas.xmlsoap.org/soap/encoding/}string" is ambiguous because the class cannot be determinated.

Here, is my code :
String endpoint = "http://www.bvint.e-teamlog.com/WS_BvEnt/WS_Mailsparameters.asmx?WSDL";
String qnameService = "WS_MailsParameters";
String qnamePort = "WS_MailsParametersSoap";
String BODY_NAMESPACE_VALUE = "http://bv.rhone-alpes.fr/";
String ENCODING_STYLE_PROPERTY = "javax.xml.rpc.encodingstyle.namespace.uri";
String DOCUMENT = "javax.xml.rpc.soap.operation.style";
String NS_XSD = "http://www.w3.org/2001/XMLSchema";
String URI_ENCODING = "http://schemas.xmlsoap.org/soap/encoding/";

QName operationName = new QName(BODY_NAMESPACE_VALUE,"GetMailsParameters");
QName portName = new QName(BODY_NAMESPACE_VALUE, "WS_MailsParametersSoap");
        
ServiceFactory factory = ServiceFactory.newInstance();
Service service = factory.createService(new QName(qnameService));

QName port = new QName(qnamePort);

//create JAX-RPC Call using JAX-RPC Service's createCall() method.
Call call = service.createCall(portName);

// Configure your Call instance with its setter methods
call.setTargetEndpointAddress(endpoint);

call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
call.setProperty(Call.SOAPACTION_URI_PROPERTY, "http://bv.rhone-alpes.fr/GetMailsParameters/");
call.setProperty(Call.OPERATION_STYLE_PROPERTY, "document");
call.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY, "");
                
QName QNAME_TYPE_STRING = new QName("GetMailsParametersResponse", "string");
                
call.setReturnType(javax.xml.rpc.encoding.XMLType.SOAP_STRING);//QNAME_TYPE_STRING
call.setOperationName(operationName);

call.addParameter("Login", QNAME_TYPE_STRING, ParameterMode.IN);
call.addParameter("Password", QNAME_TYPE_STRING, ParameterMode.IN);
call.addParameter("Etablissement", QNAME_TYPE_STRING, ParameterMode.IN);
String[] params = { "<user>","<passwd>","<org>" };

// Invoke the WS operation using the JAX-RPC Call's invoke method
Object result = (String) call.invoke(params);
I have try so much possibilities than i don't know what to do now.
The error is around the line :
call.setReturnType(javax.xml.rpc.encoding.XMLType.SOAP_STRING);//QNAME_TYPE_STRING
Note that this Web Service is an asmx...
anyone have an idea ???
what's wrong ?

Thanks,
Philippe