Skip to main content

Complex Objects & JWSDP

1 reply [Last post]
aanecito
Offline
Joined: 2005-09-24

Hi All,

It seems as if JWSDP does not support Complex Objects even vectors without registering the object. For example I have an app that when using wscompile creates ArrayOf_anyType and when I try to connect to the service the client throws and exception about not having ArrayOf_anyType not being registered. I try registering the ArrayOf_anyType but it seems as if it is not recognized by JWSDP. Is there something obvious I am missing?? Is the registration supposed to be on the server side? Lack of examples beyond simple strings on the web for JWSDP is not good for the project. I am about to switch back to Axis becuase it works better with complex objects.

Below is the client code for registering the object. Perhaps someone can point out why JWSDP is not acknowledging the registration.

I am using JWSDP 1.6 with JDK 1.5 update 4.

QName qn = new QName("http://localhost:8080/wsdl", "ArrayOf_xsd_anyType");

CombinedSerializer anyTypeSerializer = new ArrayOf_xsd_anyType_LiteralSerializer(qn, SOAPConstants.NS_SOAP_ENCODING, SerializerConstants.ENCODE_TYPE );
anyTypeSerializer = new ReferenceableSerializerImpl(SerializerConstants.SERIALIZE_AS_REF, anyTypeSerializer);

//CombinedSerializer anyTypeSerializer = new SimpleTypeArraySerializer(qn,SOAPConstants.NS_SOAP_ENCODING, SerializerConstants.ENCODE_TYPE );

SerializerFactory anyTypeSerializerFactory = new SingletonSerializerFactory(anyTypeSerializer);
DeserializerFactory anyTypeDeserializerFactory = new SingletonDeserializerFactory(anyTypeSerializer);

if(service==null) {
System.out.println("service is null");
} else {
System.out.println("service is valid");
}

TypeMappingRegistry tmr = service.getTypeMappingRegistry();

if(tmr==null) {
System.out.println("TypeMappingRegistry is null");
} else {
System.out.println("TypeMappingRegistry is valid");
}

//anyTypeSerializer.initialize(tmr);
TypeMapping mapping = tmr.getTypeMapping(SOAPConstants.NS_SOAP_ENCODING);

mapping.register(com.myuniportal.ejb.ArrayOf_xsd_anyType.class, qn, anyTypeSerializerFactory, anyTypeDeserializerFactory);

Thanks for any help.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kirillcool
Offline
Joined: 2004-11-17

Go to https://jwsdp.dev.java.net/servlets/ProjectMailingListList and subscribe to the JWSDP users mailing list. Posting your question there, and not in the "Community news", has much higher chances of being answered.