You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wss4j-dev@ws.apache.org by sh_santosh <sa...@gmail.com> on 2008/09/25 21:45:11 UTC

org.apache.xml.security.c14n.CanonicalizationException: Element ns1:AppHeader has a relative namespace:

Dear All,

I am getting exception -
org.apache.xml.security.c14n.CanonicalizationException: Element
ns1:AppHeader has a relative namespace: ns1="Interface/test/Travel"

  While invoking .Net web services from our Java client program.
.Net web services side setting they have enable https and have used WSE
security standard to secure web services.

To consume .Net secure web services I have used WSS4J and have implemented
UsernameToken.
I am using Java 1.4 and Tomcat 5.0.28 and Axis 1.3.

I have generated client stub from wsdl.
and have done client-config.wsdd and PWCallback.java .

While i try to invoke .Net web services I got this Exception.
Exception :-
org.apache.xml.security.c14n.CanonicalizationException: Element
ns1:AppHeader has a relative namespace: ns1="Interface/test/Travel"
	at
org.apache.xml.security.c14n.implementations.Canonicalizer20010315.handleAttributesSubtree(Unknown
Source)
	at
org.apache.xml.security.c14n.implementations.CanonicalizerBase.canonicalizeSubTree(Unknown
Source)
	at
org.apache.xml.security.c14n.implementations.CanonicalizerBase.engineCanonicalizeSubTree(Unknown
Source)
	at
org.apache.xml.security.c14n.implementations.CanonicalizerBase.engineCanonicalizeSubTree(Unknown
Source)
	at org.apache.xml.security.c14n.Canonicalizer.canonicalizeSubtree(Unknown
Source)
	at org.apache.xml.security.utils.XMLUtils.outputDOM(Unknown Source)
	at org.apache.ws.axis.security.WSDoAllSender.invoke(WSDoAllSender.java:195)
	at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
	at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
	at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:127)
	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
	at org.apache.axis.client.Call.invoke(Call.java:2767)
	at org.apache.axis.client.Call.invoke(Call.java:2443)
	at org.apache.axis.client.Call.invoke(Call.java:2366)
	at org.apache.axis.client.Call.invoke(Call.java:1812)

Please see the client-config.wsdd :

<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
 <transport name="http"
pivot="java:org.apache.axis.transport.http.HTTPSender"/>
 <transport name="java"
pivot="java:org.apache.axis.transport.java.JavaSender"/>
 <transport name="local"
pivot="java:org.apache.axis.transport.local.LocalSender"/>
  <globalConfiguration>
   <requestFlow>   
    <handler type="java:org.apache.ws.axis.security.WSDoAllSender" >
     <parameter name="action" value="Timestamp UsernameToken"/>
     <parameter name="user" value="Test"/>
     <parameter name="passwordCallbackClass"
value="helper.securityImpl.PWCallback"/>
     <parameter name="passwordType" value="PasswordText"/>
     <parameter name="password" value="TesTrB1"/>
     <parameter name="mustUnderstand" value="true" />
     <parameter name="addUTElements" value="Nonce Created"/>
     <parameter name="precisionInMilliseconds" value="false" />
    </handler>
   </requestFlow>
  </globalConfiguration>
</deployment>


Please advise.
What is the problem ?
How to solve it ?


Regards,
Santosh
-- 
View this message in context: http://www.nabble.com/org.apache.xml.security.c14n.CanonicalizationException%3A-Element-ns1%3AAppHeader-has-a-relative-namespace%3A-tp19676909p19676909.html
Sent from the WSS4J mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


RE: org.apache.xml.security.c14n.CanonicalizationException: Element ns1:AppHeader has a relative namespace:

Posted by "Dittmann, Werner (NSN - DE/Munich)" <we...@nsn.com>.
IMHO this is not a WSS4J problem but you may check your
namespace definitioons in your WSDL. Your should use
non-relative namespaces in the form of "urn:xxx:yyyfoobar"
or "http://some.com/name ". Maybe the security setting of
.Net require absolute namespace names.

