Error Rampart Receiver
<p>I'm trying to send a information for a securite webservice but I am with the following error when he gotta tell me the answer</p>

<blockquote>
  <p>[ERROR] Expected encrypted part missing
  org.apache.axis2.AxisFault: Expected encrypted part missing
      at org.apache.rampart.handler.RampartReceiver.setFaultCodeAndThrowAxisFault(RampartReceiver.java:186)
      at org.apache.rampart.handler.RampartReceiver.invoke(RampartReceiver.java:99)
      at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:335)
      at org.apache.axis2.engine.Phase.invoke(Phase.java:308)
      at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:250)
      at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:156)
      at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:357)
      at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:414)
      at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
      at org.apache.axis2.client.OperationClient.execute(OperationClient.java:150)
      at tutorial.somar.Soma001SNAPSHOTStub.add(Soma001SNAPSHOTStub.java:190)
      at tutorial.somar.teste2.main(teste2.java:65)
  Caused by: org.apache.rampart.RampartException: Expected encrypted part missing
      at org.apache.rampart.PolicyBasedResultsValidator.validateEncrSig(PolicyBasedResultsValidator.java:276)
      at org.apache.rampart.PolicyBasedResultsValidator.validate(PolicyBasedResultsValidator.java:153)
      at org.apache.rampart.RampartEngine.process(RampartEngine.java:280)
      at org.apache.rampart.handler.RampartReceiver.invoke(RampartReceiver.java:92)
      ... 10 more
  Exception in thread "main" org.apache.axis2.AxisFault: Expected encrypted part missing
      at org.apache.rampart.handler.RampartReceiver.setFaultCodeAndThrowAxisFault(RampartReceiver.java:186)
      at org.apache.rampart.handler.RampartReceiver.invoke(RampartReceiver.java:99)
      at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:335)
      at org.apache.axis2.engine.Phase.invoke(Phase.java:308)
      at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:250)
      at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:156)
      at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:357)
      at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:414)
      at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
      at org.apache.axis2.client.OperationClient.execute(OperationClient.java:150)
      at tutorial.somar.Soma001SNAPSHOTStub.add(Soma001SNAPSHOTStub.java:190)
      at tutorial.somar.teste2.main(teste2.java:65)
  Caused by: org.apache.rampart.RampartException: Expected encrypted part missing
      at org.apache.rampart.PolicyBasedResultsValidator.validateEncrSig(PolicyBasedResultsValidator.java:276)
      at org.apache.rampart.PolicyBasedResultsValidator.validate(PolicyBasedResultsValidator.java:153)
      at org.apache.rampart.RampartEngine.process(RampartEngine.java:280)
      at org.apache.rampart.handler.RampartReceiver.invoke(RampartReceiver.java:92)
      ... 10 more</p>
</blockquote>

<p>I'm using maven on the server:</p>

<p>here is the services.xml</p>

<blockquote>
  
</blockquote>

<p>   </p>

<pre><code>&lt;module ref="rampart"/&gt;

&lt;parameter name="ServiceClass" locked="false"&gt;tutorial.somar.SecureService&lt;/parameter&gt;

&lt;operation name="add"&gt;
    &lt;messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/&gt;
&lt;/operation&gt;   
</code></pre>

<p>
  
    
      
        
          
            
              
            
          
          
            
              
                
                  
                
              
            
          
          
            
              
            
          
          
            
              
            
          
          
          
        
      </p>

<pre><code>   &lt;sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"&gt;
                &lt;wsp:Policy&gt;
                        &lt;sp:MustSupportRefKeyIdentifier/&gt;
                        &lt;sp:MustSupportRefIssuerSerial/&gt;
                &lt;/wsp:Policy&gt;
            &lt;/sp:Wss10&gt;

  &lt;sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"&gt;
    &lt;sp:Body/&gt;
  &lt;/sp:SignedParts&gt;
  &lt;sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"&gt;
    &lt;sp:Body/&gt;
  &lt;/sp:EncryptedParts&gt;

  &lt;ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy"&gt; 
    &lt;ramp:user&gt;serverkey&lt;/ramp:user&gt;
    &lt;ramp:encryptionUser&gt;clientkey&lt;/ramp:encryptionUser&gt;
    &lt;ramp:passwordCallbackClass&gt;tutorial.somar.PWCBHandler&lt;/ramp:passwordCallbackClass&gt;

    &lt;ramp:signatureCrypto&gt;
      &lt;ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin"&gt;
        &lt;ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type"&gt;JKS&lt;/ramp:property&gt;
        &lt;ramp:property name="org.apache.ws.security.crypto.merlin.file"&gt;server.keystore&lt;/ramp:property&gt;
        &lt;ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password"&gt;nosecret&lt;/ramp:property&gt;
      &lt;/ramp:crypto&gt;
    &lt;/ramp:signatureCrypto&gt;

    &lt;ramp:encryptionCrypto&gt;
      &lt;ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin"&gt;
        &lt;ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type"&gt;JKS&lt;/ramp:property&gt;
        &lt;ramp:property name="org.apache.ws.security.crypto.merlin.file"&gt;server.keystore&lt;/ramp:property&gt;
        &lt;ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password"&gt;nosecret&lt;/ramp:property&gt;
      &lt;/ramp:crypto&gt;
    &lt;/ramp:encryptionCrypto&gt;

  &lt;/ramp:RampartConfig&gt;

&lt;/wsp:All&gt;
</code></pre>

<p>
</p>

<p></p>

<p>and the SecureService.java</p>

<pre><code>public int add(int a, int b) {
    System.out.println(a+b);
    return a+b;
}
</code></pre>

<p>my WS-client is like this:</p>

<pre><code>public class teste2 {
private static Policy loadPolicy(String name) throws XMLStreamException{
    ClassLoader loader = teste2.class.getClassLoader();
    InputStream resource = loader.getResourceAsStream(name);
    StAXOMBuilder builder = new StAXOMBuilder(resource);
    return PolicyEngine.getPolicy(builder.getDocumentElement());
}

public static void main (String[] args) throws XMLStreamException, RemoteException{
    /*if(args.length &lt; 4){
        System.out.println("Usage:\n  java " +
                "com.sosnoski.ws.library.adb.WebServiceClient protocol host port path");
        System.exit(1);
    }*/

    //String target = args[0] + "://" + args[1] + ":" + args[2] + args[3];
    String target = "http://localhost:8070/axis2/services/soma-0.0.1-SNAPSHOT";
    System.out.println("Connecting to " + target);

    ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem("client-repo", null);

    Soma001SNAPSHOTStub stub = new Soma001SNAPSHOTStub(ctx ,target);
    //FacebookStub stub = new FacebookStub(target);

    ServiceClient client = stub._getServiceClient();
    Options options = client.getOptions();

    Policy policy = loadPolicy("signencr-policy-client.xml");
    //Policy policy = loadPolicy("policy.xml");
    //Policy policy = loadPolicy("sign-policy-client.xml");
    options.setProperty(RampartMessageData.KEY_RAMPART_POLICY, policy);
    options.setUserName("libuser");
    options.setPassword("books");
    client.engageModule("rampart");


    int a = 4;
    int b = 4;
    Add n = new Add();

    n.setA(a);
    n.setB(b);
    AddResponse result = stub.add(n);

    System.out.println(a + " + " + b + " = " + result.get_return());
}
</code></pre>

<p>}</p>

<p>I'm using axis2 1.7.1, rampart 1.7.0</p>