You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Shah, Sumit (CGI Federal)" <Su...@cgifederal.com> on 2013/02/25 23:54:57 UTC

WS-Policy issues when upgrading from Axis2 1.6.0 to Axis2 1.6.2

Hello,

I am running into WS Policy parsing issues when upgrading Axis2 from 1.6.0 to 1.6.2. The policies that successfully load (via WSDL11ToAxisServiceBuilder.processPoliciesInDefintion) in version 1.6.0 do not work when I go to 1.6.2. I do notice that in 1.6.2, Axis now uses PolicyBuilder (Neethi) which was not the case in 1.6.0. Is there any change with respect to policy parsing that I should  be aware of? I would appreciate any help.

Here is the stack trace:

Caused by: java.lang.NullPointerException
        at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.getEventType(XMLStreamReaderWrapper.java:108)
        at org.apache.axiom.util.stax.dialect.BEAStreamReaderWrapper.getEncoding(BEAStreamReaderWrapper.java:90)
        at org.apache.axiom.om.impl.builder.StAXBuilder.<init>(StAXBuilder.java:125)
        at org.apache.axiom.om.impl.builder.StAXOMBuilder.<init>(StAXOMBuilder.java:104)
        at org.apache.axiom.om.impl.llom.factory.AbstractOMMetaFactory.createOMBuilder(AbstractOMMetaFactory.java:103)
        at org.apache.axiom.om.OMXMLBuilderFactory.createOMBuilder(OMXMLBuilderFactory.java:295)
        at org.apache.neethi.builders.converters.DOMToOMConverter.convert(DOMToOMConverter.java:36)
        at org.apache.neethi.builders.converters.DOMToOMConverter.convert(DOMToOMConverter.java:32)
        at org.apache.neethi.builders.converters.ConverterRegistry.convert(ConverterRegistry.java:159)
        at org.apache.neethi.AssertionBuilderFactoryImpl.invokeBuilder(AssertionBuilderFactoryImpl.java:135)
        at org.apache.neethi.AssertionBuilderFactoryImpl.build(AssertionBuilderFactoryImpl.java:117)
        at org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:224)
        at org.apache.neethi.PolicyBuilder.getAllOperator(PolicyBuilder.java:184)
        at org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:217)
        at org.apache.neethi.PolicyBuilder.getExactlyOneOperator(PolicyBuilder.java:180)
        at org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:215)
        at org.apache.neethi.PolicyBuilder.getPolicyOperator(PolicyBuilder.java:174)
        at org.apache.neethi.PolicyBuilder.getPolicy(PolicyBuilder.java:124)
        at org.apache.neethi.PolicyEngine.getPolicy(PolicyEngine.java:111)
        at org.apache.axis2.util.PolicyUtil.getPolicyComponent(PolicyUtil.java:173)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processPoliciesInDefintion(WSDL11ToAxisServiceBuilder.java:3120)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processPoliciesInDefintion(WSDL11ToAxisServiceBuilder.java:3098)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:374)
        at org.apache.axis2.description.AxisService.createClientSideAxisService(AxisService.java:2369)
        at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:211)

This is a sample services file. I am only showing a single operation, but I have multiple operations, each with its own policy:
<service name="WSSecurityTestService" targetNamespace="http://wssecuritytest.impl.webservices.test.com">
  <schema schemaNamespace="http://wssecuritytest.impl.webservices.test.com"/>
  <parameter name="ServiceClass">com.test.webservices.impl.wssecuritytest.WSSecurityTestService</parameter>
  <parameter name="useOriginalwsdl">true</parameter>
  <parameter name="wsdlFile">WSSecurityTestService.wsdl</parameter>
  <parameter name="modifyUserWSDLPortAddress">true</parameter>
  <module ref="addressing"/>
  <messageReceivers>
    <messageReceiver class="com.test.webservices.receivers.JAXBInOnlyMessageReceiver" mep="http://www.w3.org/ns/wsdl/in-only"/>
    <messageReceiver class="com.test.webservices.receivers.JAXBInOnlyMessageReceiver" mep="http://www.w3.org/ns/wsdl/robust-in-only"/>
    <messageReceiver class="com.test.webservices.receivers.JAXBMessageReceiver" mep="http://www.w3.org/ns/wsdl/in-out"/>
  </messageReceivers>
<operation mep="http://www.w3.org/ns/wsdl/in-out" name="testSAMLTokenSignedNoFault">
    <actionMapping>urn:test:WSSecurityTestService#testSAMLTokenSignedNoFault</actionMapping>
    <outputActionMapping>urn:testSAMLTokenSignedNoFaultResponse</outputActionMapping>
    <faultActionMapping faultName="RecoverableFault">urn:testSAMLTokenSignedNoFaultRecoverableFault</faultActionMapping>
    <faultActionMapping faultName="UnrecoverableFault">urn:testSAMLTokenSignedNoFaultUnrecoverableFault</faultActionMapping>
    <messageReceiver class="com.test.webservices.receivers.JAXBMessageReceiver" mep="http://www.w3.org/ns/wsdl/in-out"/>
    <module ref="rampart"/>
    <wsp:Policy xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SAMLPolicy">
      <wsp:ExactlyOne>
        <wsp:All>
          <sp:AsymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
            <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
              <sp:InitiatorToken>
                <wsp:Policy>
                  <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
                    <wsp:Policy>
                      <sp:RequireThumbprintReference/>
                      <sp:WssX509V1Token10/>
                    </wsp:Policy>
                  </sp:X509Token>
                </wsp:Policy>
              </sp:InitiatorToken>
              <sp:RecipientToken>
                <wsp:Policy>
                  <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
                    <wsp:Policy>
                      <sp:RequireThumbprintReference/>
                      <sp:WssX509V3Token10/>
                    </wsp:Policy>
                  </sp:X509Token>
                </wsp:Policy>
              </sp:RecipientToken>
              <sp:AlgorithmSuite>
                <wsp:Policy>
                  <sp:TripleDesRsa15/>
                </wsp:Policy>
              </sp:AlgorithmSuite>
              <sp:Layout>
                <wsp:Policy>
                  <sp:Strict/>
                </wsp:Policy>
              </sp:Layout>
              <sp:IncludeTimestamp/>
              <sp:OnlySignEntireHeadersAndBody/>
            </wsp:Policy>
          </sp:AsymmetricBinding>
          <sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
            <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
              <sp:MustSupportRefKeyIdentifier/>
              <sp:MustSupportRefIssuerSerial/>
            </wsp:Policy>
          </sp:Wss10>
          <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
            <sp:Body/>
          </sp:SignedParts>
          <rampart:RampartConfig xmlns:rampart="http://ws.apache.org/rampart/policy">
            <rampart:user>interca</rampart:user>
            <rampart:passwordCallbackClass>com.test.security2.webservices.WSS4JPWCallback</rampart:passwordCallbackClass>
            <rampart:timestampPrecisionInMilliseconds>true</rampart:timestampPrecisionInMilliseconds>
            <rampart:timestampTTL>300</rampart:timestampTTL>
            <rampart:timestampMaxSkew>300</rampart:timestampMaxSkew>
            <rampart:nonceLifeTime>300</rampart:nonceLifeTime>
            <rampart:signatureCrypto>
              <rampart:crypto provider="com.test.security2.csf.webservices.WSS4JCSFCryptoImpl">
                ...
              </rampart:crypto>
            </rampart:signatureCrypto>
          </rampart:RampartConfig>
        </wsp:All>
      </wsp:ExactlyOne>
    </wsp:Policy>
  </operation>
</service>



RE: WS-Policy issues when upgrading from Axis2 1.6.0 to Axis2 1.6.2

