This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Web Services and the fly likes Deserialization Exception while using string[] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Deserialization Exception while using string[]" Watch "Deserialization Exception while using string[]" New topic

Deserialization Exception while using string[]

sudheshna Iyer
Ranch Hand

Joined: Aug 20, 2004
Posts: 71
I am using dynamic stubs to invoke web service that returns String[].

I am having the problem:

javax.xml.rpc.JAXRPCException: failed to invoke operation 'getXXX' due to an error in the soap layer (SAAJ); nested exception is: Message[failed to deserialize xml:weblogic.xml.schema.binding.DeserializationException: mapping lookup failure for xml type ['java:language_builtins.lang']:ArrayOfString and java interface javax.xml.soap.SOAPElement]StackTrace[

Here is the code:
// Setup the global JAX-RPC service factory
System.setProperty( "javax.xml.rpc.ServiceFactory",

// create service factory
ServiceFactory factory = ServiceFactory.newInstance();

// define qnames
String targetNamespace = "http://localhost:7001/SaWS";

QName serviceName =
new QName(targetNamespace,

QName portName =
new QName(targetNamespace,

QName operationName = new QName(targetNamespace,

URL wsdlLocation =
new URL("http://localhost:7001/SaWS/SaWSURI?wsdl");

// create service
Service service = factory.createService(wsdlLocation, serviceName);

Call call = service.createCall(portName, operationName);

TypeMappingRegistry registry = service.getTypeMappingRegistry();

TypeMapping typemapping = registry.getTypeMapping(SOAPConstants.URI_NS_SOAP_ENCODING);

new QName("", "ArrayOfString"),
new language_builtins.lang.ArrayOfStringCodec(),
new language_builtins.lang.ArrayOfStringCodec()

String cust_number = "40230505";
Object[] res = (Object[]) call.invoke(new Object[]{cust_number} );
System.out.println( "res.length : " + res.length );
I agree. Here's the link:
subject: Deserialization Exception while using string[]
It's not a secret anymore!