You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@ws.apache.org by Deepak Patil <de...@centegy.com> on 2000/08/09 05:02:52 UTC
Array of object serialization....
Hi,
Have anyone used the ArraySerializer to serialize an Object Array....
My Code is as below....
ArraySerializer aSer = new ArraySerializer();
Object[] data = new String[2];
data[0] = new String("Deepak");
data[1] = new String("Patil");
smr.mapTypes(Constants.NS_URI_SOAP_ENC,
new QName("urn:ibm-soap-test-demo",
"Array"),
Object[].class, aSer, aSer);
Vector params = new Vector();
params.addElement(new Parameter("rootElement",
Object[].class, (Object[]) data, Constants.NS_URI_SOAP_ENC));
// Build the call.
Call call = new Call();
call.setSOAPMappingRegistry(smr);
call.setTargetObjectURI("urn:myDecoderNew");
call.setMethodName("decodeMessage");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
call.setParams(params);
// Invoke the call.
Response resp;
try
{
resp = call.invoke(url, "");
}
But getting an exception :
[SOAPException: faultCode=SOAP-ENV:Server; msg=Argument is not an array;
targetException=java.lang.I
llegalArgumentException: Argument is not an array]
Any help !!!
Thanks
Deepak