Posted by Martin Gainty <mg...@hotmail.com>.
if the imported documents conform to wsdl-1.1 spec ..here is the code
public static AxisService createClientSideAxisService(URL wsdlURL,
			QName wsdlServiceName, String portName, Options options)
			throws AxisFault {
		try {
			InputStream in = wsdlURL.openConnection().getInputStream();
			Document doc = XMLUtils.newDocument(in);
			WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
			reader.setFeature("javax.wsdl.importDocuments", true);
			Definition wsdlDefinition = reader.readWSDL(getBaseURI(wsdlURL
					.toString()), doc);
			if (wsdlDefinition != null) {
				wsdlDefinition.setDocumentBaseURI(getDocumentURI(wsdlURL
						.toString()));
			}
			return createClientSideAxisService(wsdlDefinition, wsdlServiceName,
					portName, options);






Name
Description
Default Value


javax.wsdl.verbose
If set to true, status messages will be displayed.

true


javax.wsdl.importDocuments
If set to true, imported WSDL documents will be retrieved and processed.

true
All feature names must be fully-qualified, Java package style. All names starting with javax.wsdl. are reserved for features defined by the JWSDL specification. It is recommended that implementation- specific features be fully-qualified to match the package name of that implementation. For example: com.abc.featureName 
 
 
put your complete testcase into JIRA and we'll take a look

Martin Gainty 
______________________________________________ 
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

 
Ez az üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet ezen üzenet tartalma miatt.

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

  




From: Sumit.Shah@cgifederal.com
To: java-user@axis.apache.org
Subject: WS-Policy issues when upgrading from Axis2 1.6.0 to Axis2 1.6.2
Date: Mon, 25 Feb 2013 22:54:57 +0000





Hello,
 
I am running into WS Policy parsing issues when upgrading Axis2 from 1.6.0 to 1.6.2. The policies that successfully load (via WSDL11ToAxisServiceBuilder.processPoliciesInDefintion) in version 1.6.0 do not work when I go to 1.6.2. I do notice that in 1.6.2, Axis now uses PolicyBuilder (Neethi) which was not the case in 1.6.0. Is there any change with respect to policy parsing that I should  be aware of? I would appreciate any help.
 
Here is the stack trace:
 
Caused by: java.lang.NullPointerException
        at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.getEventType(XMLStreamReaderWrapper.java:108)
        at org.apache.axiom.util.stax.dialect.BEAStreamReaderWrapper.getEncoding(BEAStreamReaderWrapper.java:90)
        at org.apache.axiom.om.impl.builder.StAXBuilder.<init>(StAXBuilder.java:125)
        at org.apache.axiom.om.impl.builder.StAXOMBuilder.<init>(StAXOMBuilder.java:104)
        at org.apache.axiom.om.impl.llom.factory.AbstractOMMetaFactory.createOMBuilder(AbstractOMMetaFactory.java:103)
        at org.apache.axiom.om.OMXMLBuilderFactory.createOMBuilder(OMXMLBuilderFactory.java:295)
        at org.apache.neethi.builders.converters.DOMToOMConverter.convert(DOMToOMConverter.java:36)
        at org.apache.neethi.builders.converters.DOMToOMConverter.convert(DOMToOMConverter.java:32)
        at org.apache.neethi.builders.converters.ConverterRegistry.convert(ConverterRegistry.java:159)
        at org.apache.neethi.AssertionBuilderFactoryImpl.invokeBuilder(AssertionBuilderFactoryImpl.java:135)
        at org.apache.neethi.AssertionBuilderFactoryImpl.build(AssertionBuilderFactoryImpl.java:117)
        at org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:224)
        at org.apache.neethi.PolicyBuilder.getAllOperator(PolicyBuilder.java:184)
        at org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:217)
        at org.apache.neethi.PolicyBuilder.getExactlyOneOperator(PolicyBuilder.java:180)
        at org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:215)
        at org.apache.neethi.PolicyBuilder.getPolicyOperator(PolicyBuilder.java:174)
        at org.apache.neethi.PolicyBuilder.getPolicy(PolicyBuilder.java:124)
        at org.apache.neethi.PolicyEngine.getPolicy(PolicyEngine.java:111)
        at org.apache.axis2.util.PolicyUtil.getPolicyComponent(PolicyUtil.java:173)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processPoliciesInDefintion(WSDL11ToAxisServiceBuilder.java:3120)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processPoliciesInDefintion(WSDL11ToAxisServiceBuilder.java:3098)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:374)
        at org.apache.axis2.description.AxisService.createClientSideAxisService(AxisService.java:2369)
        at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:211)
 
This is a sample services file. I am only showing a single operation, but I have multiple operations, each with its own policy:
<service name="WSSecurityTestService" targetNamespace="http://wssecuritytest.impl.webservices.test.com">
  <schema schemaNamespace="http://wssecuritytest.impl.webservices.test.com"/>
  <parameter name="ServiceClass">com.test.webservices.impl.wssecuritytest.WSSecurityTestService</parameter>
  <parameter name="useOriginalwsdl">true</parameter>
  <parameter name="wsdlFile">WSSecurityTestService.wsdl</parameter>
  <parameter name="modifyUserWSDLPortAddress">true</parameter>
  <module ref="addressing"/>
  <messageReceivers>
    <messageReceiver class="com.test.webservices.receivers.JAXBInOnlyMessageReceiver" mep="http://www.w3.org/ns/wsdl/in-only"/>
    <messageReceiver class="com.test.webservices.receivers.JAXBInOnlyMessageReceiver" mep="http://www.w3.org/ns/wsdl/robust-in-only"/>
    <messageReceiver class="com.test.webservices.receivers.JAXBMessageReceiver" mep="http://www.w3.org/ns/wsdl/in-out"/>
  </messageReceivers>
<operation mep="http://www.w3.org/ns/wsdl/in-out" name="testSAMLTokenSignedNoFault">
    <actionMapping>urn:test:WSSecurityTestService#testSAMLTokenSignedNoFault</actionMapping>
    <outputActionMapping>urn:testSAMLTokenSignedNoFaultResponse</outputActionMapping>
    <faultActionMapping faultName="RecoverableFault">urn:testSAMLTokenSignedNoFaultRecoverableFault</faultActionMapping>
    <faultActionMapping faultName="UnrecoverableFault">urn:testSAMLTokenSignedNoFaultUnrecoverableFault</faultActionMapping>
    <messageReceiver class="com.test.webservices.receivers.JAXBMessageReceiver" mep="http://www.w3.org/ns/wsdl/in-out"/>
    <module ref="rampart"/>
    <wsp:Policy xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SAMLPolicy">
      <wsp:ExactlyOne>
        <wsp:All>
          <sp:AsymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
            <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
              <sp:InitiatorToken>
                <wsp:Policy>
                  <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
                    <wsp:Policy>
                      <sp:RequireThumbprintReference/>
                      <sp:WssX509V1Token10/>
                    </wsp:Policy>
                  </sp:X509Token>
                </wsp:Policy>
              </sp:InitiatorToken>
              <sp:RecipientToken>
                <wsp:Policy>
                  <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
                    <wsp:Policy>
                      <sp:RequireThumbprintReference/>
                      <sp:WssX509V3Token10/>
                    </wsp:Policy>
                  </sp:X509Token>
                </wsp:Policy>
              </sp:RecipientToken>
              <sp:AlgorithmSuite>
                <wsp:Policy>
                  <sp:TripleDesRsa15/>
                </wsp:Policy>
              </sp:AlgorithmSuite>
              <sp:Layout>
                <wsp:Policy>
                  <sp:Strict/>
                </wsp:Policy>
              </sp:Layout>
              <sp:IncludeTimestamp/>
              <sp:OnlySignEntireHeadersAndBody/>
            </wsp:Policy>
          </sp:AsymmetricBinding>
          <sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
            <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
              <sp:MustSupportRefKeyIdentifier/>
              <sp:MustSupportRefIssuerSerial/>
            </wsp:Policy>
          </sp:Wss10>
          <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
            <sp:Body/>
          </sp:SignedParts>
          <rampart:RampartConfig xmlns:rampart="http://ws.apache.org/rampart/policy">
            <rampart:user>interca</rampart:user>
            <rampart:passwordCallbackClass>com.test.security2.webservices.WSS4JPWCallback</rampart:passwordCallbackClass>
            <rampart:timestampPrecisionInMilliseconds>true</rampart:timestampPrecisionInMilliseconds>
            <rampart:timestampTTL>300</rampart:timestampTTL>
            <rampart:timestampMaxSkew>300</rampart:timestampMaxSkew>
            <rampart:nonceLifeTime>300</rampart:nonceLifeTime>
            <rampart:signatureCrypto>
              <rampart:crypto provider="com.test.security2.csf.webservices.WSS4JCSFCryptoImpl">
                …
              </rampart:crypto>
            </rampart:signatureCrypto>
          </rampart:RampartConfig>
        </wsp:All>
      </wsp:ExactlyOne>
    </wsp:Policy>
  </operation>
</service>
 
  		 	   		  

RE: WS-Policy issues when upgrading from Axis2 1.6.0 to Axis2 1.6.2

Posted by Martin Gainty <mg...@hotmail.com>.
How to solve next time:

extract the XSD
Look at the XSD and the supporting schema for example if I goto Axiom 1.2.14 I can see these declarations
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://apache.org/axiom/om/impl/builder/test/xmlbeans" 

as long as you are implementing the same version XMLSchema in your WSDL as Axiom version schema you should not experience type mismatch or any other types of Schema Errors

Glad you found the bug,

Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

  




From: Sumit.Shah@cgifederal.com
To: java-user@axis.apache.org
Subject: RE: WS-Policy issues when upgrading from Axis2 1.6.0 to Axis2 1.6.2
Date: Tue, 5 Mar 2013 20:34:55 +0000





I was able to get past these issues by upgrading Axiom to 1.2.14 and using the axiom-compat to address incompatibility issues with Rampart 1.6.2 .
 
Thanks
Sumit
 


