You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Dushan Sachinda Abeyruwan (JIRA)" <ji...@apache.org> on 2012/07/12 10:55:34 UTC

[jira] [Created] (SYNAPSE-890) Pattern attribute of the property mediator does not seem to work

Dushan Sachinda Abeyruwan created SYNAPSE-890:
-------------------------------------------------

             Summary: Pattern attribute of the property mediator does not seem to work
                 Key: SYNAPSE-890
                 URL: https://issues.apache.org/jira/browse/SYNAPSE-890
             Project: Synapse
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.1
         Environment: Ubuntu 12.04
            Reporter: Dushan Sachinda Abeyruwan
            Priority: Critical
             Fix For: FUTURE


Steps to reproduce: 
================ 
1. Create a sequence like the following 
<sequence xmlns="http://ws.apache.org/ns/synapse" name="main"> 
   <in> 
      <switch xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" xmlns:m0="http://services.samples" source="//m0:getQuote/m0:request/m0:symbol"> 
         <case regex="IBM"> 
            <property name="symbol" value="Great stock - IBM" /> 
         </case> 
         <case regex="MSFT"> 
            <property name="symbol" value="Are you sure? - MSFT" /> 
         </case> 
         <default> 
            <property name="symbol" expression="fn11:concat('Normal Stock - ', //m0:getQuote/m0:request/m0:symbol)" scope="default" /> 
         </default> 
      </switch> 
      <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" xmlns:m0="http://services.samples" name="MyProp" expression="//m0:getQuote/m0:request/m0:symbol" pattern="[a-zA-Z_0-9]" scope="default" /> 
      <log level="custom"> 
         <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" name="symbol" expression="get-property('symbol')" /> 
         <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" name="epr" expression="get-property('To')" /> 
         <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" name="customProperty" expression="get-property('MyProp')" /> 
      </log> 
      <send /> 
   </in> 
   <out> 
      <send /> 
   </out> 
</sequence> 

2. Note the following property mediator in the above sequence. I used pattern attribute in there to evaluate the result of xpath expression against a regex 
<property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" xmlns:m0="http://services.samples" name="MyProp" expression="//m0:getQuote/m0:request/m0:symbol" pattern="[a-zA-Z_0-9]" scope="default" /> 
According to the above regex, I should only set the property value if the Xpath expression result is alpha-numeric 

3. Send a request with the following payload (note the non-alpha numeric character) 
  <m0:getQuote xmlns:m0="http://services.samples"> 
            <m0:request> 
               <m0:symbol>%</m0:symbol> 
            </m0:request> 
         </m0:getQuote> 

4. Check the log mediator output (value of the customProperty) 
INFO - LogMediator symbol = Normal Stock - %, epr = http://localhost:9000/services/SimpleStockQuoteService, customProperty = % 



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] [Updated] (SYNAPSE-890) Pattern attribute of the property mediator does not seem to work

Posted by "Dushan Sachinda Abeyruwan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-890?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dushan Sachinda Abeyruwan updated SYNAPSE-890:
----------------------------------------------

    Attachment:     (was: PropertyMediator.java.patch)
    
> Pattern attribute of the property mediator does not seem to work
> ----------------------------------------------------------------
>
>                 Key: SYNAPSE-890
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-890
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1
>         Environment: Ubuntu 12.04
>            Reporter: Dushan Sachinda Abeyruwan
>            Priority: Critical
>             Fix For: FUTURE
>
>         Attachments: PropertyMediator.java.patch
>
>
> Steps to reproduce: 
> ================ 
> 1. Create a sequence like the following 
> <sequence xmlns="http://ws.apache.org/ns/synapse" name="main"> 
>    <in> 
>       <switch xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" xmlns:m0="http://services.samples" source="//m0:getQuote/m0:request/m0:symbol"> 
>          <case regex="IBM"> 
>             <property name="symbol" value="Great stock - IBM" /> 
>          </case> 
>          <case regex="MSFT"> 
>             <property name="symbol" value="Are you sure? - MSFT" /> 
>          </case> 
>          <default> 
>             <property name="symbol" expression="fn11:concat('Normal Stock - ', //m0:getQuote/m0:request/m0:symbol)" scope="default" /> 
>          </default> 
>       </switch> 
>       <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" xmlns:m0="http://services.samples" name="MyProp" expression="//m0:getQuote/m0:request/m0:symbol" pattern="[a-zA-Z_0-9]" scope="default" /> 
>       <log level="custom"> 
>          <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" name="symbol" expression="get-property('symbol')" /> 
>          <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" name="epr" expression="get-property('To')" /> 
>          <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" name="customProperty" expression="get-property('MyProp')" /> 
>       </log> 
>       <send /> 
>    </in> 
>    <out> 
>       <send /> 
>    </out> 
> </sequence> 
> 2. Note the following property mediator in the above sequence. I used pattern attribute in there to evaluate the result of xpath expression against a regex 
> <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" xmlns:m0="http://services.samples" name="MyProp" expression="//m0:getQuote/m0:request/m0:symbol" pattern="[a-zA-Z_0-9]" scope="default" /> 
> According to the above regex, I should only set the property value if the Xpath expression result is alpha-numeric 
> 3. Send a request with the following payload (note the non-alpha numeric character) 
>   <m0:getQuote xmlns:m0="http://services.samples"> 
>             <m0:request> 
>                <m0:symbol>%</m0:symbol> 
>             </m0:request> 
>          </m0:getQuote> 
> 4. Check the log mediator output (value of the customProperty) 
> INFO - LogMediator symbol = Normal Stock - %, epr = http://localhost:9000/services/SimpleStockQuoteService, customProperty = % 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] [Updated] (SYNAPSE-890) Pattern attribute of the property mediator does not seem to work

Posted by "Dushan Sachinda Abeyruwan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-890?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dushan Sachinda Abeyruwan updated SYNAPSE-890:
----------------------------------------------

    Attachment: PropertyMediator.java.patch
    
> Pattern attribute of the property mediator does not seem to work
> ----------------------------------------------------------------
>
>                 Key: SYNAPSE-890
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-890
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1
>         Environment: Ubuntu 12.04
>            Reporter: Dushan Sachinda Abeyruwan
>            Priority: Critical
>             Fix For: FUTURE
>
>         Attachments: PropertyMediator.java.patch
>
>
> Steps to reproduce: 
> ================ 
> 1. Create a sequence like the following 
> <sequence xmlns="http://ws.apache.org/ns/synapse" name="main"> 
>    <in> 
>       <switch xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" xmlns:m0="http://services.samples" source="//m0:getQuote/m0:request/m0:symbol"> 
>          <case regex="IBM"> 
>             <property name="symbol" value="Great stock - IBM" /> 
>          </case> 
>          <case regex="MSFT"> 
>             <property name="symbol" value="Are you sure? - MSFT" /> 
>          </case> 
>          <default> 
>             <property name="symbol" expression="fn11:concat('Normal Stock - ', //m0:getQuote/m0:request/m0:symbol)" scope="default" /> 
>          </default> 
>       </switch> 
>       <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" xmlns:m0="http://services.samples" name="MyProp" expression="//m0:getQuote/m0:request/m0:symbol" pattern="[a-zA-Z_0-9]" scope="default" /> 
>       <log level="custom"> 
>          <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" name="symbol" expression="get-property('symbol')" /> 
>          <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" name="epr" expression="get-property('To')" /> 
>          <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" name="customProperty" expression="get-property('MyProp')" /> 
>       </log> 
>       <send /> 
>    </in> 
>    <out> 
>       <send /> 
>    </out> 
> </sequence> 
> 2. Note the following property mediator in the above sequence. I used pattern attribute in there to evaluate the result of xpath expression against a regex 
> <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" xmlns:m0="http://services.samples" name="MyProp" expression="//m0:getQuote/m0:request/m0:symbol" pattern="[a-zA-Z_0-9]" scope="default" /> 
> According to the above regex, I should only set the property value if the Xpath expression result is alpha-numeric 
> 3. Send a request with the following payload (note the non-alpha numeric character) 
>   <m0:getQuote xmlns:m0="http://services.samples"> 
>             <m0:request> 
>                <m0:symbol>%</m0:symbol> 
>             </m0:request> 
>          </m0:getQuote> 
> 4. Check the log mediator output (value of the customProperty) 
> INFO - LogMediator symbol = Normal Stock - %, epr = http://localhost:9000/services/SimpleStockQuoteService, customProperty = % 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] [Commented] (SYNAPSE-890) Pattern attribute of the property mediator does not seem to work

Posted by "Dushan Sachinda Abeyruwan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13412615#comment-13412615 ] 

Dushan Sachinda Abeyruwan commented on SYNAPSE-890:
---------------------------------------------------

Hi
 Ideally I think when the given pattern is not matched at the property mediator it should return a empty string, the fix patch is attached herewith

cheers
Dushan
                
> Pattern attribute of the property mediator does not seem to work
> ----------------------------------------------------------------
>
>                 Key: SYNAPSE-890
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-890
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1
>         Environment: Ubuntu 12.04
>            Reporter: Dushan Sachinda Abeyruwan
>            Priority: Critical
>             Fix For: FUTURE
>
>         Attachments: PropertyMediator.java.patch
>
>
> Steps to reproduce: 
> ================ 
> 1. Create a sequence like the following 
> <sequence xmlns="http://ws.apache.org/ns/synapse" name="main"> 
>    <in> 
>       <switch xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" xmlns:m0="http://services.samples" source="//m0:getQuote/m0:request/m0:symbol"> 
>          <case regex="IBM"> 
>             <property name="symbol" value="Great stock - IBM" /> 
>          </case> 
>          <case regex="MSFT"> 
>             <property name="symbol" value="Are you sure? - MSFT" /> 
>          </case> 
>          <default> 
>             <property name="symbol" expression="fn11:concat('Normal Stock - ', //m0:getQuote/m0:request/m0:symbol)" scope="default" /> 
>          </default> 
>       </switch> 
>       <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" xmlns:m0="http://services.samples" name="MyProp" expression="//m0:getQuote/m0:request/m0:symbol" pattern="[a-zA-Z_0-9]" scope="default" /> 
>       <log level="custom"> 
>          <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" name="symbol" expression="get-property('symbol')" /> 
>          <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" name="epr" expression="get-property('To')" /> 
>          <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" name="customProperty" expression="get-property('MyProp')" /> 
>       </log> 
>       <send /> 
>    </in> 
>    <out> 
>       <send /> 
>    </out> 
> </sequence> 
> 2. Note the following property mediator in the above sequence. I used pattern attribute in there to evaluate the result of xpath expression against a regex 
> <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" xmlns:m0="http://services.samples" name="MyProp" expression="//m0:getQuote/m0:request/m0:symbol" pattern="[a-zA-Z_0-9]" scope="default" /> 
> According to the above regex, I should only set the property value if the Xpath expression result is alpha-numeric 
> 3. Send a request with the following payload (note the non-alpha numeric character) 
>   <m0:getQuote xmlns:m0="http://services.samples"> 
>             <m0:request> 
>                <m0:symbol>%</m0:symbol> 
>             </m0:request> 
>          </m0:getQuote> 
> 4. Check the log mediator output (value of the customProperty) 
> INFO - LogMediator symbol = Normal Stock - %, epr = http://localhost:9000/services/SimpleStockQuoteService, customProperty = % 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] [Updated] (SYNAPSE-890) Pattern attribute of the property mediator does not seem to work

Posted by "Dushan Sachinda Abeyruwan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-890?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dushan Sachinda Abeyruwan updated SYNAPSE-890:
----------------------------------------------

    Attachment: PropertyMediator.java.patch
    
> Pattern attribute of the property mediator does not seem to work
> ----------------------------------------------------------------
>
>                 Key: SYNAPSE-890
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-890
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1
>         Environment: Ubuntu 12.04
>            Reporter: Dushan Sachinda Abeyruwan
>            Priority: Critical
>             Fix For: FUTURE
>
>         Attachments: PropertyMediator.java.patch
>
>
> Steps to reproduce: 
> ================ 
> 1. Create a sequence like the following 
> <sequence xmlns="http://ws.apache.org/ns/synapse" name="main"> 
>    <in> 
>       <switch xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" xmlns:m0="http://services.samples" source="//m0:getQuote/m0:request/m0:symbol"> 
>          <case regex="IBM"> 
>             <property name="symbol" value="Great stock - IBM" /> 
>          </case> 
>          <case regex="MSFT"> 
>             <property name="symbol" value="Are you sure? - MSFT" /> 
>          </case> 
>          <default> 
>             <property name="symbol" expression="fn11:concat('Normal Stock - ', //m0:getQuote/m0:request/m0:symbol)" scope="default" /> 
>          </default> 
>       </switch> 
>       <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" xmlns:m0="http://services.samples" name="MyProp" expression="//m0:getQuote/m0:request/m0:symbol" pattern="[a-zA-Z_0-9]" scope="default" /> 
>       <log level="custom"> 
>          <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" name="symbol" expression="get-property('symbol')" /> 
>          <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" name="epr" expression="get-property('To')" /> 
>          <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" name="customProperty" expression="get-property('MyProp')" /> 
>       </log> 
>       <send /> 
>    </in> 
>    <out> 
>       <send /> 
>    </out> 
> </sequence> 
> 2. Note the following property mediator in the above sequence. I used pattern attribute in there to evaluate the result of xpath expression against a regex 
> <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" xmlns:m0="http://services.samples" name="MyProp" expression="//m0:getQuote/m0:request/m0:symbol" pattern="[a-zA-Z_0-9]" scope="default" /> 
> According to the above regex, I should only set the property value if the Xpath expression result is alpha-numeric 
> 3. Send a request with the following payload (note the non-alpha numeric character) 
>   <m0:getQuote xmlns:m0="http://services.samples"> 
>             <m0:request> 
>                <m0:symbol>%</m0:symbol> 
>             </m0:request> 
>          </m0:getQuote> 
> 4. Check the log mediator output (value of the customProperty) 
> INFO - LogMediator symbol = Normal Stock - %, epr = http://localhost:9000/services/SimpleStockQuoteService, customProperty = % 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org