Hallo everybody,
After all of the complex Java/SOAP mapping is done, we have some beans
to serialize.
I wrote some code that registers my bean class for serialization:
TypeMappingRegistry registry = (TypeMappingRegistry) service
.getTypeMappingRegistry();
TypeMapping tm = (TypeMapping) registry
.getOrMakeTypeMapping(Constants.URI_SOAP11_ENC);
tm.register(ClientCallMetaData.class, new
QName(Constants.PRS_NAMESPACE_URI, "ClientCallMetaData"), new
BeanSerializerFactory(
ClientCallMetaData.class, new
QName(Constants.PRS_NAMESPACE_URI,"ClientCallMetaData")),
new BeanDeserializerFactory(ClientCallMetaData.class,new
QName(Constants.PRS_NAMESPACE_URI,"ClientCallMetaData")));
That's all I do. Now when I call a web service using ClientCallMetaData
as parameter, ClientCallMetaData is using the right namespace
(Constants.PRS_NAMESPACE_URI as mentioned above) for the "object" itself
<ClientCallMetaData>. But attributes (= bean properties) are not
qualified, no namespace here. I assumed that the BeanSerializer would
use the same namespace as the containing object.
What am I doing wrong?
Thanks in advance,
Werner Jansen
PS: This is what ethereal tells me about the message sent over the wire.
As you can see, clientCallMetaData is namespace-qualified, whereas its
attributes (clazz, clientHost, clientName) are not.
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:logMessage
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://www.eon-is.com/namespaces/prs/1.0">
<ns1:clientCallMetaData
xsi:type="ns1:ClientCallMetaData">
<clazz xsi:type="soapenc:string"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
de.eonis.[...].soap.ws.WsCommonServiceTest
</clazz>
<clientHost xsi:type="soapenc:string"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
[ip address]
</clientHost>
<clientName xsi:type="soapenc:string"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
[name of client library used]
</clientName>
</ns1:clientCallMetaData>
<ns1:userInfo xsi:type="ns1:UserInfo">
[...]
</ns1:userInfo>
<ns1:logLevel xsi:type="ns1:LogLevel">
<ns1:level xsi:type="soapenc:string"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
INFO
</ns1:level>
</ns1:logLevel>
<ns1:message>This is the message.</ns1:message>
</ns1:logMessage>
</soapenv:Body>
</soapenv:Envelope>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]