From: Shah, Sumit (CGI Federal) 
Sent: Wednesday, February 27, 2013 2:25 PM
To: java-user@axis.apache.org
Subject: RE: WS-Policy issues when upgrading from Axis2 1.6.0 to Axis2 1.6.2
 
Thanks Martin and Andreas. I will try out your suggestions.
 
Thanks
Sumit
 


From: Martin Gainty [mailto:mgainty@hotmail.com] 
Sent: Tuesday, February 26, 2013 6:25 PM
To: java-user@axis.apache.org
Subject: RE: WS-Policy issues when upgrading from Axis2 1.6.0 to Axis2 1.6.2
 

Nota Bene for Woden Implementors
convert your wsdl 1.1 wsdl to wsdl2.0 before processing with woden..woden has a converter but its still in alpha 
http://ws.apache.org/woden/

Thanks Andreas,
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité


Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.





> From: andreas.veithen@gmail.com
> Date: Tue, 26 Feb 2013 22:12:59 +0100
> Subject: Re: WS-Policy issues when upgrading from Axis2 1.6.0 to Axis2 1.6.2
> To: java-user@axis.apache.org
> 
> That is a variant of AXIOM-401 [1]. The NullPointerException only
> occurs with ancient versions of BEA's StAX implementation. Either use
> Woodstox as StAX implementation or try to upgrade Axiom to 1.2.14.
> 
> Andreas
> 
> [1] https://issues.apache.org/jira/browse/AXIOM-401
> 
> On Mon, Feb 25, 2013 at 11:54 PM, Shah, Sumit (CGI Federal)
> <Su...@cgifederal.com> wrote:
> > Hello,
> >
> >
> >
> > I am running into WS Policy parsing issues when upgrading Axis2 from 1.6.0
> > to 1.6.2. The policies that successfully load (via
> > WSDL11ToAxisServiceBuilder.processPoliciesInDefintion) in version 1.6.0 do
> > not work when I go to 1.6.2. I do notice that in 1.6.2, Axis now uses
> > PolicyBuilder (Neethi) which was not the case in 1.6.0. Is there any change
> > with respect to policy parsing that I should be aware of? I would
> > appreciate any help.
> >
> >
> >
> > Here is the stack trace:
> >
> >
> >
> > Caused by: java.lang.NullPointerException
> >
> > at
> > org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.getEventType(XMLStreamReaderWrapper.java:108)
> >
> > at
> > org.apache.axiom.util.stax.dialect.BEAStreamReaderWrapper.getEncoding(BEAStreamReaderWrapper.java:90)
> >
> > at
> > org.apache.axiom.om.impl.builder.StAXBuilder.<init>(StAXBuilder.java:125)
> >
> > at
> > org.apache.axiom.om.impl.builder.StAXOMBuilder.<init>(StAXOMBuilder.java:104)
> >
> > at
> > org.apache.axiom.om.impl.llom.factory.AbstractOMMetaFactory.createOMBuilder(AbstractOMMetaFactory.java:103)
> >
> > at
> > org.apache.axiom.om.OMXMLBuilderFactory.createOMBuilder(OMXMLBuilderFactory.java:295)
> >
> > at
> > org.apache.neethi.builders.converters.DOMToOMConverter.convert(DOMToOMConverter.java:36)
> >
> > at
> > org.apache.neethi.builders.converters.DOMToOMConverter.convert(DOMToOMConverter.java:32)
> >
> > at
> > org.apache.neethi.builders.converters.ConverterRegistry.convert(ConverterRegistry.java:159)
> >
> > at
> > org.apache.neethi.AssertionBuilderFactoryImpl.invokeBuilder(AssertionBuilderFactoryImpl.java:135)
> >
> > at
> > org.apache.neethi.AssertionBuilderFactoryImpl.build(AssertionBuilderFactoryImpl.java:117)
> >
> > at
> > org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:224)
> >
> > at
> > org.apache.neethi.PolicyBuilder.getAllOperator(PolicyBuilder.java:184)
> >
> > at
> > org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:217)
> >
> > at
> > org.apache.neethi.PolicyBuilder.getExactlyOneOperator(PolicyBuilder.java:180)
> >
> > at
> > org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:215)
> >
> > at
> > org.apache.neethi.PolicyBuilder.getPolicyOperator(PolicyBuilder.java:174)
> >
> > at org.apache.neethi.PolicyBuilder.getPolicy(PolicyBuilder.java:124)
> >
> > at org.apache.neethi.PolicyEngine.getPolicy(PolicyEngine.java:111)
> >
> > at
> > org.apache.axis2.util.PolicyUtil.getPolicyComponent(PolicyUtil.java:173)
> >
> > at
> > org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processPoliciesInDefintion(WSDL11ToAxisServiceBuilder.java:3120)
> >
> > at
> > org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processPoliciesInDefintion(WSDL11ToAxisServiceBuilder.java:3098)
> >
> > at
> > org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:374)
> >
> > at
> > org.apache.axis2.description.AxisService.createClientSideAxisService(AxisService.java:2369)
> >
> > at
> > org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:211)
> >
> >
> >
> > This is a sample services file. I am only showing a single operation, but I
> > have multiple operations, each with its own policy:
> >
> > <service name="WSSecurityTestService"
> > targetNamespace="http://wssecuritytest.impl.webservices.test.com">
> >
> > <schema
> > schemaNamespace="http://wssecuritytest.impl.webservices.test.com"/>
> >
> > <parameter
> > name="ServiceClass">com.test.webservices.impl.wssecuritytest.WSSecurityTestService</parameter>
> >
> > <parameter name="useOriginalwsdl">true</parameter>
> >
> > <parameter name="wsdlFile">WSSecurityTestService.wsdl</parameter>
> >
> > <parameter name="modifyUserWSDLPortAddress">true</parameter>
> >
> > <module ref="addressing"/>
> >
> > <messageReceivers>
> >
> > <messageReceiver
> > class="com.test.webservices.receivers.JAXBInOnlyMessageReceiver"
> > mep="http://www.w3.org/ns/wsdl/in-only"/>
> >
> > <messageReceiver
> > class="com.test.webservices.receivers.JAXBInOnlyMessageReceiver"
> > mep="http://www.w3.org/ns/wsdl/robust-in-only"/>
> >
> > <messageReceiver
> > class="com.test.webservices.receivers.JAXBMessageReceiver"
> > mep="http://www.w3.org/ns/wsdl/in-out"/>
> >
> > </messageReceivers>
> >
> > <operation mep="http://www.w3.org/ns/wsdl/in-out"
> > name="testSAMLTokenSignedNoFault">
> >
> >
> > <actionMapping>urn:test:WSSecurityTestService#testSAMLTokenSignedNoFault</actionMapping>
> >
> >
> > <outputActionMapping>urn:testSAMLTokenSignedNoFaultResponse</outputActionMapping>
> >
> > <faultActionMapping
> > faultName="RecoverableFault">urn:testSAMLTokenSignedNoFaultRecoverableFault</faultActionMapping>
> >
> > <faultActionMapping
> > faultName="UnrecoverableFault">urn:testSAMLTokenSignedNoFaultUnrecoverableFault</faultActionMapping>
> >
> > <messageReceiver
> > class="com.test.webservices.receivers.JAXBMessageReceiver"
> > mep="http://www.w3.org/ns/wsdl/in-out"/>
> >
> > <module ref="rampart"/>
> >
> > <wsp:Policy xmlns:wsp="http://www.w3.org/ns/ws-policy"
> > xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> > wsu:Id="SAMLPolicy">
> >
> > <wsp:ExactlyOne>
> >
> > <wsp:All>
> >
> > <sp:AsymmetricBinding
> > xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
> >
> > <wsp:Policy
> > xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
> >
> > <sp:InitiatorToken>
> >
> > <wsp:Policy>
> >
> > <sp:X509Token
> > sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
> >
> > <wsp:Policy>
> >
> > <sp:RequireThumbprintReference/>
> >
> > <sp:WssX509V1Token10/>
> >
> > </wsp:Policy>
> >
> > </sp:X509Token>
> >
> > </wsp:Policy>
> >
> > </sp:InitiatorToken>
> >
> > <sp:RecipientToken>
> >
> > <wsp:Policy>
> >
> > <sp:X509Token
> > sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
> >
> > <wsp:Policy>
> >
> > <sp:RequireThumbprintReference/>
> >
> > <sp:WssX509V3Token10/>
> >
> > </wsp:Policy>
> >
> > </sp:X509Token>
> >
> > </wsp:Policy>
> >
> > </sp:RecipientToken>
> >
> > <sp:AlgorithmSuite>
> >
> > <wsp:Policy>
> >
> > <sp:TripleDesRsa15/>
> >
> > </wsp:Policy>
> >
> > </sp:AlgorithmSuite>
> >
> > <sp:Layout>
> >
> > <wsp:Policy>
> >
> > <sp:Strict/>
> >
> > </wsp:Policy>
> >
> > </sp:Layout>
> >
> > <sp:IncludeTimestamp/>
> >
> > <sp:OnlySignEntireHeadersAndBody/>
> >
> > </wsp:Policy>
> >
> > </sp:AsymmetricBinding>
> >
> > <sp:Wss10
> > xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
> >
> > <wsp:Policy
> > xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
> >
> > <sp:MustSupportRefKeyIdentifier/>
> >
> > <sp:MustSupportRefIssuerSerial/>
> >
> > </wsp:Policy>
> >
> > </sp:Wss10>
> >
> > <sp:SignedParts
> > xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
> >
> > <sp:Body/>
> >
> > </sp:SignedParts>
> >
> > <rampart:RampartConfig
> > xmlns:rampart="http://ws.apache.org/rampart/policy">
> >
> > <rampart:user>interca</rampart:user>
> >
> >
> > <rampart:passwordCallbackClass>com.test.security2.webservices.WSS4JPWCallback</rampart:passwordCallbackClass>
> >
> >
> > <rampart:timestampPrecisionInMilliseconds>true</rampart:timestampPrecisionInMilliseconds>
> >
> > <rampart:timestampTTL>300</rampart:timestampTTL>
> >
> > <rampart:timestampMaxSkew>300</rampart:timestampMaxSkew>
> >
> > <rampart:nonceLifeTime>300</rampart:nonceLifeTime>
> >
> > <rampart:signatureCrypto>
> >
> > <rampart:crypto
> > provider="com.test.security2.csf.webservices.WSS4JCSFCryptoImpl">
> >
> > …
> >
> > </rampart:crypto>
> >
> > </rampart:signatureCrypto>
> >
> > </rampart:RampartConfig>
> >
> > </wsp:All>
> >
> > </wsp:ExactlyOne>
> >
> > </wsp:Policy>
> >
> > </operation>
> >
> > </service>
> >
> >
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>  		 	   		  

