axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "srini.maran" <>
Subject [Axis2] with Rampart -- XMLStreamException "the prefix ==> Already exists for namespace
Date Tue, 27 Oct 2009 18:53:18 GMT

Hi Axis User.

            I am getting the below error in the client code when I try to
invoke the service with WS-Security Rampart. I am using Asix2-1.5 and

           XMLStreamException "the prefix ==> Already exists for namespace
in “urn:com1” " 
           when WS-Security Rampart is engaged for Axis 2 web-services

           Attached are the error log file (stacktrace) & client code. I am
using XML import in the schema.  I am able to successfully test the Rampart
policy samples without any issue.

           I am getting error when I add rampart in our existing service
which has complex schema.  Has this error occurred due to xml import?

Below is my XSD hierarchy

service.wsdl --

               <xsd:import namespace="urn:chl"
schemaLocation="../schema/hub_channel.xsd" />   - in
               <xsd:import namespace="urn:msg"
schemaLocation="../schema/hub_message.xsd" />   - out

            hub_channel.xsd(urn:chl) imports the below scheams.
                  <xsd:import namespace="urn:com1"
schemaLocation="hub_common.xsd" />
                  <xsd:import namespace="urn:usr"
schemaLocation="hub_user.xsd" />

            hub_message.xsd(urn:msg) import 
                  <xsd:import namespace="urn:com1"
schemaLocation="hub_common.xsd" />

            Can you please help on this issue? I will really appreciate you.
I have been trying for last 1 week to resolve it. I couldn’t resolve it.

            I searched in Axis User, people encountered the same. I don't
think it's resolved. 
            Here is the link:
            In the forum, one of the user Richard mentioned Rampart devs
would like to acknowledge the 
            problem and maybe even fix it
            One user debugged the issue and added the below comments in the

            "I debugged the code and observed that, in the serialize method
of the XML node POJO  
             (generated by WSDL2JAVA), the "MTOMAwareXMLStreamWriter
xmlWriter" parameter gets an 
             instance of MTOMAwareOMBuilder if WS-Security is enabled. 
             Whereas, without WS-Security it gets an instance of
org.apache.axis2.databinding.utils.writer.MTOMAwareXMLSerializer which uses 
             MTOMXMLStreamWriter which in turn uses
com.ctc.wstx.sw.SimpleNsStreamWriter to 
             serialize the response. 
             I also tried using AXIS 1.4 without any success. Any idea how
can this problem can be solved? 
             Is there a way to let Rampart know which serializer should be
used? Am I missing any 
             configuration details of Rampart? "

Srini Maran Error1.rtf Client.rtf 
View this message in context:
Sent from the Axis - User mailing list archive at

View raw message