How to call a secure proxy service through a simple proxy service in a WSO2 ESB

I made a secure proxy service in the WSO2 ESB. I followed this tutorial . Now I want to call this service using a different proxy service. But when I send a request from SoapUI to a simple proxy service, I encountered an error. What I cannot understand is how to pass the security configurations to the proxy service.

Note. I am using WSO2 ESB 4.8.1.

Secure Proxy Service Code:

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="EchoProxy2"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence>
         <log level="full" separator="InSequence Log"/>
      </inSequence>
      <outSequence>
         <log level="full" separator="Out Sequence Called"/>
         <send/>
      </outSequence>
      <endpoint>
         <address uri="http://wi1-Inspiron-3521:8280/services/echo"/>
      </endpoint>
   </target>
   <parameter name="disableREST">true</parameter>
   <parameter name="ScenarioID">scenario2</parameter>
   <enableSec/>
   <policy key="conf:/repository/axis2/service-groups/EchoProxy2/services/EchoProxy2/policies/SigOnly"/>
   <description/>
</proxy>

Simple proxy utility code:

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="CallEchoProxy"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence>
         <log level="full" separator="*Calling Proxy In Sequence"/>
      </inSequence>
      <outSequence>
         <log level="full"
              separator="Calling Proxy Out Sequence"/>
      </outSequence>
      <endpoint>
         <address uri="http://wi1-Inspiron-3521:8280/services/EchoProxy2"/>
      </endpoint>
   </target>
   <description/>
</proxy>

Error in the logs:

[2015-02-19 11:22:48,718] ERROR - ServerWorker Error processing POST request for : /services/EchoProxy2
org.apache.axis2.AxisFault: Missing wsse:Security header in request
    at org.apache.rampart.handler.RampartReceiver.setFaultCodeAndThrowAxisFault(RampartReceiver.java:180)
    at org.apache.rampart.handler.RampartReceiver.invoke(RampartReceiver.java:99)
    at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)
    at org.apache.axis2.engine.Phase.invoke(Phase.java:313)
    at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:261)
    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:167)
    at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:411)
    at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:183)
    at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
Caused by: org.apache.rampart.RampartException: Missing wsse:Security header in request
    at org.apache.rampart.RampartEngine.process(RampartEngine.java:146)
    at org.apache.rampart.handler.RampartReceiver.invoke(RampartReceiver.java:92)
    ... 10 more

Problem: I cannot figure out how to pass the security configuration to my proxy server. So that he can contact the Secure Service and return a response.

+4
1

, . , . , . - . , WS-Security . , , . , , .

0

All Articles