RE: WS-Policy issues when upgrading from Axis2 1.6.0 to Axis2 1.6.2

Posted by "Shah, Sumit (CGI Federal)" <Su...@cgifederal.com>.
I was able to get past these issues by upgrading Axiom to 1.2.14 and using the axiom-compat to address incompatibility issues with Rampart 1.6.2 .

Thanks
Sumit

From: Shah, Sumit (CGI Federal)
Sent: Wednesday, February 27, 2013 2:25 PM
To: java-user@axis.apache.org
Subject: RE: WS-Policy issues when upgrading from Axis2 1.6.0 to Axis2 1.6.2

Thanks Martin and Andreas. I will try out your suggestions.

Thanks
Sumit

From: Martin Gainty [mailto:mgainty@hotmail.com]
Sent: Tuesday, February 26, 2013 6:25 PM
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: RE: WS-Policy issues when upgrading from Axis2 1.6.0 to Axis2 1.6.2

Nota Bene for Woden Implementors
convert your wsdl 1.1 wsdl to wsdl2.0 before processing with woden..woden has a converter but its still in alpha
http://ws.apache.org/woden/

Thanks Andreas,
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.



> From: andreas.veithen@gmail.com<ma...@gmail.com>
> Date: Tue, 26 Feb 2013 22:12:59 +0100
> Subject: Re: WS-Policy issues when upgrading from Axis2 1.6.0 to Axis2 1.6.2
> To: java-user@axis.apache.org<ma...@axis.apache.org>
>
> That is a variant of AXIOM-401 [1]. The NullPointerException only
> occurs with ancient versions of BEA's StAX implementation. Either use
> Woodstox as StAX implementation or try to upgrade Axiom to 1.2.14.
>
> Andreas
>
> [1] https://issues.apache.org/jira/browse/AXIOM-401
>
> On Mon, Feb 25, 2013 at 11:54 PM, Shah, Sumit (CGI Federal)
> <Su...@cgifederal.com>> wrote:
> > Hello,
> >
> >
> >
> > I am running into WS Policy parsing issues when upgrading Axis2 from 1.6.0
> > to 1.6.2. The policies that successfully load (via
> > WSDL11ToAxisServiceBuilder.processPoliciesInDefintion) in version 1.6.0 do
> > not work when I go to 1.6.2. I do notice that in 1.6.2, Axis now uses
> > PolicyBuilder (Neethi) which was not the case in 1.6.0. Is there any change
> > with respect to policy parsing that I should be aware of? I would
> > appreciate any help.
> >
> >
> >
> > Here is the stack trace:
> >
> >
> >
> > Caused by: java.lang.NullPointerException
> >
> > at
> > org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.getEventType(XMLStreamReaderWrapper.java:108)
> >
> > at
> > org.apache.axiom.util.stax.dialect.BEAStreamReaderWrapper.getEncoding(BEAStreamReaderWrapper.java:90)
> >
> > at
> > org.apache.axiom.om.impl.builder.StAXBuilder.<init>(StAXBuilder.java:125)
> >
> > at
> > org.apache.axiom.om.impl.builder.StAXOMBuilder.<init>(StAXOMBuilder.java:104)
> >
> > at
> > org.apache.axiom.om.impl.llom.factory.AbstractOMMetaFactory.createOMBuilder(AbstractOMMetaFactory.java:103)
> >
> > at
> > org.apache.axiom.om.OMXMLBuilderFactory.createOMBuilder(OMXMLBuilderFactory.java:295)
> >
> > at
> > org.apache.neethi.builders.converters.DOMToOMConverter.convert(DOMToOMConverter.java:36)
> >
> > at
> > org.apache.neethi.builders.converters.DOMToOMConverter.convert(DOMToOMConverter.java:32)
> >
> > at
> > org.apache.neethi.builders.converters.ConverterRegistry.convert(ConverterRegistry.java:159)
> >
> > at
> > org.apache.neethi.AssertionBuilderFactoryImpl.invokeBuilder(AssertionBuilderFactoryImpl.java:135)
> >
> > at
> > org.apache.neethi.AssertionBuilderFactoryImpl.build(AssertionBuilderFactoryImpl.java:117)
> >
> > at
> > org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:224)
> >
> > at
> > org.apache.neethi.PolicyBuilder.getAllOperator(PolicyBuilder.java:184)
> >
> > at
> > org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:217)
> >
> > at
> > org.apache.neethi.PolicyBuilder.getExactlyOneOperator(PolicyBuilder.java:180)
> >
> > at
> > org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:215)
> >
> > at
> > org.apache.neethi.PolicyBuilder.getPolicyOperator(PolicyBuilder.java:174)
> >
> > at org.apache.neethi.PolicyBuilder.getPolicy(PolicyBuilder.java:124)
> >
> > at org.apache.neethi.PolicyEngine.getPolicy(PolicyEngine.java:111)
> >
> > at
> > org.apache.axis2.util.PolicyUtil.getPolicyComponent(PolicyUtil.java:173)
> >
> > at
> > org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processPoliciesInDefintion(WSDL11ToAxisServiceBuilder.java:3120)
> >
> > at
> > org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processPoliciesInDefintion(WSDL11ToAxisServiceBuilder.java:3098)
> >
> > at
> > org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:374)
> >
> > at
> > org.apache.axis2.description.AxisService.createClientSideAxisService(AxisService.java:2369)
> >
> > at
> > org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:211)
> >
> >
> >
> > This is a sample services file. I am only showing a single operation, but I
> > have multiple operations, each with its own policy:
> >
> > <service name="WSSecurityTestService"
> > targetNamespace="http://wssecuritytest.impl.webservices.test.com">
> >
> > <schema
> > schemaNamespace="http://wssecuritytest.impl.webservices.test.com"/>
> >
> > <parameter
> > name="ServiceClass">com.test.webservices.impl.wssecuritytest.WSSecurityTestService</parameter>
> >
> > <parameter name="useOriginalwsdl">true</parameter>
> >
> > <parameter name="wsdlFile">WSSecurityTestService.wsdl</parameter>
> >
> > <parameter name="modifyUserWSDLPortAddress">true</parameter>
> >
> > <module ref="addressing"/>
> >
> > <messageReceivers>
> >
> > <messageReceiver
> > class="com.test.webservices.receivers.JAXBInOnlyMessageReceiver"
> > mep="http://www.w3.org/ns/wsdl/in-only"/>
> >
> > <messageReceiver
> > class="com.test.webservices.receivers.JAXBInOnlyMessageReceiver"
> > mep="http://www.w3.org/ns/wsdl/robust-in-only"/>
> >
> > <messageReceiver
> > class="com.test.webservices.receivers.JAXBMessageReceiver"
> > mep="http://www.w3.org/ns/wsdl/in-out"/>
> >
> > </messageReceivers>
> >
> > <operation mep="http://www.w3.org/ns/wsdl/in-out"
> > name="testSAMLTokenSignedNoFault">
> >
> >
> > <actionMapping>urn:test:WSSecurityTestService#testSAMLTokenSignedNoFault</actionMapping>
> >
> >
> > <outputActionMapping>urn:testSAMLTokenSignedNoFaultResponse</outputActionMapping>
> >
> > <faultActionMapping
> > faultName="RecoverableFault">urn:testSAMLTokenSignedNoFaultRecoverableFault</faultActionMapping>
> >
> > <faultActionMapping
> > faultName="UnrecoverableFault">urn:testSAMLTokenSignedNoFaultUnrecoverableFault</faultActionMapping>
> >
> > <messageReceiver
> > class="com.test.webservices.receivers.JAXBMessageReceiver"
> > mep="http://www.w3.org/ns/wsdl/in-out"/>
> >
> > <module ref="rampart"/>
> >
> > <wsp:Policy xmlns:wsp="http://www.w3.org/ns/ws-policy"
> > xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> > wsu:Id="SAMLPolicy">
> >
> > <wsp:ExactlyOne>
> >
> > <wsp:All>
> >
> > <sp:AsymmetricBinding
> > xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
> >
> > <wsp:Policy
> > xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
> >
> > <sp:InitiatorToken>
> >
> > <wsp:Policy>
> >
> > <sp:X509Token
> > sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
> >
> > <wsp:Policy>
> >
> > <sp:RequireThumbprintReference/>
> >
> > <sp:WssX509V1Token10/>
> >
> > </wsp:Policy>
> >
> > </sp:X509Token>
> >
> > </wsp:Policy>
> >
> > </sp:InitiatorToken>
> >
> > <sp:RecipientToken>
> >
> > <wsp:Policy>
> >
> > <sp:X509Token
> > sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
> >
> > <wsp:Policy>
> >
> > <sp:RequireThumbprintReference/>
> >
> > <sp:WssX509V3Token10/>
> >
> > </wsp:Policy>
> >
> > </sp:X509Token>
> >
> > </wsp:Policy>
> >
> > </sp:RecipientToken>
> >
> > <sp:AlgorithmSuite>
> >
> > <wsp:Policy>
> >
> > <sp:TripleDesRsa15/>
> >
> > </wsp:Policy>
> >
> > </sp:AlgorithmSuite>
> >
> > <sp:Layout>
> >
> > <wsp:Policy>
> >
> > <sp:Strict/>
> >
> > </wsp:Policy>
> >
> > </sp:Layout>
> >
> > <sp:IncludeTimestamp/>
> >
> > <sp:OnlySignEntireHeadersAndBody/>
> >
> > </wsp:Policy>
> >
> > </sp:AsymmetricBinding>
> >
> > <sp:Wss10
> > xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
> >
> > <wsp:Policy
> > xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
> >
> > <sp:MustSupportRefKeyIdentifier/>
> >
> > <sp:MustSupportRefIssuerSerial/>
> >
> > </wsp:Policy>
> >
> > </sp:Wss10>
> >
> > <sp:SignedParts
> > xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
> >
> > <sp:Body/>
> >
> > </sp:SignedParts>
> >
> > <rampart:RampartConfig
> > xmlns:rampart="http://ws.apache.org/rampart/policy">
> >
> > <rampart:user>interca</rampart:user>
> >
> >
> > <rampart:passwordCallbackClass>com.test.security2.webservices.WSS4JPWCallback</rampart:passwordCallbackClass>
> >
> >
> > <rampart:timestampPrecisionInMilliseconds>true</rampart:timestampPrecisionInMilliseconds>
> >
> > <rampart:timestampTTL>300</rampart:timestampTTL>
> >
> > <rampart:timestampMaxSkew>300</rampart:timestampMaxSkew>
> >
> > <rampart:nonceLifeTime>300</rampart:nonceLifeTime>
> >
> > <rampart:signatureCrypto>
> >
> > <rampart:crypto
> > provider="com.test.security2.csf.webservices.WSS4JCSFCryptoImpl">
> >
> > ...
> >
> > </rampart:crypto>
> >
> > </rampart:signatureCrypto>
> >
> > </rampart:RampartConfig>
> >
> > </wsp:All>
> >
> > </wsp:ExactlyOne>
> >
> > </wsp:Policy>
> >
> > </operation>
> >
> > </service>
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org<ma...@axis.apache.org>
> For additional commands, e-mail: java-user-help@axis.apache.org<ma...@axis.apache.org>
>