Regards,
Werner

-----Original Message-----
From: ext Bonnie Wang [mailto:316818309@qq.com] 
Sent: Tuesday, May 11, 2010 4:56 AM
To: wss4j-dev@ws.apache.org
Subject: Re: org.apache.xml.security.c14n.CanonicalizationException:
Element ns1:AppHeader has a relative namespace:


hello,
     now i get the same exceptions ,so how did u resolve it ? thanks
very
much
=====================
org.apache.xml.security.c14n.CanonicalizationException: Element op1 has
a
relative namespace: ns1="xsd"
	at
org.apache.xml.security.c14n.implementations.Canonicalizer20010315.handl
eAttributesSubtree(Unknown
Source)
	at
org.apache.xml.security.c14n.implementations.CanonicalizerBase.canonical
izeSubTree(Unknown
Source)
	at
org.apache.xml.security.c14n.implementations.CanonicalizerBase.engineCan
onicalizeSubTree(Unknown
Source)
	at
org.apache.xml.security.c14n.implementations.CanonicalizerBase.engineCan
onicalizeSubTree(Unknown
Source)
	at
org.apache.xml.security.c14n.Canonicalizer.canonicalizeSubtree(Unknown
Source)
	at org.apache.xml.security.utils.XMLUtils.outputDOM(Unknown
Source)
	at
org.apache.ws.axis.security.WSDoAllSender.invoke(WSDoAllSender.java:193)
	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:121)
	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
	at org.apache.axis.client.Call.invoke(Call.java:2767)
	at org.apache.axis.client.Call.invoke(Call.java:2443)
	at org.apache.axis.client.Call.invoke(Call.java:2366)
	at org.apache.axis.client.Call.invoke(Call.java:1812)
	at
org.qualipso.factory.ui.service.evaluation.server.EvaluationServletImpl.
qpsDocumentExecution(EvaluationServletImpl.java:102)
	at
org.qualipso.factory.ui.service.evaluation.server.EvaluationServletImpl.
main(EvaluationServletImpl.java:284)
org.xml.sax.SAXParseException: Premature end of file.
=========================================



