You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by luca rasconi <lr...@yahoo.it> on 2001/08/09 01:19:42 UTC

how to serialize an array of java.lang.String?

hi all,
I've a problem serializing an array of String...let's
hope.
>From soap doc:
"Parameters must bu serialize into XML before they can
transmitted, and so Apache SOAP provides of a number
of pre-defined serilizers which are available...".
And i read that array has a pre-defined serializer...
I've deploied a service which returns an
org.w3c.dom.Element, and should accept as parameter an
array of java.lang.String.

So I wrote this:

...
String request[]=new String[3];
request[0]="a";
request[1]="b";
request[2]="c";
Call call=new Call();
call.setTargetObjectURI(myUrn);
call.setMethodName(myMeth);
call.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);
Vector params= new Vector();
params.addElement(new
Parameter("par",String[].class,request,ConStants.NS_URI_SOAP_ENC));
call.setPrams(params);
Response resp=call.invoke(myurl);
...

When I try to execute this code there's this error:
SOAPException= SOAP-ENV:Client, No Serializer found to
serialize a 'java.lang.String' using 
encoding style
'http://xml.apache.org/xml-soap/literalxml'

The error happen when the client try to serialize the
array of String into XML; this 
because it use litaralxml as enc style.
But i ask me what
'http://xml.apache.org/xml-soap/literalxml' has to do
with java.lang.String when I set for that parameter
another encoding Style?

Initially I thought that errors came from String[]
notation so I translated all as Vector but the 
result is the same.

I don't know!
Is there anybody who can help me?
thank you
Luca

______________________________________________________________________
Do You Yahoo!?
Il tuo indirizzo gratis e per sempre @yahoo.it su http://mail.yahoo.it