I'm attempting to produce a stream of comments from a Facebook page. Ultimately I'd like a response from WSO2 like this:
<comments>
<comment>
<post_id>123</post_id>
<comment_id>456</comment_id>
<from_name>Bob Brown</from_name>
<from_id>789</from_id>
<message>This is a comment on a post.</message>
<created_time>2015-12-17T15:25:30+0000</created_time>
</comment>
</comments>
I'm using the API module for WSO2 ESB to provide an abstraction layer over a Facebook page to get a simple stream of all the comments on a page after a given timestamp.
The logic I'm working on right now is taking all the posts on a given Facebook page (using the WSO2 Facebook Connector), iterating over all the posts (using an iterate mediator), checking if the post has comments (using the filter mediator), if there are comments I'm then iterating over the comments and restructuring them into a simple XML element (using the PayloadFactory mediator). This is where I'm getting stuck.
I've figured out that within an iterate mediator I can't update properties external to the iterator. My initial instinct was to enrich an external property with the comment payload generated in the second iterator as a child element, but no dice.
I'm now attempting to aggregate the outputs of the second iterator as shown below but I'm not able to aggregate the payloads:
<?xml version="1.0" encoding="UTF-8"?>
<inSequence xmlns="http://ws.apache.org/ns/synapse">
<property expression="$ctx:query.param.limit" name="limit"
scope="default" type="STRING"/>
<property expression="$ctx:query.param.since" name="since"
scope="default" type="STRING"/>
<property name="fields" scope="default" type="STRING" value="id,comments{id,message,from,created_time}"/>
<call-template target="facebook_getFeed">
<with-param name="pageId" value="{get-property('uri.var.page')}"/>
<with-param name="maxPosts" value="{get-property('limit')}"/>
<with-param name="since" value="{get-property('since')}"/>
<with-param name="fields" value="{get-property('fields')}"/>
</call-template>
<log level="custom">
<property name="S3_MESSAGE" value="Iterating through posts"/>
</log>
<property name="comment_stream" scope="default">
<comments xmlns=""/>
</property>
<iterate continueParent="true" expression="//jsonObject/data"
id="fb_api_comments_post_iterate" sequential="true" xmlns:ns1="http://cache.services">
<target>
<sequence>
<filter xmlns:ns="http://org.apache.synapse/xsd" xpath="count(//data/comments)>0">
<then>
<property expression="//data/id"
name="fb_post_id" scope="operation" type="STRING"/>
<iterate continueParent="true"
expression="//data/comments/data"
id="fb_api_comments_comment_iterate" sequential="true">
<target>
<sequence>
<log level="custom">
<property name="S3_MESSAGE" value="Transforming comment"/>
</log>
<payloadFactory media-type="xml">
<format>
<comments xmlns="">
<post_id>$1</post_id>
<comment_id>$2</comment_id>
<from_name>$3</from_name>
<from_id>$4</from_id>
<message>$5</message>
<created_time>$6</created_time>
</comments>
</format>
<args>
<arg evaluator="xml" expression="get-property('fb_post_id')"/>
<arg evaluator="xml" expression="//data/id"/>
<arg evaluator="xml" expression="//data/from/name"/>
<arg evaluator="xml" expression="//data/from/id"/>
<arg evaluator="xml" expression="//data/message"/>
<arg evaluator="xml" expression="//data/created_time"/>
</args>
</payloadFactory>
</sequence>
</target>
</iterate>
</then>
</filter>
</sequence>
</target>
</iterate>
<aggregate>
<correlateOn expression="fb_api_comments_comment_iterate"/>
<completeCondition>
<messageCount max="-1" min="-1"/>
</completeCondition>
<onComplete enclosingElementProperty="comment_stream" expression="//comments">
<loopback/>
</onComplete>
</aggregate>
</inSequence>
Any assistance would be greatly appreciated.
In your question, you mentioned property update was falling outside the iterate mediator. According to my knowledge this happens due to this reason.
Before calling each iteration cycle message context will be cloned and it will only be available in the context inside iterator target. Hence, we are unable to get the messages/properties updated inside the iterator which are in the default/synapse scope. If you want to store something global, use property with operation scope.
How solved this problem was,
Before iterator - assign the property to operation scope
Inside iterator - do modifications
Outside the iterator - assign the property to default scope (if you
want to take it back to default scope)
Use below structure as an example for the proxy service:
<!--assign the property to operation scope-->
<property name="ITERATOR_DATA_PAYLOAD"
expression="get-property('DATA_PAYLOAD')"
scope="operation"
type="OM"/>
<iterate xmlns:ns="http://org.apache.synapse/xsd"
continueParent="true"
expression="//bookstore/book"
sequential="true">
<target>
<sequence>
<!--if want to assign the property-->
<property name="DATA_PAYLOAD"
expression="get-property('operation','ITERATOR_DATA_PAYLOAD')"
type="OM"/>
</sequence>
</target>
</iterate>
<!--Outside the iterator-->
<property xmlns:ns="http://org.apache.synapse/xsd"
name="NEW_DATA_PAYLOAD"
expression="get-property('operation','ITERATOR_DATA_PAYLOAD')"
type="OM"/>
Whilst I'm happy for someone to post technically more correct answer, I bit the bullet because of time constraints and begrudgingly wrote some arbitrary JavaScript in a script mediator:
var payload = mc.getPayloadXML();
print("Starting FB Post Loop...");
var comments = new XML("<comments></comments>");
comments.comment = new XMLList();
for (var i = 0; i < payload[0].data.length(); i++){
print("Checking if post has comments...");
if(payload[0].data[i].comments.data.length() > 0){
print("Comments exist on this post...");
print("Post ID: " + payload[0].data[i].id);
for (var ii = 0; ii < payload[0].data[i].comments.data.length(); ii++){
print("Building comment entry...");
var comment = <comment/>;
comment.post_id = payload[0].data[i].id.toString();
comment.comment_id = payload[0].data[i].comments.data[ii].id.toString();
comment.from_id = payload[0].data[i].comments.data[ii].from.id.toString();
comment.from_name = payload[0].data[i].comments.data[ii].from.name.toString();
comment.message = payload[0].data[i].comments.data[ii].message.toString();
comment.created_time = payload[0].data[i].comments.data[ii].created_time.toString();
print(comment);
comments.comment += comment;
}
}
}
mc.setPayloadXML(comments);
IMHO having to fall back to custom code is fine, but often means a world of hurt from a maintainability perspective. The other side of the coin is that I'd genuinely like to leverage WSO2/Synapse mediators where possible, since that's what using the WSO2 ESB is all about!
Looking forward to reading/discussing other solutions.
Related
I have an endpoint in wso2 integrator, wich receive some parameters, call some rest apis, and produce a new response.
I created a sequence for each rest api call, wich will get the properties and make the specific call. Then with a script mediator, i'm creating a new payload with the response, and putting it in a property. Example: myResponseA, myResponseB, myResponseC.
My main endpoint have an IN sequence with only a clone mediator and a loopback tag. The clone mediator have a target for each sequence described above, like:
<clone continueParent="false" sequential="true">
<target sequence="mySequenceA">
</target>
<target sequence="mySequenceB">
</target>
</clone>
<loopback />
My main endpoint have an OUT sequence with a payloadFactory and a send tag, like:
<payloadFactory media-type="json">
<format>
<![CDATA[
{
"myResponseA": $1,
"myResponseB": $2
}
]]>
</format>
<args>
<arg expression="get-property('myResponseA')"/>
<arg expression="get-property('myResponseB')"/>
</args>
</payloadFactory>
<property name="HTTP_SC" scope="axis2" type="STRING" value="200"/>
<send/>
The problem is, the OUT sequence is called multiple times, one for each sequence in Clone mediator.
I tried to use the Aggregate mediator with no luck, 'coz my apis is restful and i don't know how to use the aggregate expression. I dont even need it, because i put the responses in different properties and read it in my payloadFactory.
How to execute my OUT sequence only one single time when all my sequences return in clone mediator? or there is another mediator i should use?
Obs.: I have to call those apis in parallel, because each one will take some time, and i will call 5~10 each time.
Can you try this as a startup :-D
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="PoCCloneAggregate"
transports="http"
startOnLoad="true"
statistics="enable"
trace="enable">
<description/>
<target>
<inSequence>
<property name="enclosing_element" scope="default">
<result xmlns=""/>
</property>
<clone continueParent="false" sequential="true">
<target>
<sequence>
<log level="custom">
<property name="CLON" value="clon 1"/>
</log>
<payloadFactory media-type="json">
<format>
{"data":
{"temperatura":"10",
"id":"1"}}
</format>
<args>
</args>
</payloadFactory>
<loopback/>
</sequence>
</target>
<target>
<sequence>
<log level="custom">
<property name="CLON" value="clon 2"/>
</log>
<payloadFactory media-type="json">
<format>
{"data":
{"temperatura":"20",
"id":"2"}}
</format>
<args>
</args>
</payloadFactory>
<loopback/>
</sequence>
</target>
<target>
<sequence>
<log level="custom">
<property name="CLON" value="clon 3"/>
</log>
<payloadFactory media-type="json">
<format>
{"data":
{"temperatura":"30",
"id":"3"}}
</format>
<args>
</args>
</payloadFactory>
<loopback/>
</sequence>
</target>
</clone>
</inSequence>
<outSequence>
<log level="full"/>
<aggregate>
<completeCondition>
<messageCount min="-1" max="-1"/>
</completeCondition>
<onComplete expression="$body/jsonObject" xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/" enclosingElementProperty="enclosing_element">
<log level="custom" separator=",">
<property name="MessageFlow" value="======================= Respuestas Agregadas. ==============="/>
</log>
<log level="full" separator=","/>
<send/>
</onComplete>
</aggregate>
</outSequence>
<faultSequence/>
</target>
</proxy>
You have to use aggragate mediator, the goal is to route each response to a single sequence containing this aggregate.
For example, if you use send mediator inside mySequenceA and mySequenceB, define the "receive" attribute to route the response in a dedicated sequence with <send receive="myResponseSequence"> (the same "myResponseSequence" must be used in mySequenceA and B).
If you use call mediator, then call a dedicated sequence with <sequence key="myResponseSequence"> (the same "myResponseSequence" must be used in mySequenceA and B)
inside myResponseSequence, use aggregate mediator :
the completeCondition can be let to default, the ESB will wait to receive the same number of response than the number of targets in your clone mediator. It gives you someting like :
<completeCondition>
<messageCount min="-1" max="-1"/>
</completeCondition>
the onComplete contains the mediation sequence that will be executed as soon as all the responses will be there : this sequence must contain the send mediator that will send a single response to the caller. The "expression" attribute on this "onComplete" node will contain an xpath that tell which node from the response must arrive inside the onComplete sequence.
inside the onComplete sequence, you can use payloadMediator to compose your single response
<onComplete xmlns:ns="http://org.apache.synapse/xsd" expression="//values">
<payloadFactory media-type="xml">
<format>
<myCustomResponse>
<result>$1</result>
</myCustomResponse>
</format>
<args>
<arg evaluator="xml" expression="//values"/>
</args>
</payloadFactory>
<send/>
</onComplete>
The fact that your api is restful should not be a problem with aggregate mediator. Perhaps the format is json and not xml : use json-eval if you want for the xpath or media-type=json" inside payloadFactory
I am very new in WSO2 ESB and I have the following doubt about how to implement an "if(){...} else{...}" like structure in my ESB project.
So in the input flow of the application on which I am working I have this property mediator followed by a log mediator that simply print the value of this property, something like this:
<property expression="count(//ds:Sample)" name="total_samples" scope="default" type="STRING" xmlns:ds="http://ws.wso2.org/dataservice"/>
<log level="custom">
<property expression="$ctx:total_samples" name="total samples: "/>
</log>
This works fine.
This total_samples property contains the number of record obtained from a previous call of a DSS service (I am not putting here in the code).
So the value of this total_samples property could be:
0: if the the query implemented by the DSS service returned 0 records.
A numeric value >0: if this query returned some records.
Now what I need to do at this time is only to chain a n "if(){...} else{...}" structure that print different log message if the total_samples property value is 0 or whatever number >0.
It should be a ver simple task but I have some doubts about how achieve it:
FIRST DOUBT: Looking on the online documentation it seems to me that exists 2 mediator that can be used to perform choice in the WSB flow: the switch mediator and the filter mediator. They seems to me very similar. What are the difference between these mediators? And what is better for my purpose?
SECOND DOUBT: It seems to me that these mediators works only on XPATH expression (something like count(//ds:Sample)), can they work directly on my property (something like "$ctx:total_samples") ?
THIRD DOUBT: At this stage I have implemented something like this in my flow:
<property expression="count(//ds:Sample)" name="total_samples" scope="default" type="STRING" xmlns:ds="http://ws.wso2.org/dataservice"/>
<log level="custom">
<property expression="$ctx:total_samples" name="total samples: "/>
</log>
<filter xpath="EXPRESSION THAT DO SOMETHING LIKE: $ctx:total_samples == 0">
<then>
<log description="No Resource Log">
<property name="message" value=""EMPTY RESULTSET, NO RESOURCES TO PROCESS""/>
</log>
</then>
<else>
<log description="Found Resource Log">
<property name="message" value=""Resources have been found, will be processed""/>
</log>
</else>
</filter>
Ok so my problem is: What have I to use as expression to enter in the case if the $ctx:total_samples value is 0 in the following line?
<filter xpath="EXPRESSION THAT DO SOMETHING LIKE: $ctx:total_samples == 0">
A more generic solution:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="testIfElse"
transports="https http"
startOnLoad="true">
<target>
<inSequence>
<payloadFactory media-type="xml">
<format>
<ds:Sample xmlns:ds="http://ws.wso2.org/dataservice">
<ds:INT_ID>1</ds:INT_ID>
<ds:INT_ID>2</ds:INT_ID>
<ds:INT_ID>3</ds:INT_ID>
</ds:Sample>
</format>
<args>
</args>
</payloadFactory>
<property expression="count(//ds:Sample/ds:INT_ID)" name="total_samples" scope="default" xmlns:ds="http://ws.wso2.org/dataservice" type="DOUBLE"/>
<property value="0" name="initial_value" scope="default" type="DOUBLE"/>
<property expression="fn:number($ctx:total_samples) > fn:number($ctx:initial_value)" name="result" scope="default"/>
<log level="custom">
<property expression="$ctx:initial_value" name="initial value: "/>
<property expression="fn:number($ctx:total_samples)" name="total samples: "/>
<property expression="$ctx:result" name="if total samples greater than initial value: "/>
</log>
<filter xpath="$ctx:result" regex="true">
<then>
<log description="Found Resource Log">
<property name="message" value=""Resources have been found, will be processed""/>
</log>
</then>
<else>
<log description="No Resource Log">
<property name="message" value=""EMPTY RESULTSET, NO RESOURCES TO PROCESS""/>
</log>
</else>
</filter>
</inSequence>
<outSequence>
<log level="full"/>
<drop/>
</outSequence>
<faultSequence/>
</target>
</proxy>
Use this expression
<filter xpath="fn:number(get-property('total_samples')) = fn:number(0)">
you are really asking three questions here so I'll try to answer all of them:
The Switch mediator allows for multiple cases, so for example you could have a case for count = 0, count = 1 and count > 1. The filter mediator on the other hand is like the classic if/else. If this than do x, else do .
The filter mediator can either work comparing some value with a regular expression using the 'source' and 'regex' attributes in which case it checks if they match. Or it uses the xpath attribute in which case it evaluates the result of the xpath expression as a boolean. In the xpath expression as well as the source you can refer directly to your property using $ctx. For example:
What you could do is
<filter xpath="fn:number($ctx:total_samples) = fn:number(0)">
In our project we are using WSO2 API Manager v 2.1.0. Our goal is to write a fault sequence that will log some information in custom logfile, example timestamp, name of the API etc. I was able to create a file and write to it, but it does not work as expected. Things I need to have is
Control the file name
Append content to file instead of overwriting it each time
This is the sequence I am using (simplified easier reading):
<?xml version="1.0" encoding="UTF-8"?>
<sequence xmlns="http://ws.apache.org/ns/synapse" name="admin--FaultyAPI2:v1.0.0--Fault">
<clone continueParent="true">
<target>
<sequence>
<property xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:ns3="http://org.apache.synapse/xsd" name="destination" expression="get-property('To')"/>
<format>
{
"destination_host" : "$1"
}
</format>
<args>
<arg xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:ns3="http://org.apache.synapse/xsd" evaluator="xml" expression="get-property('destination')"/>
</args>
</payloadFactory>
<property name="transport.vfs.ReplyFileName" value="test.txt" scope="transport" type="STRING"/>
<property name="OUT_ONLY" value="true" scope="default" type="STRING"/>
<send>
<endpoint>
<http uri-template="vfs:file:///home/install/out?transport.vfs.Append=true"/>
</endpoint>
</send>
</sequence>
</target>
</clone>
</sequence>
Following documentation I have used transport.vfs.ReplyFileName to specify the file name and ?transport.vfs.Append=true path parameter to tell it to append to file. The problem is that those two things are ignored.
First thing is that the file created is not test.txt but it is the endpoint URI that failed (the one I have setup in API Manager). So if I call /fault endpoint the file created is fault under location specified.
The second thing is that it is not appending to a file, but overwriting it each time the sequence is triggered. It is even worse! It creates actual path /home/install/out?transport.vfs.Append=true on file system and saves the file under this directory.
Those features seems to work under WSO ESB, but not API Manager. Any ideas anyone?
First of all, I have tested this in WSO2 EI, not in API Manager, but it seemed to me, the same problems you described appeared.
Controlling the filename
I've had some issues with this as well. The problem is that when you call the sequence through an API, the filename is not constructed based on the "transport.vfs.ReplyFileName" transport property, but based on the "REST_URL_POSTFIX" axis2 property. You can solve this by setting the "REST_URL_POSTFIX" property to the correct filename or by removing that property.
Appending the content
You are using an http endpoint, but you should use an address endpoint. In that case the path parameter will be recognized.
Example
I think your code should look more like this:
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="admin--FaultyAPI2:v1.0.0--Fault" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<clone continueParent="true">
<target>
<sequence>
<payloadFactory media-type="json">
<format>
{
"destination_host" : "$1"
}
</format>
<args>
<arg evaluator="xml" expression="get-property('destination')" xmlns:ns3="http://org.apache.synapse/xsd" xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"/>
</args>
</payloadFactory>
<property name="transport.vfs.ReplyFileName" scope="transport" type="STRING" value="test.txt"/>
<property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
<property name="REST_URL_POSTFIX" action="remove" scope="axis2" />
<send>
<endpoint>
<address uri="vfs:file:///home/install/out?transport.vfs.Append=true"/>
</endpoint>
</send>
</sequence>
</target>
</clone>
</sequence>
I am invoking a wso2 DSS service which returns me data like:
<IdentifierCollection xmlns="http://tempuri.org/">
<Identifier>
<One>1</One>
<Two>2</Two>
<Three>3</Three>
</Identifier>
</IdentifierCollection>
To invoke Dss my esb code is:
<payloadFactory>
<format>
<p:GetIdentifier xmlns:p="http://tempuri.org/">
<xs:ID xmlns:xs="http://tempuri.org/">$1</xs:ID>
</p:GetIdentifier >
</format>
<args>
<arg expression="get-property('ID')"/>
</args>
</payloadFactory>
<send receive="ResponseOfGetIdentifier">
<endpoint key="IdentifierEP"/>
</send>
Now in my ResponseOfGetIdentifier Sequence i am capturing all data in properties
<sequence xmlns="http://ws.apache.org/ns/synapse" name="ResponseOfGetIdentifier">
<iterate xmlns:ns="http://org.apache.synapse/xsd" xmlns:p="http://tempuri.org/" preservePayload="true" attachPath="//p:EntriesCollection" expression="//p:EntriesCollection/p:Entries" id="IterateForResponse">
<target>
<sequence>
<property xmlns:ns="http://org.apache.synapse/xsd" xmlns:p="http://tempuri.org" name="ResponseOne" expression="//p:Identifier/p:one" scope="default" type="STRING"/>
<property xmlns:ns="http://org.apache.synapse/xsd" xmlns:p="http://tempuri.org" name="ResponseTwo" expression="//p:Identifier/p:Two" scope="default" type="STRING"/>
<property xmlns:ns="http://org.apache.synapse/xsd" xmlns:p="http://tempuri.org" name="ResponseThree" expression="//p:Identifier/p:Three" scope="default" type="STRING"/>
<payloadFactory>
<format>
<tns:ProductIdentifier xmlns:tns="http://globalArther.products.com">
<IdentifierProducts>
<Product1>$1</Product1>
<Product2>$2</Product>
<Product3>$3</Product3>
</IdentifierProducts>
</tns:ProductIdentifier>
</format>
<args>
<arg expression="get-property('ResponseOne')"/>
<arg expression="get-property(''ResponseTwo)"/>
<arg expression="get-property('ResponseThree')"/>
</args>
</payloadFactory>
</sequence>
</target>
</iterate>
</sequence>
Since my dss response contains only one iteration of Identifier node hence above code is working but when my identifier node count is more than one i.e
<IdentifierCollection xmlns="http://tempuri.org/">
<Identifier>
<One>1</One>
<Two>2</Two>
<Three>3</Three>
</Identifier>
<Identifier>
<One>a</One>
<Two>b</Two>
<Three>c</Three>
</Identifier>
</IdentifierCollection>
, since my payload can take only one data it takes the second iteration data and shows me only single result as:
<tns:ProductIdentifier xmlns:tns="http://globalArther.products.com">
<IdentifierProducts>
<Product1>a</Product1>
<Product2>b</Product>
<Product3>c</Product3>
</IdentifierProducts>
</tns:ProductIdentifier>
But i want my response as :
<tns:ProductIdentifier xmlns:tns="http://globalArther.products.com">
<IdentifierProducts>
<Product1>1</Product1>
<Product2>2</Product>
<Product3>3</Product3>
</IdentifierProducts>
<IdentifierProducts>
<Product1>a</Product1>
<Product2>b</Product>
<Product3>c</Product3>
</IdentifierProducts>
</tns:ProductIdentifier>
So now my question is how can i do that i.e how can i make my payload dynamic i.e. i want to add every iteration in my payload.
Looking forward to your answers.Thanks in advance
Payload is kind of static. You need to use XSLT mediator to achieve this .That is, you have to write XSLT script to make the iteration logic.
This may be a basic question, I am just getting used to the WSO2 lingo. I have two services that I can deploy independently with WSDLs and pass the proper SOAP request, and return information accordingly. Now I want to combine them into an 'If then, else' statement sort of deal. This would be set up in a sequence of some sort I believe, just not sure how with the filters.
Send in request with authentication request and info request
Do authentication request – continue if passes, 401 on failure
Do info request – get info
Return the info
If you have a sample I could follow or point me to one of the hundreds WSO2 has, I just haven't been able to pull much from them. XML source example for the config could work also. Thanks for the help, and for my ignorance of WSO2 lingo, and workflow.
You can have a look at filter mediator to filter messages based on conditions Entitlement Mediator. You can find samples here as a reference which will be helpful for your use case.
So I ended up with something very similar to this. If someone down the road comes across this and looking for the wso2 configurations.
<proxy name="name"
transports="https http"
startOnLoad="true"
trace="disable">
<description/>
<target>
<inSequence>
<property xmlns:ns1="ns1"
xmlns:ns="ns"
name="userID"
expression="//ns:AuthenticateRequest/ns:Credentials/ns1:userID"
scope="default"
type="STRING"/>
<property xmlns:ns1="ns1"
xmlns:ns="ns1"
name="password"
expression="//ns:AuthenticateRequest/ns:Credentials/ns1:password"
scope="default"
type="STRING"/>
<log>
<property name="userID" expression="get-property('userID')"/>
<property name="password" expression="get-property('password')"/>
</log>
<header name="Action"
value="http://services.com:port/AuthenticateSecureCredential"/>
<send receive="AuthRecvSequence">
<endpoint>
<address uri="http://server.com:port/DefaultAuthenticationService"/>
</endpoint>
</send>
</inSequence>
</target>
</proxy>
<sequence name="AuthRecvSequence">
<filter xmlns:ns="ns"
source="//ns:AuthenticateSecureCredentialResponse/ns:isAuthenticated"
regex="false">
<then>
<makefault version="soap11">
<code xmlns:soap11Env="http://schemas.xmlsoap.org/soap/envelope/"
value="soap11Env:VersionMismatch"/>
<reason value="Not Authenticated"/>
<role/>
</makefault>
<header name="To" action="remove"/>
<property name="RESPONSE" value="true" scope="default" type="STRING"/>
<send/>
<drop/>
</then>
<else>
<payloadFactory>
<format>
<ns:INFO xmlns:ns="ns"
xmlns:ns1="ns1">
<ns:secureCredentials>
<ns1:userID>$1</ns1:userID>
<ns1:password>$2</ns1:password>
</ns:secureCredentials>
</ns:INFORequest>
</format>
<args>
<arg expression="get-property('userID')"/>
<arg expression="get-property('password')"/>
</args>
</payloadFactory>
<header name="Action"
value="http://services.com/GetINFO"/>
<send receive="INFOrRecvSeq">
<endpoint>
<address uri="http://server:port/INFOService"/>
</endpoint>
</send>
</else>
</filter>
</sequence>
<sequence name="INFORecvSeq">
<send/>
</sequence>
<sequence name="main">
<description>The main sequence for the message mediation</description>
</sequence>