sh_santosh wrote:
> 
> Dear All,
> 
> I am getting exception -
> org.apache.xml.security.c14n.CanonicalizationException: Element
> ns1:AppHeader has a relative namespace: ns1="Interface/test/Travel"
> 
>   While invoking .Net web services from our Java client program.
> .Net web services side setting they have enable https and have used
WSE
> security standard to secure web services.
> 
> To consume .Net secure web services I have used WSS4J and have
implemented
> UsernameToken.
> I am using Java 1.4 and Tomcat 5.0.28 and Axis 1.3.
> 
> I have generated client stub from wsdl.
> and have done client-config.wsdd and PWCallback.java .
> 
> While i try to invoke .Net web services I got this Exception.
> Exception :-
> org.apache.xml.security.c14n.CanonicalizationException: Element
> ns1:AppHeader has a relative namespace: ns1="Interface/test/Travel"
> 	at
>
org.apache.xml.security.c14n.implementations.Canonicalizer20010315.handl
eAttributesSubtree(Unknown
> Source)
> 	at
>
org.apache.xml.security.c14n.implementations.CanonicalizerBase.canonical
izeSubTree(Unknown
> Source)
> 	at
>
org.apache.xml.security.c14n.implementations.CanonicalizerBase.engineCan
onicalizeSubTree(Unknown
> Source)
> 	at
>
org.apache.xml.security.c14n.implementations.CanonicalizerBase.engineCan
onicalizeSubTree(Unknown
> Source)
> 	at
org.apache.xml.security.c14n.Canonicalizer.canonicalizeSubtree(Unknown
> Source)
> 	at org.apache.xml.security.utils.XMLUtils.outputDOM(Unknown
Source)
> 	at
>
org.apache.ws.axis.security.WSDoAllSender.invoke(WSDoAllSender.java:195)
> 	at
>
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.j
ava:32)
> 	at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
> 	at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
> 	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:127)
> 	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
> 	at org.apache.axis.client.Call.invoke(Call.java:2767)
> 	at org.apache.axis.client.Call.invoke(Call.java:2443)
> 	at org.apache.axis.client.Call.invoke(Call.java:2366)
> 	at org.apache.axis.client.Call.invoke(Call.java:1812)
> 
> Please see the client-config.wsdd :
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <deployment xmlns="http://xml.apache.org/axis/wsdd/"
> xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
>  <transport name="http"
> pivot="java:org.apache.axis.transport.http.HTTPSender"/>
>  <transport name="java"
> pivot="java:org.apache.axis.transport.java.JavaSender"/>
>  <transport name="local"
> pivot="java:org.apache.axis.transport.local.LocalSender"/>
>   <globalConfiguration>
>    <requestFlow>   
>     <handler type="java:org.apache.ws.axis.security.WSDoAllSender" >
>      <parameter name="action" value="Timestamp UsernameToken"/>
>      <parameter name="user" value="Test"/>
>      <parameter name="passwordCallbackClass"
> value="helper.securityImpl.PWCallback"/>
>      <parameter name="passwordType" value="PasswordText"/>
>      <parameter name="password" value="TesTrB1"/>
>      <parameter name="mustUnderstand" value="true" />
>      <parameter name="addUTElements" value="Nonce Created"/>
>      <parameter name="precisionInMilliseconds" value="false" />
>     </handler>
>    </requestFlow>
>   </globalConfiguration>
> </deployment>
> 
> 
> Please advise.
> What is the problem ?
> How to solve it ?
> 
> 
> Regards,
> Santosh
> 

-- 
View this message in context:
http://old.nabble.com/org.apache.xml.security.c14n.CanonicalizationExcep
tion%3A-Element-ns1%3AAppHeader-has-a-relative-namespace%3A-tp19676909p2
8519412.html
Sent from the WSS4J mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


Re: org.apache.xml.security.c14n.CanonicalizationException: Element ns1:AppHeader has a relative namespace:

Posted by Bonnie Wang <31...@qq.com>.
hello,
     now i get the same exceptions ,so how did u resolve it ? thanks very
much
=====================
org.apache.xml.security.c14n.CanonicalizationException: Element op1 has a
relative namespace: ns1="xsd"
	at
org.apache.xml.security.c14n.implementations.Canonicalizer20010315.handleAttributesSubtree(Unknown
Source)
	at
org.apache.xml.security.c14n.implementations.CanonicalizerBase.canonicalizeSubTree(Unknown
Source)
	at
org.apache.xml.security.c14n.implementations.CanonicalizerBase.engineCanonicalizeSubTree(Unknown
Source)
	at
org.apache.xml.security.c14n.implementations.CanonicalizerBase.engineCanonicalizeSubTree(Unknown
Source)
	at org.apache.xml.security.c14n.Canonicalizer.canonicalizeSubtree(Unknown
Source)
	at org.apache.xml.security.utils.XMLUtils.outputDOM(Unknown Source)
	at org.apache.ws.axis.security.WSDoAllSender.invoke(WSDoAllSender.java:193)
	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:121)
	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
	at org.apache.axis.client.Call.invoke(Call.java:2767)
	at org.apache.axis.client.Call.invoke(Call.java:2443)
	at org.apache.axis.client.Call.invoke(Call.java:2366)
	at org.apache.axis.client.Call.invoke(Call.java:1812)
	at
org.qualipso.factory.ui.service.evaluation.server.EvaluationServletImpl.qpsDocumentExecution(EvaluationServletImpl.java:102)
	at