RE: WS-Policy issues when upgrading from Axis2 1.6.0 to Axis2 1.6.2

Posted by "Shah, Sumit (CGI Federal)" <Su...@cgifederal.com>.
Thanks Martin and Andreas. I will try out your suggestions.

Thanks
Sumit

From: Martin Gainty [mailto:mgainty@hotmail.com]
Sent: Tuesday, February 26, 2013 6:25 PM
To: java-user@axis.apache.org
Subject: RE: WS-Policy issues when upgrading from Axis2 1.6.0 to Axis2 1.6.2

Nota Bene for Woden Implementors
convert your wsdl 1.1 wsdl to wsdl2.0 before processing with woden..woden has a converter but its still in alpha
http://ws.apache.org/woden/

Thanks Andreas,
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.


> From: andreas.veithen@gmail.com<ma...@gmail.com>
> Date: Tue, 26 Feb 2013 22:12:59 +0100
> Subject: Re: WS-Policy issues when upgrading from Axis2 1.6.0 to Axis2 1.6.2
> To: java-user@axis.apache.org<ma...@axis.apache.org>
>
> That is a variant of AXIOM-401 [1]. The NullPointerException only
> occurs with ancient versions of BEA's StAX implementation. Either use
> Woodstox as StAX implementation or try to upgrade Axiom to 1.2.14.
>
> Andreas
>
> [1] https://issues.apache.org/jira/browse/AXIOM-401
>
> On Mon, Feb 25, 2013 at 11:54 PM, Shah, Sumit (CGI Federal)
> <Su...@cgifederal.com>> wrote:
> > Hello,
> >
> >
> >
> > I am running into WS Policy parsing issues when upgrading Axis2 from 1.6.0
> > to 1.6.2. The policies that successfully load (via
> > WSDL11ToAxisServiceBuilder.processPoliciesInDefintion) in version 1.6.0 do
> > not work when I go to 1.6.2. I do notice that in 1.6.2, Axis now uses
> > PolicyBuilder (Neethi) which was not the case in 1.6.0. Is there any change
> > with respect to policy parsing that I should be aware of? I would
> > appreciate any help.
> >
> >
> >
> > Here is the stack trace:
> >
> >
> >
> > Caused by: java.lang.NullPointerException
> >
> > at
> > org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.getEventType(XMLStreamReaderWrapper.java:108)
> >
> > at
> > org.apache.axiom.util.stax.dialect.BEAStreamReaderWrapper.getEncoding(BEAStreamReaderWrapper.java:90)
> >
> > at
> > org.apache.axiom.om.impl.builder.StAXBuilder.<init>(StAXBuilder.java:125)
> >
> > at
> > org.apache.axiom.om.impl.builder.StAXOMBuilder.<init>(StAXOMBuilder.java:104)
> >
> > at
> > org.apache.axiom.om.impl.llom.factory.AbstractOMMetaFactory.createOMBuilder(AbstractOMMetaFactory.java:103)
> >
> > at
> > org.apache.axiom.om.OMXMLBuilderFactory.createOMBuilder(OMXMLBuilderFactory.java:295)
> >
> > at
> > org.apache.neethi.builders.converters.DOMToOMConverter.convert(DOMToOMConverter.java:36)
> >
> > at
> > org.apache.neethi.builders.converters.DOMToOMConverter.convert(DOMToOMConverter.java:32)
> >
> > at
> > org.apache.neethi.builders.converters.ConverterRegistry.convert(ConverterRegistry.java:159)
> >
> > at
> > org.apache.neethi.AssertionBuilderFactoryImpl.invokeBuilder(AssertionBuilderFactoryImpl.java:135)
> >
> > at
> > org.apache.neethi.AssertionBuilderFactoryImpl.build(AssertionBuilderFactoryImpl.java:117)
> >
> > at
> > org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:224)
> >
> > at
> > org.apache.neethi.PolicyBuilder.getAllOperator(PolicyBuilder.java:184)
> >
> > at
> > org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:217)
> >
> > at
> > org.apache.neethi.PolicyBuilder.getExactlyOneOperator(PolicyBuilder.java:180)
> >
> > at
> > org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:215)
> >
> > at
> > org.apache.neethi.PolicyBuilder.getPolicyOperator(PolicyBuilder.java:174)
> >
> > at org.apache.neethi.PolicyBuilder.getPolicy(PolicyBuilder.java:124)
> >
> > at org.apache.neethi.PolicyEngine.getPolicy(PolicyEngine.java:111)
> >
> > at
> > org.apache.axis2.util.PolicyUtil.getPolicyComponent(PolicyUtil.java:173)
> >
> > at
> > org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processPoliciesInDefintion(WSDL11ToAxisServiceBuilder.java:3120)
> >
> > at
> > org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processPoliciesInDefintion(WSDL11ToAxisServiceBuilder.java:3098)
> >
> > at
> > org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:374)
> >
> > at
> > org.apache.axis2.description.AxisService.createClientSideAxisService(AxisService.java:2369)
> >
> > at
> > org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:211)
> >
> >
> >
> > This is a sample services file. I am only showing a single operation, but I
> > have multiple operations, each with its own policy:
> >
> > <service name="WSSecurityTestService"
> > targetNamespace="http://wssecuritytest.impl.webservices.test.com">
> >
> > <schema
> > schemaNamespace="http://wssecuritytest.impl.webservices.test.com"/>
> >
> > <parameter
> > name="ServiceClass">com.test.webservices.impl.wssecuritytest.WSSecurityTestService</parameter>
> >
> > <parameter name="useOriginalwsdl">true</parameter>
> >
> > <parameter name="wsdlFile">WSSecurityTestService.wsdl</parameter>
> >
> > <parameter name="modifyUserWSDLPortAddress">true</parameter>
> >
> > <module ref="addressing"/>
> >
> > <messageReceivers>
> >
> > <messageReceiver
> > class="com.test.webservices.receivers.JAXBInOnlyMessageReceiver"
> > mep="http://www.w3.org/ns/wsdl/in-only"/>
> >
> > <messageReceiver
> > class="com.test.webservices.receivers.JAXBInOnlyMessageReceiver"
> > mep="http://www.w3.org/ns/wsdl/robust-in-only"/>
> >
> > <messageReceiver
> > class="com.test.webservices.receivers.JAXBMessageReceiver"
> > mep="http://www.w3.org/ns/wsdl/in-out"/>
> >
> > </messageReceivers>
> >
> > <operation mep="http://www.w3.org/ns/wsdl/in-out"
> > name="testSAMLTokenSignedNoFault">
> >
> >
> > <actionMapping>urn:test:WSSecurityTestService#testSAMLTokenSignedNoFault</actionMapping>
> >
> >
> > <outputActionMapping>urn:testSAMLTokenSignedNoFaultResponse</outputActionMapping>
> >
> > <faultActionMapping
> > faultName="RecoverableFault">urn:testSAMLTokenSignedNoFaultRecoverableFault</faultActionMapping>
> >
> > <faultActionMapping
> > faultName="UnrecoverableFault">urn:testSAMLTokenSignedNoFaultUnrecoverableFault</faultActionMapping>
> >
> > <messageReceiver
> > class="com.test.webservices.receivers.JAXBMessageReceiver"
> > mep="http://www.w3.org/ns/wsdl/in-out"/>
> >
> > <module ref="rampart"/>
> >
> > <wsp:Policy xmlns:wsp="http://www.w3.org/ns/ws-policy"
> > xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> > wsu:Id="SAMLPolicy">
> >
> > <wsp:ExactlyOne>
> >
> > <wsp:All>
> >
> > <sp:AsymmetricBinding
> > xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
> >
> > <wsp:Policy
> > xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
> >
> > <sp:InitiatorToken>
> >
> > <wsp:Policy>
> >
> > <sp:X509Token
> > sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
> >
> > <wsp:Policy>
> >
> > <sp:RequireThumbprintReference/>
> >
> > <sp:WssX509V1Token10/>
> >
> > </wsp:Policy>
> >
> > </sp:X509Token>
> >
> > </wsp:Policy>
> >
> > </sp:InitiatorToken>
> >
> > <sp:RecipientToken>
> >
> > <wsp:Policy>
> >
> > <sp:X509Token
> > sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
> >
> > <wsp:Policy>
> >
> > <sp:RequireThumbprintReference/>
> >
> > <sp:WssX509V3Token10/>
> >
> > </wsp:Policy>
> >
> > </sp:X509Token>
> >
> > </wsp:Policy>
> >
> > </sp:RecipientToken>
> >
> > <sp:AlgorithmSuite>
> >
> > <wsp:Policy>
> >
> > <sp:TripleDesRsa15/>
> >
> > </wsp:Policy>
> >
> > </sp:AlgorithmSuite>
> >
> > <sp:Layout>
> >
> > <wsp:Policy>
> >
> > <sp:Strict/>
> >
> > </wsp:Policy>
> >
> > </sp:Layout>
> >
> > <sp:IncludeTimestamp/>
> >
> > <sp:OnlySignEntireHeadersAndBody/>
> >
> > </wsp:Policy>
> >
> > </sp:AsymmetricBinding>
> >
> > <sp:Wss10
> > xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
> >
> > <wsp:Policy
> > xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
> >
> > <sp:MustSupportRefKeyIdentifier/>
> >
> > <sp:MustSupportRefIssuerSerial/>
> >
> > </wsp:Policy>
> >
> > </sp:Wss10>
> >
> > <sp:SignedParts
> > xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
> >
> > <sp:Body/>
> >
> > </sp:SignedParts>
> >
> > <rampart:RampartConfig
> > xmlns:rampart="http://ws.apache.org/rampart/policy">
> >
> > <rampart:user>interca</rampart:user>
> >
> >
> > <rampart:passwordCallbackClass>com.test.security2.webservices.WSS4JPWCallback</rampart:passwordCallbackClass>
> >
> >
> > <rampart:timestampPrecisionInMilliseconds>true</rampart:timestampPrecisionInMilliseconds>
> >
> > <rampart:timestampTTL>300</rampart:timestampTTL>
> >
> > <rampart:timestampMaxSkew>300</rampart:timestampMaxSkew>
> >
> > <rampart:nonceLifeTime>300</rampart:nonceLifeTime>
> >
> > <rampart:signatureCrypto>
> >
> > <rampart:crypto
> > provider="com.test.security2.csf.webservices.WSS4JCSFCryptoImpl">
> >
> > ...
> >
> > </rampart:crypto>
> >
> > </rampart:signatureCrypto>
> >
> > </rampart:RampartConfig>
> >
> > </wsp:All>
> >
> > </wsp:ExactlyOne>
> >
> > </wsp:Policy>
> >
> > </operation>
> >
> > </service>
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org<ma...@axis.apache.org>
> For additional commands, e-mail: java-user-help@axis.apache.org<ma...@axis.apache.org>
>

