[ 
https://issues.apache.org/jira/browse/SYNAPSE-144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12535560
 ] 

Paul Anderson commented on SYNAPSE-144:
---------------------------------------

Here it is. I do basic auth on the POX input to /INPUT, add SOAPAction to avoid 
the error I described above, then POST back to localhost /ABC. There, in the 
2nd filter, I add the WS-Security and send the message to its real destination.
I'd like to be able to do both in one step. Otherwise I can't secure against 
direct posting to /ABC!
Thanks.

   <localEntry key="sec2_policy" 
src="file:repository/conf/sample/resources/policy/policy_enc.xml"/> 
   <filter source="get-property('To')" regex=".*/ABC">
        <log level="full"/>
<send>
<endpoint>
                <address uri="http://targetserver:8080/abc/services"; 
format="soap">
                            <enableSec policy="sec2_policy"/>
                            <enableAddressing/>
                        </address>
                    </endpoint>
</send>
</filter>
<sequence name="myfault">
          <makefault>
            <code value="tns:Receiver" 
xmlns:tns="http://www.w3.org/2003/05/soap-envelope"/>
            <reason value="Authorization failed!"/>
          </makefault>
          <log level="full"/>
          <property name="RESPONSE" value="true" />
          <property name="Authorization" action="remove" scope="transport"/>
          <send/>
</sequence>
<filter source="get-property('To')" regex=".*/INPUT">
        <log level="full"/>
        <property name="SOAPAction" action="set" expression="'doIt'" 
scope="transport"/>
       <sequence name="basic" onError="myfault">
        <class name="de.subnatural.synapse.BasicAuthenticationMediator">
          <property name="reqUsername" value="***"/>
          <property name="reqPassword" value="***"/>
        </class>
<send>
<endpoint>
                        <address uri="http://localhost:9080/ABC"; format="soap">
                        </address>
 </endpoint>
</send>
        </sequence>
</filter>
<out>
<header name="wsse:Security" action="remove"
                
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
 />
        <log level="full"/>
<send/>
</out>


> Can only add WS-Security to a message if it came in as SOAP, not POX - a 
> workaround is a wrapper filter that adds SOAPAction
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SYNAPSE-144
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-144
>             Project: Synapse
>          Issue Type: Bug
>    Affects Versions: 1.0
>         Environment: JDK6 on RHEL3
>            Reporter: Paul Anderson
>            Priority: Minor
>
> I define a filter that sends incoming messages out to an endpoint with 
> WS-Security headers added.
> If I send SOAP into it, it passes messages on OK.
> But if I send POX input, it logs the stacktrace below.
> So as a workaround, I make my client code post POX to a first filter, which 
> adds:
> <property name="SOAPAction" action="set" expression="'doIt'" 
> scope="transport"/>
> and sends the message to the main filter.
> It would be simpler and more performant to define only one filter.
> Is there a better workaround, or better, can this be fixed?
>   6907 [HttpServerWorker-1] ERROR Axis2Sender (Axis2Sender.java:104) - 
> Unexpected error during Sending message onwards
> java.util.MissingResourceException: Can't find resource for bundle 
> org.apache.axis2.i18n.ProjectResourceBundle, key outboundNoAction
>         at java.util.ResourceBundle.getObject(ResourceBundle.java:386)
>         at java.util.ResourceBundle.getString(ResourceBundle.java:346)
>         at 
> org.apache.axis2.i18n.MessageBundle.getMessage(MessageBundle.java:191)
>         at 
> org.apache.axis2.i18n.MessageBundle.getMessage(MessageBundle.java:80)
>         at 
> org.apache.axis2.addressing.i18n.AddressingMessages.getMessage(AddressingMessages.java:61)
>         at 
> org.apache.axis2.handlers.addressing.AddressingOutHandler$WSAHeaderWriter.processWSAAction(AddressingOutHandler.java:257)
>         at 
> org.apache.axis2.handlers.addressing.AddressingOutHandler$WSAHeaderWriter.writeHeaders(AddressingOutHandler.java:184)
>         at 
> org.apache.axis2.handlers.addressing.AddressingOutHandler.invoke(AddressingOutHandler.java:109)
>         at org.apache.axis2.engine.Phase.invoke(Phase.java:383)
>         at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:203)
>         at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:433)
>         at 
> org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.send(DynamicAxisOperation.java:193)
>         at 
> org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.execute(DynamicAxisOperation.java:177)
>         at 
> org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:233)
>         at 
> org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:50)
>         at 
> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:112)
>         at 
> org.apache.synapse.endpoints.AddressEndpoint.send(AddressEndpoint.java:193)
>         at 
> org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:92)
>         at 
> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:49)
>         at 
> org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:62)
>         at 
> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:49)
>         at 
> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:104)
>         at 
> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:104)
>         at 
> org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:73)
>         at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)
>         at 
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:279)
>         at 
> org.apache.axis2.transport.nhttp.ServerWorker.processPost(ServerWorker.java:207)
>         at 
> org.apache.axis2.transport.nhttp.ServerWorker.run(ServerWorker.java:171)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>         at java.lang.Thread.run(Thread.java:619)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to