Hi There, I'm trying to put together a thinner SOAP API than Apache SOAP-RPC, but I'm having issues with Marshalling/Unmarshalling objects from the java.lang.* package that are contained within a Vector. Here's the description of the problem:
I've generated Castor classes from the following Schema File in order to represent a remote call: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="call"> <xs:complexType> <xs:sequence> <xs:element ref="serviceNameSpace"/> <xs:element ref="methodName"/> <xs:element ref="methodArgument" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="methodArgument"> <xs:complexType mixed="true"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:any namespace="##any" processContents="strict" minOccurs="0" maxOccurs="unbounded"/> </xs:choice> </xs:complexType> </xs:element> <xs:element name="methodName" type="xs:string"/> <xs:element name="serviceNameSpace" type="xs:string"/> </xs:schema> The result is 3 classes (actually, 3 beans & 3 Descriptors) called "Call.class", "MethodArgument.class", and "MethodArgumentItem.class". Here's the dilemma: If I add any objects from the java.lang.* package as MethodArgumentItem to my Call, the XML resulting from marshalling the object doesn't contain xsi:type attributes for any of these objects. Therefore, when the XML is unmarshalled, the Call object is popluated with AnyNode objects containing the values that were sent. This doesn't happen with any other object type (standard java packages like java.net.*, or any of my own packages). For example, a boolean marshalls to: <methodArgument> <boolean>true</boolean> </methodArgument> While a URL would marshal to: <methodArgument> <URL xsi:type="java:java.net.URL"> ... </URL> </methodArgument> Here's the question: Is there anyway to force Castor to write xsi:type attributes for String, Boolean, Integer, etc. so that it understands how to unmarshal them? Or, is there another way to do this so that it works? I've tried playing with the setMarshalExtendedType method of the Marshaller class, but this doesn't seem to work. Thanks in advance for any help. Cheers! Jared Chartrand [EMAIL PROTECTED] ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