RE: WS-Policy issues when upgrading from Axis2 1.6.0 to Axis2 1.6.2

Posted by Martin Gainty <mg...@hotmail.com>.
Nota Bene for Woden Implementors
convert your wsdl 1.1 wsdl to wsdl2.0 before processing with woden..woden has a converter but its still in alpha 
http://ws.apache.org/woden/

Thanks Andreas,
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.


> From: andreas.veithen@gmail.com
> Date: Tue, 26 Feb 2013 22:12:59 +0100
> Subject: Re: WS-Policy issues when upgrading from Axis2 1.6.0 to Axis2 1.6.2
> To: java-user@axis.apache.org
> 
> That is a variant of AXIOM-401 [1]. The NullPointerException only
> occurs with ancient versions of BEA's StAX implementation. Either use
> Woodstox as StAX implementation or try to upgrade Axiom to 1.2.14.
> 
> Andreas
> 
> [1] https://issues.apache.org/jira/browse/AXIOM-401
> 
> On Mon, Feb 25, 2013 at 11:54 PM, Shah, Sumit (CGI Federal)
> <Su...@cgifederal.com> wrote:
> > Hello,
> >
> >
> >
> > I am running into WS Policy parsing issues when upgrading Axis2 from 1.6.0
> > to 1.6.2. The policies that successfully load (via
> > WSDL11ToAxisServiceBuilder.processPoliciesInDefintion) in version 1.6.0 do
> > not work when I go to 1.6.2. I do notice that in 1.6.2, Axis now uses
> > PolicyBuilder (Neethi) which was not the case in 1.6.0. Is there any change
> > with respect to policy parsing that I should  be aware of? I would
> > appreciate any help.
> >
> >
> >
> > Here is the stack trace:
> >
> >
> >
> > Caused by: java.lang.NullPointerException
> >
> >         at
> > org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.getEventType(XMLStreamReaderWrapper.java:108)
> >
> >         at
> > org.apache.axiom.util.stax.dialect.BEAStreamReaderWrapper.getEncoding(BEAStreamReaderWrapper.java:90)
> >
> >         at
> > org.apache.axiom.om.impl.builder.StAXBuilder.<init>(StAXBuilder.java:125)
> >
> >         at
> > org.apache.axiom.om.impl.builder.StAXOMBuilder.<init>(StAXOMBuilder.java:104)
> >
> >         at
> > org.apache.axiom.om.impl.llom.factory.AbstractOMMetaFactory.createOMBuilder(AbstractOMMetaFactory.java:103)
> >
> >         at
> > org.apache.axiom.om.OMXMLBuilderFactory.createOMBuilder(OMXMLBuilderFactory.java:295)
> >
> >         at
> > org.apache.neethi.builders.converters.DOMToOMConverter.convert(DOMToOMConverter.java:36)
> >
> >         at
> > org.apache.neethi.builders.converters.DOMToOMConverter.convert(DOMToOMConverter.java:32)
> >
> >         at
> > org.apache.neethi.builders.converters.ConverterRegistry.convert(ConverterRegistry.java:159)
> >
> >         at
> > org.apache.neethi.AssertionBuilderFactoryImpl.invokeBuilder(AssertionBuilderFactoryImpl.java:135)
> >
> >         at
> > org.apache.neethi.AssertionBuilderFactoryImpl.build(AssertionBuilderFactoryImpl.java:117)
> >
> >         at
> > org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:224)
> >
> >         at
> > org.apache.neethi.PolicyBuilder.getAllOperator(PolicyBuilder.java:184)
> >
> >         at
> > org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:217)
> >
> >         at
> > org.apache.neethi.PolicyBuilder.getExactlyOneOperator(PolicyBuilder.java:180)
> >
> >         at
> > org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:215)
> >
> >         at
> > org.apache.neethi.PolicyBuilder.getPolicyOperator(PolicyBuilder.java:174)
> >
> >         at org.apache.neethi.PolicyBuilder.getPolicy(PolicyBuilder.java:124)
> >
> >         at org.apache.neethi.PolicyEngine.getPolicy(PolicyEngine.java:111)
> >
> >         at
> > org.apache.axis2.util.PolicyUtil.getPolicyComponent(PolicyUtil.java:173)
> >
> >         at
> > org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processPoliciesInDefintion(WSDL11ToAxisServiceBuilder.java:3120)
> >
> >         at
> > org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processPoliciesInDefintion(WSDL11ToAxisServiceBuilder.java:3098)
> >
> >         at
> > org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:374)
> >
> >         at
> > org.apache.axis2.description.AxisService.createClientSideAxisService(AxisService.java:2369)
> >
> >         at
> > org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:211)
> >
> >
> >
> > This is a sample services file. I am only showing a single operation, but I
> > have multiple operations, each with its own policy:
> >
> > <service name="WSSecurityTestService"
> > targetNamespace="http://wssecuritytest.impl.webservices.test.com">
> >
> >   <schema
> > schemaNamespace="http://wssecuritytest.impl.webservices.test.com"/>
> >
> >   <parameter
> > name="ServiceClass">com.test.webservices.impl.wssecuritytest.WSSecurityTestService</parameter>
> >
> >   <parameter name="useOriginalwsdl">true</parameter>
> >
> >   <parameter name="wsdlFile">WSSecurityTestService.wsdl</parameter>
> >
> >   <parameter name="modifyUserWSDLPortAddress">true</parameter>
> >
> >   <module ref="addressing"/>
> >
> >   <messageReceivers>
> >
> >     <messageReceiver
> > class="com.test.webservices.receivers.JAXBInOnlyMessageReceiver"
> > mep="http://www.w3.org/ns/wsdl/in-only"/>
> >
> >     <messageReceiver
> > class="com.test.webservices.receivers.JAXBInOnlyMessageReceiver"
> > mep="http://www.w3.org/ns/wsdl/robust-in-only"/>
> >
> >     <messageReceiver
> > class="com.test.webservices.receivers.JAXBMessageReceiver"
> > mep="http://www.w3.org/ns/wsdl/in-out"/>
> >
> >   </messageReceivers>
> >
> > <operation mep="http://www.w3.org/ns/wsdl/in-out"
> > name="testSAMLTokenSignedNoFault">
> >
> >
> > <actionMapping>urn:test:WSSecurityTestService#testSAMLTokenSignedNoFault</actionMapping>
> >
> >
> > <outputActionMapping>urn:testSAMLTokenSignedNoFaultResponse</outputActionMapping>
> >
> >     <faultActionMapping
> > faultName="RecoverableFault">urn:testSAMLTokenSignedNoFaultRecoverableFault</faultActionMapping>
> >
> >     <faultActionMapping
> > faultName="UnrecoverableFault">urn:testSAMLTokenSignedNoFaultUnrecoverableFault</faultActionMapping>
> >
> >     <messageReceiver
> > class="com.test.webservices.receivers.JAXBMessageReceiver"
> > mep="http://www.w3.org/ns/wsdl/in-out"/>
> >
> >     <module ref="rampart"/>
> >
> >     <wsp:Policy xmlns:wsp="http://www.w3.org/ns/ws-policy"
> > xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> > wsu:Id="SAMLPolicy">
> >
> >       <wsp:ExactlyOne>
> >
> >         <wsp:All>
> >
> >           <sp:AsymmetricBinding
> > xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
> >
> >             <wsp:Policy
> > xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
> >
> >               <sp:InitiatorToken>
> >
> >                 <wsp:Policy>
> >
> >                   <sp:X509Token
> > sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
> >
> >                     <wsp:Policy>
> >
> >                       <sp:RequireThumbprintReference/>
> >
> >                       <sp:WssX509V1Token10/>
> >
> >                     </wsp:Policy>
> >
> >                   </sp:X509Token>
> >
> >                 </wsp:Policy>
> >
> >               </sp:InitiatorToken>
> >
> >               <sp:RecipientToken>
> >
> >                 <wsp:Policy>
> >
> >                   <sp:X509Token
> > sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
> >
> >                     <wsp:Policy>
> >
> >                       <sp:RequireThumbprintReference/>
> >
> >                       <sp:WssX509V3Token10/>
> >
> >                     </wsp:Policy>
> >
> >                   </sp:X509Token>
> >
> >                 </wsp:Policy>
> >
> >               </sp:RecipientToken>
> >
> >               <sp:AlgorithmSuite>
> >
> >                 <wsp:Policy>
> >
> >                   <sp:TripleDesRsa15/>
> >
> >                 </wsp:Policy>
> >
> >               </sp:AlgorithmSuite>
> >
> >               <sp:Layout>
> >
> >                 <wsp:Policy>
> >
> >                   <sp:Strict/>
> >
> >                 </wsp:Policy>
> >
> >               </sp:Layout>
> >
> >               <sp:IncludeTimestamp/>
> >
> >               <sp:OnlySignEntireHeadersAndBody/>
> >
> >             </wsp:Policy>
> >
> >           </sp:AsymmetricBinding>
> >
> >           <sp:Wss10
> > xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
> >
> >             <wsp:Policy
> > xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
> >
> >               <sp:MustSupportRefKeyIdentifier/>
> >
> >               <sp:MustSupportRefIssuerSerial/>
> >
> >             </wsp:Policy>
> >
> >           </sp:Wss10>
> >
> >           <sp:SignedParts
> > xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
> >
> >             <sp:Body/>
> >
> >           </sp:SignedParts>
> >
> >           <rampart:RampartConfig
> > xmlns:rampart="http://ws.apache.org/rampart/policy">
> >
> >             <rampart:user>interca</rampart:user>
> >
> >
> > <rampart:passwordCallbackClass>com.test.security2.webservices.WSS4JPWCallback</rampart:passwordCallbackClass>
> >
> >
> > <rampart:timestampPrecisionInMilliseconds>true</rampart:timestampPrecisionInMilliseconds>
> >
> >             <rampart:timestampTTL>300</rampart:timestampTTL>
> >
> >             <rampart:timestampMaxSkew>300</rampart:timestampMaxSkew>
> >
> >             <rampart:nonceLifeTime>300</rampart:nonceLifeTime>
> >
> >             <rampart:signatureCrypto>
> >
> >               <rampart:crypto
> > provider="com.test.security2.csf.webservices.WSS4JCSFCryptoImpl">
> >
> >                 …
> >
> >               </rampart:crypto>
> >
> >             </rampart:signatureCrypto>
> >
> >           </rampart:RampartConfig>
> >
> >         </wsp:All>
> >
> >       </wsp:ExactlyOne>
> >
> >     </wsp:Policy>
> >
> >   </operation>
> >
> > </service>
> >
> >
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
> 
 		 	   		  

