Re: [wscompile] invalid entity name

From: Clinton <>
Date: Mon, 5 Sep 2005 09:24:20 +0000 (UTC)

Anne Thomas Manes <atmanes <at>> writes:

> IIRC, DII does not support complex types.
> One other fix to your original WSDL -- you must add
> <soap:binding> and <soap:operation> elements to your
> binding definition.
> Anne

Hi Anne

Thank you for the response. I did manage to get the DII client call (with
complexType) to work although it is strictly not dynamic anymore because I had
to include the complexType Class(AccountAge) in the client side src, and then
made the rpc call as follows:

    String endpoint = "http://localhost:8080/jaxrpc-Dorado/dorado";
    String namespace = "http://dorado/wsdl/";
    String typesNamespace = "http://dorado/types/";
    String schemaNamespace = "";
    String serviceName = "DoradoService";

ServiceFactory factory = ServiceFactory.newInstance();
Service service = factory.createService(new QName(namespace, serviceName));
QName accountAgeQname = new QName(typesNamespace, "AccountAge");
TypeMappingRegistry registry = service.getTypeMappingRegistry();
TypeMapping typeMapping = registry.createTypeMapping();
CombinedSerializer serializer = new AccountAge_SOAPSerializer(accountAgeQname,
    true, true, SOAPConstants.URI_SOAP_TRANSPORT_HTTP);
serializer = new ReferenceableSerializerImpl(true, serializer);
SerializerFactory serializerFactory = new SingletonSerializerFactory(serializer);
DeserializerFactory deserializerFactory = new
typeMapping.register(AccountAge.class, accountAgeQname, serializerFactory,
Call call = service.createCall(
        new QName(namespace, "DoradoIFPort"),
        new QName(namespace, "getAccountAge"));
call.addParameter("String_1", XMLType.XSD_STRING, ParameterMode.IN);
call.setReturnType(accountAgeQname, AccountAge.class); //This is dodgey
Object[] in = new Object[] {accountNo};
return (AccountAge) call.invoke(in);

This is a bit ugly and I wanted to try rather using static stubs, however I have
another problem here. The server side responds correctly, but the rpc call is
being made from inside an EJB and the result is a NotSeralizableException. The
problem here is that the complexType being created on the client side by
WSCompile is not serializable anymore, so it is infact the ejb responding to the
client that is throwing the exception. Basically I need to know if WSCompile can
create the client side complexType object so that it still implements
Serializable (the class on the server side does) ... or is there another way to
go about this.

Thanks in advance