To work around the problem, I discovered that I need to call XmlUtils.getElementQName(Element) instead of XmlUtils.getQName(Element). I can now get the QName of an Element even if there were duplicate namespaces. But I'm still puzzled as to what's causing the dups in the first place.
-----Original Message----- From: Vinh Nguyen (vinguye2) Sent: Tuesday, February 20, 2007 10:30 PM To: [email protected] Subject: axis2 generates duplicate namespaces? I'm currently using Muse 2.1.0 and deploying my app using the mini-servlet platform. Now, when I try to upgrade to the Axis2 packaging, the xml received on the server side has a bunch of duplicate namespaces. I'm not sure what is causing this, but I suspect it might be Axis2. This causes problems when I try to call XmlUtils.getQName(element) and pass an Element extracted from the request header using the Axis2 MessageContext class. Is anyone else experiencing the same problems? To upgrade to Axis2, I basically deploy the Axis2 web.xml and libs that come with Muse 2.1.0, instead of the mini version of web.xml and libs. The client output is the same for both packagings. For example: [CLIENT TRACE] SOAP envelope contents (outgoing): <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> <soap:Header> <wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">http://localhost:8080/T estApp/services/QueryServicePort</wsa:To> <wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">http://schemas.cmp.cisc o.com/2006/07/QueryService/getRequest</wsa:Action> <wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:59d2dd91-dcb0-2fec -0e14-a86085b7b551</wsa:MessageID> <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing"> <wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Ad dress> </wsa:From> <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wsse curity-secext-1.0.xsd"> <wsse:UserToken> <wsse:Username>TestUsername</wsse:Username> <wsse:Password>TestPassword</wsse:Password> </wsse:UserToken> </wsse:Security> </soap:Header> ... </soap:Envelope> The difference is the incoming xml on the server side. Using the mini platform, the xml is fine and appears as: FINE: [SERVER TRACE] SOAP envelope contents (incoming): <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> <soap:Header> <wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">http://localhost:8080/T estApp/services/QueryServicePort</wsa:To> <wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">http://schemas.cmp.cisc o.com/2006/07/QueryService/getRequest</wsa:Action> <wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:bd9305ca-ca2c-15e5 -7786-b51bd47714d1</wsa:MessageID> <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing"> <wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Ad dress> </wsa:From> <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wsse curity-secext-1.0.xsd"> <wsse:UserToken> <wsse:Username>TestUsername</wsse:Username> <wsse:Password>TestPassword</wsse:Password> </wsse:UserToken> </wsse:Security> </soap:Header> ... </soap:Envelope> But, using the Axis2 platform, the incoming xml contains many duplicate namespaces. It appears as: FINE: [SERVER TRACE] SOAP envelope contents (incoming): <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> <soap:Header> <wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://www.w3.org/2005/08/addressing">http://localhost:8080/T estApp/services/QueryServicePort</wsa:To> <wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://www.w3.org/2005/08/addressing">http://schemas.cmp.cisc o.com/2006/07/QueryService/getRequest</wsa:Action> <wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:59d2dd91-dcb0-2fec -0e14-a86085b7b551</wsa:MessageID> <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://www.w3.org/2005/08/addressing"> <wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Ad dress> </wsa:From> <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wsse curity-secext-1.0.xsd" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wsse curity-secext-1.0.xsd"> <wsse:UserToken> <wsse:Username>TestUsername</wsse:Username> <wsse:Password>TestPassword</wsse:Password> </wsse:UserToken> </wsse:Security> </soap:Header> ... </soap:Envelope> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
