Uploaded image for project: 'Rampart'
  1. Rampart
  2. RAMPART-324

Caused by: org.apache.ws.security.WSSecurityException: General security error (WSEncryptBody/WSSignE nvelope: Element to encrypt/sign not found: {http://ws.apache.org/axis2}args0)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4
    • 1.6.2, 1.7.0
    • Windows XP, Rampart 1.4,JDK1.5_06,Axis2 1.5

    Description

      Here I am trying to run a multiplication service in which I pass 2 parameters. In these two parameters I am trying to encrypt and sign only single element. For this I am using <SignedElements> and <EncryptedElements> assertions. I am calling the service using Client stub in which the namaspace generated is xmlns:ns1="http://ws.apache.org/axis2". I amt trying to use Xpath for that element as <sp:XPath>/soapenv:Envelope/soapenv:Body/ns1:mul/ns1:args0</sp:XPath> where soapenv is xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope">.
      When this got error i changed Xpath to:
      <sp:XPath>descendant::ns1:args0</sp:XPath>
      But i am getting an error which is
      Caused by: org.apache.ws.security.WSSecurityException: General security error (WSEncryptBody/WSSignE nvelope: Element to encrypt/sign not found:

      {http://ws.apache.org/axis2}

      args0)

      Abhinav
      Abhinav Mishra
      Exception in thread "main" org.apache.axis2.AxisFault: Error during encryption
      at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:70)
      at org.apache.axis2.engine.Phase.invoke(Phase.java:318)
      at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:251)
      at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:416)
      at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
      at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java
      :229)
      at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
      at org.apache.ws.axis2.Multiplication4Stub.mul(Multiplication4Stub.java:187)
      at org.apache.ws.axis2.Client.main(Client.java:38)
      Caused by: org.apache.rampart.RampartException: Error during encryption
      at org.apache.rampart.builder.AsymmetricBindingBuilder.doSignBeforeEncrypt(AsymmetricBinding
      Builder.java:544)
      at org.apache.rampart.builder.AsymmetricBindingBuilder.build(AsymmetricBindingBuilder.java:9
      3)
      at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:147)
      at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:64)
      ... 8 more
      Caused by: org.apache.ws.security.WSSecurityException: General security error (WSEncryptBody/WSSignE
      nvelope: Element to encrypt/sign not found:

      {http://ws.apache.org/axis2}

      args0)
      at org.apache.ws.security.message.WSSecEncrypt.doEncryption(WSSecEncrypt.java:496)
      at org.apache.ws.security.message.WSSecEncrypt.doEncryption(WSSecEncrypt.java:454)
      at org.apache.ws.security.message.WSSecEncrypt.encryptForInternalRef(WSSecEncrypt.java:351)
      at org.apache.rampart.builder.AsymmetricBindingBuilder.doSignBeforeEncrypt(AsymmetricBinding
      Builder.java:530)
      ... 11 more

      So,please help me to solve this issue.
      Here i am attaching my code and services.xml file.
      Thanks in advance!!!

      Attachments

        1. services.xml
          4 kB
          Abhinav Mishra
        2. service.jks
          2 kB
          Abhinav Mishra
        3. RAMPART-324.diff
          19 kB
          Amila Jayasekara
        4. PWCBHandler.java
          0.9 kB
          Abhinav Mishra
        5. PWCBHandler.java
          1 kB
          Abhinav Mishra
        6. Multiplication4Stub.java
          77 kB
          Abhinav Mishra
        7. Multiplication4CallbackHandler.java
          2 kB
          Abhinav Mishra
        8. Multiplication4.java
          0.1 kB
          Abhinav Mishra
        9. client.jks
          2 kB
          Abhinav Mishra
        10. Client.java
          2 kB
          Abhinav Mishra

        Issue Links

          Activity

            People

              thilinamb Thilina Mahesh Buddhika
              abhinavmishra Abhinav Mishra
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 504h
                  504h
                  Remaining:
                  Remaining Estimate - 504h
                  504h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified