[ http://issues.apache.org/jira/browse/AXISCPP-341?page=history ]
     
Fred Preston resolved AXISCPP-341:
----------------------------------

    Resolution: Fixed

I have now fixed HeaderBlock::createNamespaceDecl() so that it will iterate 
through all other namespaces belonging to this header block and will return 
either a pointer to a new INamespace or a pointer to the namespace whose prefix 
matches the prefix passed to the method. Note: If the prefix matches, then the 
uri passed to the method will be used to overwrite the existing uri associated 
with the prefix.

> createNamespaceDecl() and addNamespaceDecl() allows duplicate namespace 
> declaration within a Tag.
> -------------------------------------------------------------------------------------------------
>
>          Key: AXISCPP-341
>          URL: http://issues.apache.org/jira/browse/AXISCPP-341
>      Project: Axis-C++
>         Type: Bug
>   Components: SOAP
>     Reporter: James Jose
>     Assignee: Fred Preston

>
> createNamespaceDecl() and addNamespaceDecl() allows duplicate namespace 
> declaration within a Tag.
> I created one SOAPHeader block and then tried to create two namespace 
> declarations with the same namespace prefix.
> IHeaderBlock *phb = 
> ws.createSOAPHeaderBlock("TestHeader","http://ws.apache.org/axisCppTest/";);
> const AxisChar *ns="ns1";
> IAttribute 
> *Iattr1=phb->createNamespaceDecl(ns,"http://ws.apache.org/axisCppTest/";);
> IAttribute 
> *Iattr2=phb->createNamespaceDecl(ns,"http://ws.apache.org/axisCppTest/";);
> This code will generate the following SOAP Header.
> <SOAP-ENV:Header><ns2:TestHeader 
> xmlns:ns2="http://ws.apache.org/axisCppTest/"; 
> xmlns:ns1="http://ws.apache.org/axisCppTest/"; 
> xmlns:ns1="http://ws.apache.org/axisCppTest/";></ns2:TestHeader></SOAP-ENV:Header>
> Here the namespace prefix 'ns1' is duplicated.
> ie createNamespaceDecl() does not check for duplicate declaration. 
> addNamespaceDecl() will also
> do this duplication.
> Also the formed SOAP message is non compliant to the WS-I basic profile.
> The conformance report shows the following failure message.
> The soap:Envelope or soap:Body does not conform to XML 1.0.
> Attribute "xmlns:ns1" was already specified for element "ns2:TestHeader".

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira

Reply via email to