Skip to content

Instantly share code, notes, and snippets.

View yamanyar's full-sized avatar

Kaan Yamanyar yamanyar

View GitHub Profile
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dp="http://www.datapower.com/extensions"
extension-element-prefixes="dp"
>
<dp:input-mapping href="store:///pkcs7-convert-input.ffd" type="ffd"/>
<xsl:template match="/">
<xsl:variable name="response">
<xsl:value-of select="dp:binary-encode(/object/message)"/>
@yamanyar
yamanyar / sample.xml
Created September 5, 2013 08:35
Sample xml for datapower url extractor
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:int="http://integration.abc.com">
<soapenv:Header/>
<soapenv:Body>
<int:request>
<int:ip>verysecret.company.com</int:ip>
<int:operation>sitecheck.aspx</int:operation>
<int:params>
<!--Zero or more repetitions:-->
<int:item>
<int:key>alfa</int:key>
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:text>http://</xsl:text><xsl:value-of select="//*[local-name()='ip']"/><xsl:text>:</xsl:text>
<xsl:value-of select="//*[local-name()='port']"/><xsl:text>/</xsl:text>
<xsl:value-of select="//*[local-name()='operation']"/>
<xsl:for-each select="//*[local-name()='item']">
<xsl:if test="position()=1">
local_filename = "d:\\codes\\harmony\\back-end\\target\\restrict-maven-plugin.txt"
File.open(local_filename, 'r') do |f|
paket = nil
while line = f.gets
if line.start_with?("Restricted access from")
tokens = line.split(/\(|\)/)
paket_suan = tokens[1][tokens[1].rindex(/\\/)+1..-1]
if paket_suan != paket
<build>
<plugins>
<plugin>
<groupId>com.yamanyar</groupId>
<artifactId>restrict-maven-plugin</artifactId>
<version>0.6</version>
<executions>
<execution>
@yamanyar
yamanyar / generate.bat
Created July 4, 2012 12:59
example to deploy axis2 artifacts with sources to nexus
@echo off
echo "Generating Axis-2 Client Stubs."
echo "Do not forget to set environment specific variables before executing this script."
echo "You only need to execute this script if new/update of wsdl or xsd occurs."
echo "Kaan Yamanyar, 2012."
set JAVA_HOME=D:\apps\jdk6
set THE_AXIS_PATH=d:\apps\axis2-1.6.2
@yamanyar
yamanyar / ErrorDetail.java
Created June 26, 2012 08:00
Log and reply with AggregatedXmlMessageValidationException details
package com.yamanyar.mediation.esb.services;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.integration.Message;
import org.springframework.integration.message.ErrorMessage;
import org.springframework.integration.xml.AggregatedXmlMessageValidationException;
import org.springframework.xml.xsd.XsdSchemaException;
@yamanyar
yamanyar / fragment.xml
Created June 26, 2012 07:58
xml fragment: error channel
<int-ws:inbound-gateway id="ws-odemeGonder-inbound"
request-channel="odemeGonderChannel" error-channel="inboundsErrorChannel"/>
<int:channel id="inboundsErrorChannel"/>
<int:service-activator input-channel="inboundsErrorChannel">
<bean class="com.yamanyar.mediation.esb.services.ErrorDetail"/>
</int:service-activator>
@yamanyar
yamanyar / error.txt
Created June 26, 2012 07:57
Error message
org.springframework.integration.MessageRejectedException: Message was rejected due to XML Validation errors
at org.springframework.integration.xml.selector.XmlValidatingMessageSelector.accept(XmlValidatingMessageSelector.java:101)
at org.springframework.integration.filter.MessageFilter.handleRequestMessage(MessageFilter.java:103)
...
Caused by: org.springframework.integration.xml.AggregatedXmlMessageValidationException
... 39 more
@yamanyar
yamanyar / config-fragment.xml
Created June 12, 2012 08:08
Configuration fragment from spring config file
<int:channel id="inChannel"/>
<int:transformer id="saxonTransformerOdemeGonder" input-channel="inChannel"
output-channel="transformedOutChannel">
<beans:bean class="com.yamanyar.esb.transformers.SaxonXsltTransformer">
<beans:constructor-arg value="classpath:/xsls/scoped-def-namespaces.xsl" index="0"/>
<beans:constructor-arg ref="resultTransformer" index="1"/>
</beans:bean>