You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Susantha Kumara <su...@opensource.lk> on 2004/06/14 06:32:20 UTC

How to avoid possible namespace prefix conflicts in serialized SOAP Messages

Hi All,
 
I see that some of the functions that are used to create objects that
construct the SOAP message are given prefixes. See following,
 
SoapSerializer::createHeaderBlock
Stub::createSOAPHeaderBlock
Stub::setSOAPMethodAttribute
HeaderBlock::createAttribute
HeaderBlock::createChild
...
 
When we (a Stub or Handler) create any object (SoapEnvelope, SoapBody,
SoapMethod, SoapHeader, HeaderBlock etc) we should allow the Serializer
to decide the prefixes for any namespace URI. Otherwise there is a
possibility of prefix collisions in the serialized SOAP message. But if
you always use SoapSerializer::getNamespacePrefix function to get a
prefix for your namespace URI, this problem can be avoided.
 
So the ideal way to deal with this situation is to change the above
methods to pass only the namespace URI and inside each of those
functions it should ask the Serializer for the prefix. But this needs a
considerable changes in the code of the above classes and some other
related classes. 
 
So as a temporary measure I expose the
SoapSerializer::getNamespacePrefix function through Stub/Call class
interfaces and Handler API and the Client applications/Handlers should
use it to avoid any prefix conflicts in the serialized SOAP message.
 
---
Susantha Kumara
Virtusa (pvt) Ltd.
Office : +94112714385
Mobile : +94777420453