No Tharindua , there is no improvement

On Sun, Sep 7, 2014 at 11:33 AM, Tharindua Dharmarathna <[email protected]>
wrote:

> Hi Elilmatha ,
> Regarding to your problem please check with below xml syntax replacing the
>
> eventAttendees template
>
> <?xml version="1.0" encoding="UTF-8"?>
> <template name="eventAttendees" xmlns="http://ws.apache.org/ns/synapse";>
>     <parameter name="EventID" description="Full-text search query string." />
>
>
>     <parameter name="status" description="status" />
>     <parameter name="changedSince" description="changed_since." />
>     <parameter name="expand" description=" expand." />
>     <parameter name="parameters" description=" parameters." />
>
>     <sequence>
>         <property name="uri.var.EventID" expression="$func:EventID" />
>         <property name="uri.var.accessToken" expression="$func:accessToken" />
>         <property name="uri.var.status" expression="$func:status" />
>         <property name="uri.var.changed_since" 
> expression="$func:changed_since" />
>         <property name="uri.var.expand" expression="$func:expand" />
>         <property name="eventbrite.parameters" value=""/>
>
>         <filter xpath="(not(get-property('uri.var.status') = '' or 
> (not(string(get-property('uri.var.status'))))))">
>             <then>
>                 <property name="uri.var.apiParameters"
>                           
> expression="fn:concat(get-property('uri.var.apiParameters'),'status=',get-property('uri.var.status'),'&amp;')"/>
>             </then>
>         </filter>
>         <filter xpath="(not(get-property('uri.var.changed_since') = '' or 
> (not(string(get-property('uri.var.changed_since'))))))">
>             <then>
>                 <property name="uri.var.apiParameters"
>                           
> expression="fn:concat(get-property('uri.var.apiParameters'),'changed_since=',get-property('uri.var.changed_since'),'&amp;')"/>
>             </then>
>         </filter>
>
>
>     <filter xpath="(not(get-property('uri.var.expand') = '' or 
> (not(string(get-property('uri.var.expand'))))))">
>         <then>
>             <property name="uri.var.apiParameters"
>                       
> expression="fn:concat(get-property('uri.var.apiParameters'),'expand=',get-property('uri.var.expand'),'&amp;')"/>
>         </then>
>     </filter>
>               <call>
>
>             <endpoint>
>                 <http method="get"
>                       
> uri-template="https://www.eventbriteapi.com/v3/events/{uri.var.EventID}/attendees/?{uri.var.apiParameters}&amp;token={uri.var.accessToken}";
>  />
>             </endpoint>
>         </call>
>     </sequence>
> </template>
>
>
>
>
>
> On Sun, Sep 7, 2014 at 7:28 AM, Elilmatha Sivanesan <[email protected]>
> wrote:
>
>> I'm trying to create a eventbrite connector for WSO2 ESB. After creating
>> the connector I have added the connector to ESB. Then I want to test it. My
>> file look like this
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <template name="eventAttendees" xmlns="http://ws.apache.org/ns/synapse";>
>>     <parameter name="EventID" description="Full-text search query string." />
>>
>>
>>     <parameter name="status" description="status" />
>>     <parameter name="changedSince" description="changed_since." />
>>     <parameter name="expand" description=" expand." />
>>     <parameter name="parameters" description=" parameters." />
>>
>>     <sequence>
>>         <property name="uri.var.EventID" expression="$func:EventID" />
>>         <property name="uri.var.accessToken" expression="$func:accessToken" 
>> />
>>
>>         <property name="uri.var.status" expression="$func:status" />
>>         <property name="uri.var.changed_since" 
>> expression="$func:changed_since" />
>>         <property name="uri.var.expand" expression="$func:expand" />
>>
>>         <property name="eventbrite.parameters" value=""/>
>>
>>           <filter
>>                xpath="get-property('uri.var.status') = '' or  
>> not(string(get-    property('uri.var.status')))" >
>>              <then>
>>                 <property name="uri.var.status" value=""/>
>>             </then>
>>              <else>
>>                 <property name="eventbrite.parameters" 
>> expression="fn:concat(get-property('eventbrite.parameters'),
>>             '&amp;status=', get-property('uri.var.status'))"/>
>>             </else>
>>         </filter>
>>
>>         <filter
>>             xpath="get-property('uri.var.changed_since') = '' or  
>> not(string(get-property('uri.var.changed_since')))" >
>>             <then>
>>                 <property name="uri.var.changed_since" value=""/>
>>             </then>
>>             <else>
>>                 <property name="eventbrite.parameters" 
>> expression="fn:concat(get-property('eventbrite.parameters'),
>>             '&amp;changed_since=', get-property('uri.var.changed_since'))"/>
>>              </else>
>>          </filter>
>>
>>          <filter
>>             xpath="get-property('uri.var.expand') = '' or  not(string(get-   
>> property('uri.var.expand')))" >
>>              <then>
>>                 <property name="uri.var.expand" value=""/>
>>             </then>
>>                 <else>
>>                  <property name="eventbrite.parameters" 
>> expression="fn:concat(get-property('eventbrite.parameters'),
>>             '&amp;expand=', get-property('uri.var.expand'))"/>
>>              </else>
>>          </filter>
>>
>>         <property name="uri.var.parameters" 
>> expression="get-property('eventbrite.parameters')" />
>>         <call>
>>
>>              <endpoint>
>>                 <http method="get"
>>                   
>> uri-template="https://www.eventbriteapi.com/v3/events/{uri.var.EventID}/attendees/?{uri.var.parameters}&amp;token={uri.var.eventbrite.accessToken}";
>>  />
>>              </endpoint>
>>         </call>
>>     </sequence>
>> </template>
>>
>>
>> After I have configured a custom proxy service within the ESB like this:
>>
>>  <?xml version="1.0" encoding="UTF-8"?>
>>       <proxy xmlns="http://ws.apache.org/ns/synapse";
>>        name="eventAttendees"
>>        transports="https,http"
>>        statistics="disable"
>>        trace="disable"
>>        startOnLoad="true">
>>     <target>
>>         <inSequence>
>>           <event_brite.init>
>>              <accessToken>NDYKPVXF2E36W57EB5B2</accessToken>
>>           </event_brite.init>
>>          <property name="EventID" expression="json-eval($.EventID)"/>
>>          <property name="status" expression="json-eval($.status)"/>
>>          <property name="changed_since" 
>> expression="json-eval($.changed_since)"/>
>>          <property name="expand" expression="json-eval($.expand)"/>
>>          <event_brite.eventAttendees>
>>             <EventID>{$ctx:EventID}</EventID>
>>             <status>{$ctx:status}</status>
>>             <changed_since>{$ctx:changed_since}</changed_since>
>>             <expand>{$ctx:expand}</expand>
>>             </event_brite.eventAttendees>
>>             <respond/>
>>          </inSequence>
>>         <outSequence>
>>         <log/>
>>          <send/>
>>       </outSequence>
>>      </target>
>>    <description/>
>> </proxy>
>>
>>
>>
>> then whn i test it in postman
>> http://elilmathas-MacBook-Pro.local:8280/services/eventAttendees
>> <http://elilmathas-macbook-pro.local:8280/services/eventAttendees> with
>> parameters
>>
>> {"EventID":"12792941031","status":"Attending", }
>>
>> it works ,But the out put i get gives all the vales ie if i give the
>> parameters as
>>
>> {"EventID":"12792941031","status":"Not_Attending", }
>>
>> i get the same out put which i got for the first one IT IS NOT FILTERED.
>> What can be the problem?
>>
>> --
>> *S.Elilmatha*
>> Associative Software Engineer,
>>
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> Mobile 0779842221.
>>
>>
>
>
> --
>
> *Tharindu Dharmarathna*Associate Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> mobile: *+94779109091 <%2B94779109091>*
>



-- 
*S.Elilmatha*
Associative Software Engineer,

WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

Mobile 0779842221.
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to