This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io | |
pram ="""<?xml version="1.0" encoding="UTF-8"?> | |
<proxy xmlns="http://ws.apache.org/ns/synapse" | |
name="vfs_{0}" | |
transports="https,http" | |
statistics="disable" | |
trace="disable" | |
startOnLoad="true"> | |
<target> | |
<inSequence> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, sys | |
for i in range(1001, 1500): | |
newpath = ((r'/home/vanji/Work/VFS/Out/client_%s-test') % (i)) | |
if not os.path.exists(newpath): os.makedirs(newpath) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<property name="propertyA" value="'abc'"/> | |
<log level="custom"> | |
<property name="propertyA" expression="get-property('propertyA')"/> | |
</log> | |
<property name="propertyB" value="'abc'"/> | |
<log level="custom"> | |
<property name="propertyB" expression="get-property('propertyB')"/> | |
</log> | |
<property name="propertyCompare" expression="get-property('propertyA') = get-property('propertyB')"/> | |
<log level="custom"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<api name="UserProfileMgtRestServices" context="/UserProfileMgtRestServices"> | |
<resource methods="GET" uri-template="/getUserProfiles/{userId}"> | |
<inSequence> | |
<payloadFactory media-type="xml"> | |
<format> | |
<mgt:getUserProfiles xmlns:mgt="http://mgt.profile.user.identity.carbon.wso2.org"> | |
<mgt:username>$1</mgt:username> | |
</mgt:getUserProfiles> | |
</format> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.security.Provider; | |
import java.security.Security; | |
public class SecurityListings { | |
public static void main(String[] args) { | |
for (Provider provider : Security.getProviders()) { | |
System.out.println("Provider: " + provider.getName()); | |
for (Provider.Service service : provider.getServices()) { | |
System.out.println(" Algorithm: " + service.getAlgorithm()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<sequence xmlns="http://ws.apache.org/ns/synapse" name="main"> | |
<in> | |
<filter xmlns:ns="http://org.apache.synapse/xsd" source="get-property('To')" regex=".*/StockQuote.*"> | |
<then> | |
<send> | |
<endpoint> | |
<address uri="http://localhost:9000/services/SimpleStockQuoteService"></address> | |
</endpoint> | |
</send> | |
</then> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var text = '{"invideoPromotion":{"items":[{"id":{"type":"video","videoId":"11","websiteUrl":""},"timing":{"type":"ms","offsetMs":"2222"},"customMessage":"aa","promotedByContentOwner":"vanji"}]}}' | |
var obj = JSON.parse(text); | |
document.writeln(JSON.stringify(obj)); | |
for (var i = 0; i < obj.invideoPromotion.items.length; i++) { | |
if (obj.invideoPromotion.items[i].id.type == 'video') { | |
if (obj.invideoPromotion.items[i].id.websiteUrl == '') { | |
delete obj.invideoPromotion.items[i].id.websiteUrl; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<api xmlns="http://ws.apache.org/ns/synapse" name="strip" context="/strip"> | |
<resource methods="POST GET"> | |
<inSequence> | |
<header name="Authorization" scope="transport" value="Bearer XXXXXXXXXXXXXXXXXXXXX"></header> | |
<property name="uri.var.chargeId" expression="json-eval($.chargeId)" scope="default" type="STRING"></property> | |
<payloadFactory media-type="json"> | |
<format></format> | |
<args></args> | |
</payloadFactory> | |
<property name="ContentType" value="application/x-www-form-urlencoded" scope="axis2"></property> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<api xmlns="http://ws.apache.org/ns/synapse" name="TestApi" context="/TestContext"> | |
<resource methods="POST GET"> | |
<inSequence> | |
<log level="custom"> | |
<property name="Message Flow" value="Roovershof Plant Search API - IN"></property> | |
<property name="HTTP_METHOD IS###########" expression="$axis2:HTTP_METHOD"></property> | |
<property name="ip address" expression="get-property('axis2','REMOTE_ADDR')"></property> | |
<property name="Authorization" expression="get-property('transport','Authorization')"></property> | |
</log> | |
<property name="TIME_IN" expression="get-property('SYSTEM_TIME')" scope="default" type="LONG"></property> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<proxy xmlns="http://ws.apache.org/ns/synapse" | |
name="RecursiveValueFetch" | |
transports="https,http" | |
statistics="disable" | |
trace="disable" | |
startOnLoad="true"> | |
<target> | |
<inSequence> | |
<property name="Key" value="Location" scope="default" type="STRING"/> |
OlderNewer