Permalink
Browse files

transfered sources collection to github

  • Loading branch information...
1 parent 41f2b0d commit 64a4275d53d0f14d4cb22d6532581106f051d0ee @tardate committed Jul 8, 2008
Binary file not shown.
Binary file not shown.
View
@@ -0,0 +1,111 @@
+#!/usr/bin/perl -w
+# $Id: debugSoapData.pl,v 1.2 2007/05/19 02:48:51 paulg Exp $
+#
+# how to debug SOAP::Lite xml
+#
+# See http://www.majordojo.com/archives/cat_soaplite_solutions.html
+#
+
+use strict;
+use Getopt::Long;
+use Data::Dumper; $Data::Dumper::Terse = 1; $Data::Dumper::Indent = 1;
+
+my $opt_name = "joe blow";
+my $opt_city = "Singapore";
+my $opt_zip = "787082";
+my $opt_street = "Yio Chu Kand Rd";
+my $opt_state = "na";
+my $opt_debug;
+my $opt_help;
+
+GetOptions(
+ "name=s" => \$opt_name,
+ "city=s" => \$opt_city,
+ "street=s" => \$opt_street,
+ "state=s" => \$opt_state,
+ "zip=s" => \$opt_zip,
+ "help" => \$opt_help,
+ "debug" => \$opt_debug
+);
+
+usage() if $opt_help;
+
+if ($opt_debug) {
+ eval "use SOAP::Lite +trace => 'debug';";
+} else {
+ eval "use SOAP::Lite;";
+}
+
+
+sub usage
+{
+ print <<END_OF_USAGE;
+PURPOSE:
+Tests debug for SOAP::Lite
+USAGE:
+perl debugSoapData.pl -debug
+
+END_OF_USAGE
+}
+
+
+my $serviceUrl = 'http://localhost:8000/axis2/services/AddressBookService';
+my $wsdlUrl = 'http://localhost/axis2/services/AddressBookService?wsdl';
+my $serviceNs = 'http://service.addressbook.sample/xsd';
+my $entryNs = 'http://entry.addressbook.sample/xsd';
+
+
+my $soap = SOAP::Lite
+ -> proxy ( $serviceUrl)
+ ;
+
+#
+#
+sub dumpit {
+ my ( $dat ) = @_;
+ print Dumper $dat;
+
+}
+
+# find entry
+sub findEntry {
+ my ( $soap, $search_name ) = @_;
+
+ my $som = $soap->call(SOAP::Data->name('findEntry')->attr({xmlns => $serviceNs})
+ => ($search_name)
+ );
+
+ #my $som = $soap->findEntry($search_name);
+ dumpit( $som );
+}
+
+
+
+# add an entry - works
+sub addEntry {
+
+ my ( $soap, $opt_name, $opt_city, $opt_street, $opt_state,$opt_zip ) = @_;
+
+ my $som = $soap->call(
+ SOAP::Data->name('addEntry')->attr({xmlns => $serviceNs}) =>
+ SOAP::Data->name('param0' =>
+ \SOAP::Data->value(
+ SOAP::Data->name('city' => $opt_city),
+ SOAP::Data->name('name' => $opt_name),
+ SOAP::Data->name('postalCode' => $opt_zip),
+ SOAP::Data->name('state' => $opt_state),
+ SOAP::Data->name('street' => $opt_street)
+ )
+ )
+ );
+
+ # cool. see http://tech.groups.yahoo.com/group/soaplite/message/5946
+ print $soap->transport->http_request->content();
+
+ dumpit( $som );
+
+}
+
+addEntry( $soap, $opt_name, $opt_city, $opt_street, $opt_state,$opt_zip );
+
+#findEntry( $soap, $opt_name);
View
Binary file not shown.
View
@@ -0,0 +1,135 @@
+--
+-- demonstrates collapsing an XML structure down to a vector of paths and values
+-- see discussion at http://forums.oracle.com/forums/thread.jspa?messageID=1696372
+-- uses xsl approach with path tracing (see http://www.dpawson.co.uk/xsl/sect2/N6077.html for more info)
+--
+-- $Id: extractPaths.sql,v 1.2 2007/02/17 18:08:52 paulg Exp $
+-- author: Paul Gallagher gallagher.paul@gmail.com
+--
+
+set serveroutput on
+set LINESIZE 132
+
+DROP TABLE x1;
+CREATE TABLE x1 (item varchar(25) primary key, xml xmltype);
+
+INSERT INTO x1 VALUES ('data',
+'<?xml version="1.0" encoding="ISO-8859-1"?>
+<FamilyHistory>
+ <Family>
+ <Sponsor>
+ <Name>
+ <Last>Jones</Last>
+ <First>Tom</First>
+ </Name>
+ <SSN>123456781</SSN>
+ </Sponsor>
+ <Children>
+ <Child>
+ <Name>
+ <Last>Smith</Last>
+ <First>Sandra</First>
+ </Name>
+ <SSN>123456783</SSN>
+ <Allergies>
+ <Allergy>
+ <Allergen>Dust</Allergen>
+ <TreatmentType>Injection</TreatmentType>
+ <Treatments>
+ <Treatment>
+ <Date>20040118</Date>
+ <Reaction>None</Reaction>
+ </Treatment>
+ <Treatment>
+ <Date>20040220</Date>
+ <Reaction>Redness</Reaction>
+ </Treatment>
+ </Treatments>
+ </Allergy>
+ <Allergy>
+ <Allergen>Ragweed</Allergen>
+ <Treatment>None</Treatment>
+ </Allergy>
+ </Allergies>
+ </Child>
+ <Child>
+ <Name>
+ <Last>Jones</Last>
+ <First>Carolyn</First>
+ </Name>
+ <SSN>123456782</SSN>
+ </Child>
+ </Children>
+ </Family>
+</FamilyHistory>');
+
+INSERT INTO x1 VALUES ('xsl-to-xml',
+'<?xml version="1.0" encoding="windows-1252" ?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output method="xml"/>
+<xsl:strip-space elements = "*" />
+<xsl:template match="/">
+ <items>
+ <xsl:apply-templates/>
+ </items>
+</xsl:template>
+<xsl:template match="text()">
+ <item>
+ <path>
+ <xsl:for-each select="ancestor-or-self::*">
+ <xsl:text>/</xsl:text>
+ <xsl:value-of select="name()" />
+ </xsl:for-each>
+ </path>
+ <value>
+ <xsl:value-of select="." />
+ <xsl:apply-templates/>
+ </value>
+ </item>
+</xsl:template>
+</xsl:stylesheet>');
+
+INSERT INTO x1 VALUES ('xsl-to-text',
+'<?xml version="1.0" encoding="windows-1252" ?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output method="text"/>
+<xsl:strip-space elements = "*" />
+<xsl:template match="text()">
+ <xsl:for-each select="ancestor-or-self::*">
+ <xsl:text>/</xsl:text>
+ <xsl:value-of select="name()" />
+ </xsl:for-each>
+ <xsl:text>():</xsl:text>
+ <xsl:value-of select="." />
+ <xsl:text>, &#xA;</xsl:text>
+ <xsl:apply-templates/>
+</xsl:template>
+</xsl:stylesheet>');
+
+declare
+v_out_xml xmltype;
+v_out_text varchar(4000);
+begin
+
+dbms_output.put_line('-- as text list:');
+select
+ XMLTransform(
+ xml,
+ (select xml from x1 where item='xsl-to-text')
+ ).getstringval() into v_out_text
+from x1 where item='data';
+dbms_output.put_line(v_out_text);
+
+dbms_output.put_line('-- as xml structure:');
+select
+ XMLTransform(
+ xml,
+ (select xml from x1 where item='xsl-to-xml')
+ ) into v_out_xml
+from x1 where item='data';
+dbms_output.put_line(v_out_xml.getstringval());
+
+
+end;
+
+/
View
Binary file not shown.
@@ -0,0 +1,75 @@
+#!/bin/bash
+
+echo "Installation script for Oracle Instant Client"
+echo ""
+echo "This will install Instant Client Basic + SDK + sqlplus. I need at the following 3 zip"
+echo "files in the current directory:"
+echo ""
+echo " instantclient-basic*.zip e.g. instantclient-basic-linux32-10.2.0.3-20061115.zip"
+echo " instantclient-sdk*.zip e.g. instantclient-sdk-linux32-10.2.0.2-20060331.zip"
+echo " instantclient-sqlplus*.zip e.g. instantclient-sqlplus-linux32-10.2.0.3-20061115.zip"
+echo ""
+
+# check zip file presence. expect to find 3 zips
+numfiles=$(ls -ld instantclient*.zip 2> /dev/null | grep -c "^-")
+
+if [ $numfiles != 3 ]
+then
+ echo "I'm expecting to see 3 Instant Client zip files. What I found is ${numfiles}:"
+ ls -ld instantclient*.zip 2> /dev/null
+ exit
+fi
+
+# unzip into specified directory
+echo "Unzipping ..."
+unzip instantclient-basic*.zip
+unzip instantclient-sdk*.zip
+unzip instantclient-sqlplus*.zip
+
+# get the actual directory name
+dir=$(ls -ld instantclient* 2> /dev/null | grep "^d" | tail -n 1 | awk '{print $9}')
+echo -e "\nIt seems the instant client directory is ${dir}"
+
+# Fixup - bin directory
+echo -e "\nMaking bin directory.."
+mkdir ${dir}/bin 2> /dev/null
+mv ${dir}/sqlplus ${dir}/bin
+mv ${dir}/*.sql ${dir}/bin
+mv ${dir}/genezi ${dir}/bin
+
+# Fixup - lib directory
+echo -e "\nMaking lib directory.."
+mkdir ${dir}/lib 2> /dev/null
+mv ${dir}/*.so* ${dir}/lib
+mv ${dir}/*.jar ${dir}/lib
+
+# Fixup - .so links
+ln ${dir}/lib/libocci.so.10.1 ${dir}/lib/libocci.so
+ln ${dir}/lib/libocci.so.10.1 ${dir}/lib/occi.so
+ln ${dir}/lib/libclntsh.so.10.1 ${dir}/lib/libclntsh.so
+ln ${dir}/lib/libclntsh.so.10.1 ${dir}/lib/clntsh.so
+
+# Fixup - tnsnames.ora
+echo -e "\nMaking network/admin directory.."
+mkdir ${dir}/network 2> /dev/null
+mkdir ${dir}/network/admin 2> /dev/null
+if [ ! -e ${dir}/network/admin/tnsnames.ora ]
+then
+ echo -e "# Dummy tnsnames.ora\n#\n\n" > ${dir}/network/admin/tnsnames.ora
+ echo " .. a default tnsnames.ora has been placed in ${dir}/network/admin"
+fi
+
+# summary results
+echo -e "\nInstant Client installed.\n"
+
+
+echo -e "\nTo set environment, suggest you modify your .bash_profile to add the following (NB: set SID appropriate to your installation):\n"
+echo "export ORACLE_HOME=$(pwd)/${dir}"
+echo "export LD_LIBRARY_PATH=\$ORACLE_HOME/lib"
+echo "export PATH=\$PATH:\$ORACLE_HOME/bin"
+echo "export ORACLE_SID=ORCL"
+echo ""
+echo "Done!"
+
+
+
Oops, something went wrong.

0 comments on commit 64a4275

Please sign in to comment.