Re: WS-Policy issues when upgrading from Axis2 1.6.0 to Axis2 1.6.2

Posted by Andreas Veithen <an...@gmail.com>.
That is a variant of AXIOM-401 [1]. The NullPointerException only
occurs with ancient versions of BEA's StAX implementation. Either use
Woodstox as StAX implementation or try to upgrade Axiom to 1.2.14.

Andreas

[1] https://issues.apache.org/jira/browse/AXIOM-401

On Mon, Feb 25, 2013 at 11:54 PM, Shah, Sumit (CGI Federal)
<Su...@cgifederal.com> wrote:
> Hello,
>
>
>
> I am running into WS Policy parsing issues when upgrading Axis2 from 1.6.0
> to 1.6.2. The policies that successfully load (via
> WSDL11ToAxisServiceBuilder.processPoliciesInDefintion) in version 1.6.0 do
> not work when I go to 1.6.2. I do notice that in 1.6.2, Axis now uses
> PolicyBuilder (Neethi) which was not the case in 1.6.0. Is there any change
> with respect to policy parsing that I should  be aware of? I would
> appreciate any help.
>
>
>
> Here is the stack trace:
>
>
>
> Caused by: java.lang.NullPointerException
>
>         at
> org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.getEventType(XMLStreamReaderWrapper.java:108)
>
>         at
> org.apache.axiom.util.stax.dialect.BEAStreamReaderWrapper.getEncoding(BEAStreamReaderWrapper.java:90)
>
>         at
> org.apache.axiom.om.impl.builder.StAXBuilder.<init>(StAXBuilder.java:125)
>
>         at
> org.apache.axiom.om.impl.builder.StAXOMBuilder.<init>(StAXOMBuilder.java:104)
>
>         at
> org.apache.axiom.om.impl.llom.factory.AbstractOMMetaFactory.createOMBuilder(AbstractOMMetaFactory.java:103)
>
>         at
> org.apache.axiom.om.OMXMLBuilderFactory.createOMBuilder(OMXMLBuilderFactory.java:295)
>
>         at
> org.apache.neethi.builders.converters.DOMToOMConverter.convert(DOMToOMConverter.java:36)
>
>         at
> org.apache.neethi.builders.converters.DOMToOMConverter.convert(DOMToOMConverter.java:32)
>
>         at
> org.apache.neethi.builders.converters.ConverterRegistry.convert(ConverterRegistry.java:159)
>
>         at
> org.apache.neethi.AssertionBuilderFactoryImpl.invokeBuilder(AssertionBuilderFactoryImpl.java:135)
>
>         at
> org.apache.neethi.AssertionBuilderFactoryImpl.build(AssertionBuilderFactoryImpl.java:117)
>
>         at
> org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:224)
>
>         at
> org.apache.neethi.PolicyBuilder.getAllOperator(PolicyBuilder.java:184)
>
>         at
> org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:217)
>
>         at
> org.apache.neethi.PolicyBuilder.getExactlyOneOperator(PolicyBuilder.java:180)
>
>         at
> org.apache.neethi.PolicyBuilder.processOperationElement(PolicyBuilder.java:215)
>
>         at
> org.apache.neethi.PolicyBuilder.getPolicyOperator(PolicyBuilder.java:174)
>
>         at org.apache.neethi.PolicyBuilder.getPolicy(PolicyBuilder.java:124)
>
>         at org.apache.neethi.PolicyEngine.getPolicy(PolicyEngine.java:111)
>
>         at
> org.apache.axis2.util.PolicyUtil.getPolicyComponent(PolicyUtil.java:173)
>
>         at
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processPoliciesInDefintion(WSDL11ToAxisServiceBuilder.java:3120)
>
>         at
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processPoliciesInDefintion(WSDL11ToAxisServiceBuilder.java:3098)
>
>         at
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:374)
>
>         at
> org.apache.axis2.description.AxisService.createClientSideAxisService(AxisService.java:2369)
>
>         at
> org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:211)
>
>
>
> This is a sample services file. I am only showing a single operation, but I
> have multiple operations, each with its own policy:
>
> <service name="WSSecurityTestService"
> targetNamespace="http://wssecuritytest.impl.webservices.test.com">
>
>   <schema
> schemaNamespace="http://wssecuritytest.impl.webservices.test.com"/>
>
>   <parameter
> name="ServiceClass">com.test.webservices.impl.wssecuritytest.WSSecurityTestService</parameter>
>
>   <parameter name="useOriginalwsdl">true</parameter>
>
>   <parameter name="wsdlFile">WSSecurityTestService.wsdl</parameter>
>
>   <parameter name="modifyUserWSDLPortAddress">true</parameter>
>
>   <module ref="addressing"/>
>
>   <messageReceivers>
>
>     <messageReceiver
> class="com.test.webservices.receivers.JAXBInOnlyMessageReceiver"
> mep="http://www.w3.org/ns/wsdl/in-only"/>
>
>     <messageReceiver
> class="com.test.webservices.receivers.JAXBInOnlyMessageReceiver"
> mep="http://www.w3.org/ns/wsdl/robust-in-only"/>
>
>     <messageReceiver
> class="com.test.webservices.receivers.JAXBMessageReceiver"
> mep="http://www.w3.org/ns/wsdl/in-out"/>
>
>   </messageReceivers>
>
> <operation mep="http://www.w3.org/ns/wsdl/in-out"
> name="testSAMLTokenSignedNoFault">
>
>
> <actionMapping>urn:test:WSSecurityTestService#testSAMLTokenSignedNoFault</actionMapping>
>
>
> <outputActionMapping>urn:testSAMLTokenSignedNoFaultResponse</outputActionMapping>
>
>     <faultActionMapping
> faultName="RecoverableFault">urn:testSAMLTokenSignedNoFaultRecoverableFault</faultActionMapping>
>
>     <faultActionMapping
> faultName="UnrecoverableFault">urn:testSAMLTokenSignedNoFaultUnrecoverableFault</faultActionMapping>
>
>     <messageReceiver
> class="com.test.webservices.receivers.JAXBMessageReceiver"
> mep="http://www.w3.org/ns/wsdl/in-out"/>
>
>     <module ref="rampart"/>
>
>     <wsp:Policy xmlns:wsp="http://www.w3.org/ns/ws-policy"
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> wsu:Id="SAMLPolicy">
>
>       <wsp:ExactlyOne>
>
>         <wsp:All>
>
>           <sp:AsymmetricBinding
> xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
>
>             <wsp:Policy
> xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
>
>               <sp:InitiatorToken>
>
>                 <wsp:Policy>
>
>                   <sp:X509Token
> sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
>
>                     <wsp:Policy>
>
>                       <sp:RequireThumbprintReference/>
>
>                       <sp:WssX509V1Token10/>
>
>                     </wsp:Policy>
>
>                   </sp:X509Token>
>
>                 </wsp:Policy>
>
>               </sp:InitiatorToken>
>
>               <sp:RecipientToken>
>
>                 <wsp:Policy>
>
>                   <sp:X509Token
> sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
>
>                     <wsp:Policy>
>
>                       <sp:RequireThumbprintReference/>
>
>                       <sp:WssX509V3Token10/>
>
>                     </wsp:Policy>
>
>                   </sp:X509Token>
>
>                 </wsp:Policy>
>
>               </sp:RecipientToken>
>
>               <sp:AlgorithmSuite>
>
>                 <wsp:Policy>
>
>                   <sp:TripleDesRsa15/>
>
>                 </wsp:Policy>
>
>               </sp:AlgorithmSuite>
>
>               <sp:Layout>
>
>                 <wsp:Policy>
>
>                   <sp:Strict/>
>
>                 </wsp:Policy>
>
>               </sp:Layout>
>
>               <sp:IncludeTimestamp/>
>
>               <sp:OnlySignEntireHeadersAndBody/>
>
>             </wsp:Policy>
>
>           </sp:AsymmetricBinding>
>
>           <sp:Wss10
> xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
>
>             <wsp:Policy
> xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
>
>               <sp:MustSupportRefKeyIdentifier/>
>
>               <sp:MustSupportRefIssuerSerial/>
>
>             </wsp:Policy>
>
>           </sp:Wss10>
>
>           <sp:SignedParts
> xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
>
>             <sp:Body/>
>
>           </sp:SignedParts>
>
>           <rampart:RampartConfig
> xmlns:rampart="http://ws.apache.org/rampart/policy">
>
>             <rampart:user>interca</rampart:user>
>
>
> <rampart:passwordCallbackClass>com.test.security2.webservices.WSS4JPWCallback</rampart:passwordCallbackClass>
>
>
> <rampart:timestampPrecisionInMilliseconds>true</rampart:timestampPrecisionInMilliseconds>
>
>             <rampart:timestampTTL>300</rampart:timestampTTL>
>
>             <rampart:timestampMaxSkew>300</rampart:timestampMaxSkew>
>
>             <rampart:nonceLifeTime>300</rampart:nonceLifeTime>
>
>             <rampart:signatureCrypto>
>
>               <rampart:crypto
> provider="com.test.security2.csf.webservices.WSS4JCSFCryptoImpl">
>
>                 …
>
>               </rampart:crypto>
>
>             </rampart:signatureCrypto>
>
>           </rampart:RampartConfig>
>
>         </wsp:All>
>
>       </wsp:ExactlyOne>
>
>     </wsp:Policy>
>
>   </operation>
>
> </service>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org