org.qualipso.factory.ui.service.evaluation.server.EvaluationServletImpl.main(EvaluationServletImpl.java:284)
org.xml.sax.SAXParseException: Premature end of file.
=========================================



sh_santosh wrote:
> 
> Dear All,
> 
> I am getting exception -
> org.apache.xml.security.c14n.CanonicalizationException: Element
> ns1:AppHeader has a relative namespace: ns1="Interface/test/Travel"
> 
>   While invoking .Net web services from our Java client program.
> .Net web services side setting they have enable https and have used WSE
> security standard to secure web services.
> 
> To consume .Net secure web services I have used WSS4J and have implemented
> UsernameToken.
> I am using Java 1.4 and Tomcat 5.0.28 and Axis 1.3.
> 
> I have generated client stub from wsdl.
> and have done client-config.wsdd and PWCallback.java .
> 
> While i try to invoke .Net web services I got this Exception.
> Exception :-
> org.apache.xml.security.c14n.CanonicalizationException: Element
> ns1:AppHeader has a relative namespace: ns1="Interface/test/Travel"
> 	at
> org.apache.xml.security.c14n.implementations.Canonicalizer20010315.handleAttributesSubtree(Unknown
> Source)
> 	at
> org.apache.xml.security.c14n.implementations.CanonicalizerBase.canonicalizeSubTree(Unknown
> Source)
> 	at
> org.apache.xml.security.c14n.implementations.CanonicalizerBase.engineCanonicalizeSubTree(Unknown
> Source)
> 	at
> org.apache.xml.security.c14n.implementations.CanonicalizerBase.engineCanonicalizeSubTree(Unknown
> Source)
> 	at org.apache.xml.security.c14n.Canonicalizer.canonicalizeSubtree(Unknown
> Source)
> 	at org.apache.xml.security.utils.XMLUtils.outputDOM(Unknown Source)
> 	at
> org.apache.ws.axis.security.WSDoAllSender.invoke(WSDoAllSender.java:195)
> 	at
> org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
> 	at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
> 	at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
> 	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:127)
> 	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
> 	at org.apache.axis.client.Call.invoke(Call.java:2767)
> 	at org.apache.axis.client.Call.invoke(Call.java:2443)
> 	at org.apache.axis.client.Call.invoke(Call.java:2366)
> 	at org.apache.axis.client.Call.invoke(Call.java:1812)
> 
> Please see the client-config.wsdd :
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <deployment xmlns="http://xml.apache.org/axis/wsdd/"
> xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
>  <transport name="http"
> pivot="java:org.apache.axis.transport.http.HTTPSender"/>
>  <transport name="java"
> pivot="java:org.apache.axis.transport.java.JavaSender"/>
>  <transport name="local"
> pivot="java:org.apache.axis.transport.local.LocalSender"/>
>   <globalConfiguration>
>    <requestFlow>   
>     <handler type="java:org.apache.ws.axis.security.WSDoAllSender" >
>      <parameter name="action" value="Timestamp UsernameToken"/>
>      <parameter name="user" value="Test"/>
>      <parameter name="passwordCallbackClass"
> value="helper.securityImpl.PWCallback"/>
>      <parameter name="passwordType" value="PasswordText"/>
>      <parameter name="password" value="TesTrB1"/>
>      <parameter name="mustUnderstand" value="true" />
>      <parameter name="addUTElements" value="Nonce Created"/>
>      <parameter name="precisionInMilliseconds" value="false" />
>     </handler>
>    </requestFlow>
>   </globalConfiguration>
> </deployment>
> 
> 
> Please advise.
> What is the problem ?
> How to solve it ?
> 
> 
> Regards,
> Santosh
> 

-- 
View this message in context: http://old.nabble.com/org.apache.xml.security.c14n.CanonicalizationException%3A-Element-ns1%3AAppHeader-has-a-relative-namespace%3A-tp19676909p28519412.html
Sent from the WSS4J mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org