[prev in list] [next in list] [prev in thread] [next in thread] 

List:       axis-user
Subject:    Re: IllegalArgumentException: ProtectionToken is not a <wsp:Policy> element.
From:       Andreas Veithen <andreas.veithen () gmail ! com>
Date:       2011-12-23 11:38:22
Message-ID: CADx4_uWfbGs1s4-mRXaMje5pHwtbusjePHYjN0o3HcT7HsOKjw () mail ! gmail ! com
[Download RAW message or body]

This should work as expected with Axis2 1.6.2-SNAPSHOT and Rampart
1.6.2-SNAPSHOT.

Andreas

On Thu, Dec 1, 2011 at 01:58, Brett Walker <brett.walker@geometryit.com> wrote:
> Hi,
>
>
>
> I have been struggling with a problem for a few hours that I have with Axis2
> and
>
> Rampart. I have googled quite extensively and have yet to found a solution.
> I
>
> have even looked at the source code and stepped through it. Though this has
>
> enlightened me about the error and its cause it has not brought me closer to
> a
>
> solution.
>
>
>
> The error that is occurring is
>
>
>
>   java.lang.IllegalArgumentException:
> {http://schemas.xmlsoap.org/ws/2005/07/securitypolicy}ProtectionToken is not
> a <wsp:Policy> element.
>
>
>
> For the full stacktrace see attached stacktrace.txt file.
>
>
>
> While I have used Axis2 before, I'm no expert with it and even less so with
> Rampart.
>
> I have an existing Web App that needs to be extended to introduce a client
> for a
>
> Web Service interaction. I have installed Axis2 v1.6.1 and Rampart v1.6.1 as
>
> instructed, i.e. set AXIS2_HOME and copied Rampart's libs and modules to the
>
> appropriate places under the Axis2 installation. I built the client-side
> Java classes
>
> using the WSDL2Java script and bundled the generated classes into a jar
>
> (WebServiceClient.jar). The WSDL and XSD are in the attached wsdl.zip file.
> I then
>
> added the appropriate jars and modules to the existing Web App; see the
>
> following diagram for more information.
>
>
>
>   \WebApp
>
>   |
>
>   |-\ ( other directories )
>
>   |
>
>   |-\WEB-INF
>
>     |
>
>     |-\( other directories )
>
>     |
>
>     |-\lib includes AXIS2 and Rampart jars and WebServiceClient.jar
>
>     |
>
>     |-\repository
>
>       |
>
>       |-\modules includes AXIS2 and Rampart modules
>
>       |
>
>       |-\services ( empty )
>
>
>
> The section of code that initialises the Web Services is as follows:
>
>
>
>   try
>
>   {
>
>     ConfigurationContext context =
> ConfigurationContextFactory.createConfigurationContextFromFileSystem(
> this.getWebInfPath() + "repository" );
>
>
>
> **  ablisContentManagementService = new ContentManagementServiceStub(
> context, "http://services.ablis.uat.business.gov.au/ContentManagement.svc"
> );
>
>
>
>     ServiceClient ablisContentManagementServiceClient =
> ablisContentManagementService._getServiceClient();
>
>
>
>     ablisContentManagementServiceClient.engageModule( "addressing" );
>
>     ablisContentManagementServiceClient.engageModule( "rampart" );
>
>
>
>     ablisAxisFault = null;
>
>   }
>
>   catch ( AxisFault af )
>
>   {
>
>     ablisContentManagementService = null;
>
>     ablisAxisFault = af;
>
>     af.printStackTrace();
>
>   }
>
>   catch ( Throwable t )
>
>   {
>
>     t.printStackTrace();
>
>   }
>
>
>
> I know that Rampart is not configured properly but the error is being thrown
>
> at the highlighted line; even before the Rampart configuration, if done.
>
>
>
> In debugging, I noticed that the XML, as an OMElement instance, being passed
>
> to the SymmetricBindingBuilder.build(see stacktrace) is the following:
>
>
>
>   <wsp:Policy>
>
>     <sp:ProtectionToken>
>
>       <wsp:Policy>
>
>         <sp:X509Token
> sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
>
>           <wsp:Policy>
>
>             <sp:RequireDerivedKeys/>
>
>             <sp:RequireThumbprintReference/>
>
>             <sp:WssX509V3Token10/>
>
>           </wsp:Policy>
>
>         </sp:X509Token>
>
>       </wsp:Policy>
>
>     </sp:ProtectionToken>
>
>     <sp:AlgorithmSuite>
>
>       <wsp:Policy>
>
>         <sp:Basic256Sha256/>
>
>       </wsp:Policy>
>
>     </sp:AlgorithmSuite>
>
>     <sp:Layout>
>
>       <wsp:Policy>
>
>         <sp:Strict/>
>
>       </wsp:Policy>
>
>     </sp:Layout>
>
>     <sp:IncludeTimestamp/>
>
>     <sp:EncryptSignature/>
>
>     <sp:OnlySignEntireHeadersAndBody/>
>
>   </wsp:Policy>
>
>
>
> From the code in SymmetricBindingBuilder.build(), I think the XML should be:
>
>
>
>   <sp:SymmetricBinding
> xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
>
>     <wsp:Policy>
>
>       <sp:ProtectionToken>
>
>         <wsp:Policy>
>
>           <sp:X509Token
> sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
>
>             <wsp:Policy>
>
>               <sp:RequireDerivedKeys/>
>
>               <sp:RequireThumbprintReference/>
>
>               <sp:WssX509V3Token10/>
>
>             </wsp:Policy>
>
>           </sp:X509Token>
>
>         </wsp:Policy>
>
>       </sp:ProtectionToken>
>
>       <sp:AlgorithmSuite>
>
>         <wsp:Policy>
>
>           <sp:Basic256Sha256/>
>
>         </wsp:Policy>
>
>       </sp:AlgorithmSuite>
>
>       <sp:Layout>
>
>         <wsp:Policy>
>
>           <sp:Strict/>
>
>         </wsp:Policy>
>
>       </sp:Layout>
>
>       <sp:IncludeTimestamp/>
>
>       <sp:EncryptSignature/>
>
>       <sp:OnlySignEntireHeadersAndBody/>
>
>     </wsp:Policy>
>
>   </sp:SymmetricBinding>
>
>
>
> This would fix the error but how to accomplish this.
>
>
>
> I may have made errors or omissions in what I have said or done, if so
> please highlight
>
> these. I'm familiar with Axis2 and not at all with Rampart so any help is
> appreciated. I
>
> am happy to answer questions. Any help is greatly appreciated.
>
>
>
> Thanks in kind,
>
> Brett
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic