0

I have a situation where in i have created a proxy service where in i have used an inline wsdl so that i can pass some data from try-it tool. After that i want to get the data passed from try-it to in seq that i am able to do.After that there is no use of inline-wsdl. In the "in-sequence" i have used a custom class mediator inside which i have set a property called "user" and i have saved that property value(user) in Property mediator. Now i want to send this property as response through out sequence.How to do this. Please help... My Proxy code is:

<proxy xmlns="http://ws.apache.org/ns/synapse" name="ProviderPublication" transports="https,http" statistics="disable" trace="disable" startOnLoad="false">
   <target>
      <inSequence>
         <property xmlns:xs="http://www.openandaway.org/xml/BBC/" name="URI" expression="//xs:SessionID" scope="default" type="STRING"/>
         <payloadFactory>
            <format>
               <p:Session xmlns:p="http://www.openandaway.org/xml/BBC/">
                  <xs:ChannelURI xmlns:xs="http://www.openandaway.org/xml/BBC/">$1</xs:ChannelURI>
               </p:Session>
            </format>
            <args>
               <arg xmlns:ns="http://org.apache.synapse/xsd" expression="get-property('URI')"/>
            </args>
         </payloadFactory>
         <log level="full">
            <property name="Inside_In_Sequence" value="---------Hi i am inside in sequence--------------"/>
         </log>
         <log level="full">
            <property name="PropValFromURI" expression="get-property('URI')"/>
         </log>
      </inSequence>
      <outSequence>
         <log level="full">
            <property name="Inside_Out_Sequence" value="-------Hi inside Out Sequence--------------------"/>
         </log>
         <property name="GetDataFromINSeq" expression="get-property('URI')" scope="default" type="STRING"/>
         <log level="full">
            <property name="GetPropValueFromInSeq" expression="get-property('URI')"/>
         </log>
         <send/>
      </outSequence>
   </target>
   <publishWSDL uri="http://10.224.188.87:2425/BBC1.0/services/BBCPublicationService?wsdl"/>
   <description></description>
</proxy>

In the above code i am not able to get inside the out sequence. It is not hitting the out-sequence.Where am i doing wrong?

Community
  • 1
  • 1
Roy
  • 1,231
  • 1
  • 24
  • 61

2 Answers2

0

You can access that property at the outsequence. Please refer following threads.

stWSO2ESB OutSequence Processing

Pass property from inSequence to outSequence

Community
  • 1
  • 1
Shelan Perera
  • 1,753
  • 1
  • 11
  • 10
0

In your proxy's in-sequence, I dont see you sending the message to any backend. i.e. I dont see a send part in the in-sequence. Without the message going out, there is no way for a response to come to the out-sequence.

Regarding your original question on accessing properties set by your class mediator, if you set the property with the scope set to "synapse", you can access it within any place in your proxy.

Amila Maharachchi
  • 2,121
  • 2
  • 15
  • 21
  • Can i compare two property value like: if(property1.value == property2.value) then "do some coding". how can i achieve this? – Roy Apr 09 '13 at 06:29
  • There is no straight forward way to compare two properties. You will have to write a custom mediator to do it. But you can compare a property against some value or a regular expression via the filter mediator. BTW, did my answer fix your problem? – Amila Maharachchi Apr 11 '13 at 14:36