You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ma...@apache.org on 2007/05/14 05:41:07 UTC

svn commit: r537698 [2/2] - in /webservices/axis2/scratch/c/neethi/axis2c/neethi: src/ test/ test/policies/

Added: webservices/axis2/scratch/c/neethi/axis2c/neethi/test/policies/PolicyAttachments.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/test/policies/PolicyAttachments.wsdl?view=auto&rev=537698
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/test/policies/PolicyAttachments.wsdl (added)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/test/policies/PolicyAttachments.wsdl Sun May 13 20:41:04 2007
@@ -0,0 +1,448 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- Round 2 test cases for testing effective policy 
+     computations for policies attached to WSDL 20 policy subjects.
+
+    xmlns:wsp="http://www.w3.org/ns/ws-policy"
+    
+ -->
+ 
+<wsdl20:description xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:wsdl20="http://www.w3.org/2006/01/wsdl"
+    xmlns:wsoap="http://www.w3.org/2006/01/wsdl/soap"
+    xmlns:wsp="http://www.w3.org/ns/ws-policy"
+    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+    xmlns:pa="http://ws-policy.example.com/assertion"
+    xmlns:s="http://schema.example.com/test"
+    targetNamespace="http://ws-policy.example.com/test"
+    xmlns:tns="http://ws-policy.example.com/test"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd
+    http://www.w3.org/2006/01/wsdl http://www.w3.org/2006/03/wsdl/wsdl20.xsd
+    http://www.w3.org/2006/01/wsdl/soap http://www.w3.org/2006/03/wsdl/soap.xsd
+    http://www.w3.org/ns/ws-policy http://www.w3.org/2002/ws/policy/ns/ws-policy">
+    
+    <wsp:Policy wsu:Id="Policy1">
+        <pa:Assertion1 marker="1"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy2">
+        <pa:Assertion2 marker="2"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy3">
+        <pa:Assertion3 marker="3"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy4">
+        <pa:Assertion4 marker="4"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy5">
+        <pa:Assertion5 marker="5"/>
+        <wsp:PolicyReference URI="#Policy2"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy6">
+        <pa:Assertion6 marker="6"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy7">
+        <pa:Assertion7 marker="7"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy8">
+        <pa:Assertion8 marker="8"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy9">
+        <pa:Assertion9 marker="9"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy10">
+        <pa:Assertion10 marker="10"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy11">
+        <pa:Assertion11 marker="11"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy12">
+        <pa:Assertion12 marker="12"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy13">
+        <pa:Assertion13 marker="13"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy14">
+        <pa:Assertion14 marker="14"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy15">
+        <pa:Assertion15 marker="15"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy16">
+        <pa:Assertion16 marker="16"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy17">
+        <pa:Assertion17 marker="17"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy18">
+        <pa:Assertion18 marker="18"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy19">
+        <pa:Assertion19 marker="19"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy20">
+        <pa:Assertion20 marker="20"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy21">
+        <pa:Assertion21 marker="21"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy22">
+        <pa:Assertion22 marker="22"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy23">
+        <pa:Assertion23 marker="23"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy24">
+        <pa:Assertion24 marker="24"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy25">
+        <pa:Assertion25 marker="25"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy26">
+        <pa:Assertion26 marker="26"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy27">
+        <pa:Assertion27 marker="27"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy28">
+        <pa:Assertion28 marker="28"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy29">
+        <pa:Assertion29 marker="29"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy30">
+        <pa:Assertion30 marker="30"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy31">
+        <pa:Assertion31 marker="31"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy32">
+        <pa:Assertion32 marker="32"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy33">
+        <pa:Assertion33 marker="33"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy34">
+        <pa:Assertion34 marker="34"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy35">
+        <pa:Assertion35 marker="35"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy36">
+        <pa:Assertion36 marker="36"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy37">
+        <pa:Assertion37 marker="37"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy38">
+        <pa:Assertion38 marker="38"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy39">
+        <pa:Assertion39 marker="39"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy40">
+        <pa:Assertion40 marker="40"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy41">
+        <pa:Assertion41 marker="41"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy42">
+        <pa:Assertion42 marker="42"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy43">
+        <pa:Assertion43 marker="43"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy44">
+        <pa:Assertion44 marker="44"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy45">
+        <pa:Assertion45 marker="45"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy46">
+        <pa:Assertion46 marker="46"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy47">
+        <pa:Assertion47 marker="47"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy48">
+        <pa:Assertion48 marker="48"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy49">
+        <pa:Assertion49 marker="49"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy50">
+        <pa:Assertion50 marker="50"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy51">
+        <pa:Assertion51 marker="51"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy52">
+        <pa:Assertion52 marker="52"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy53">
+        <pa:Assertion53 marker="53"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy54">
+        <pa:Assertion54 marker="54"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy55">
+        <pa:Assertion55 marker="55"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy56">
+        <pa:Assertion56 marker="56"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy57">
+        <pa:Assertion57 marker="57"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy58">
+        <pa:Assertion58 marker="58"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy59">
+        <pa:Assertion59 marker="59"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy60">
+        <pa:Assertion60 marker="60"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy61">
+        <pa:Assertion61 marker="61"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy62">
+        <pa:Assertion62 marker="62"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy63">
+        <pa:Assertion63 marker="63"/>
+    </wsp:Policy>
+    
+    <wsdl20:types>
+        <xsd:schema elementFormDefault="qualified" targetNamespace="http://schema.example.com/test">
+            <xsd:element name="SimpleRequest">
+                <xsd:complexType>
+                    <xsd:sequence>
+                        <xsd:element name="request" nillable="true" type="xsd:string"/>
+                    </xsd:sequence>
+                </xsd:complexType>
+            </xsd:element>
+            <xsd:element name="SimpleResponse">
+                <xsd:complexType>
+                    <xsd:sequence>
+                        <xsd:element name="response" nillable="true" type="xsd:string"/>
+                    </xsd:sequence>
+                </xsd:complexType>
+            </xsd:element>
+            <xsd:element name="SimpleFault">
+                <xsd:complexType>
+                    <xsd:sequence>
+                        <xsd:element name="fault" nillable="true" type="xsd:string"/>
+                    </xsd:sequence>
+                </xsd:complexType>
+            </xsd:element>
+        </xsd:schema>
+    </wsdl20:types>
+
+    <wsdl20:interface name="Base-Interface">
+        <wsp:PolicyReference URI="#Policy1"></wsp:PolicyReference>
+    </wsdl20:interface>
+    
+    <wsdl20:interface name="Interface-1" extends="tns:Base-Interface">
+        <wsp:PolicyReference URI="#Policy2"></wsp:PolicyReference>
+        <wsdl20:fault name="Fault-1" element="s:SimpleFault">
+            <wsp:PolicyReference URI="#Policy3"></wsp:PolicyReference>
+        </wsdl20:fault>
+        <wsdl20:operation name="Operation-1A" pattern="http://www.w3.org/2006/01/wsdl/in-out">
+            <wsp:PolicyReference URI="#Policy4"></wsp:PolicyReference>
+            <wsdl20:input element="s:SimpleRequest">
+                <wsp:PolicyReference URI="#Policy5"></wsp:PolicyReference>
+            </wsdl20:input>
+            <wsdl20:output element="s:SimpleResponse">
+                <wsp:PolicyReference URI="#Policy6"></wsp:PolicyReference>
+            </wsdl20:output>
+            <wsdl20:outfault ref="tns:Fault-1">
+                <wsp:PolicyReference URI="#Policy7"></wsp:PolicyReference>
+            </wsdl20:outfault>
+        </wsdl20:operation>
+        <wsdl20:operation name="Operation-1B" pattern="http://www.w3.org/2006/01/wsdl/in-out">
+            <wsp:PolicyReference URI="#Policy8"></wsp:PolicyReference>
+            <wsdl20:input element="s:SimpleRequest">
+                <wsp:PolicyReference URI="#Policy9"></wsp:PolicyReference>
+            </wsdl20:input>
+            <wsdl20:output element="s:SimpleResponse">
+                <wsp:PolicyReference URI="#Policy10"></wsp:PolicyReference>
+            </wsdl20:output>
+            <wsdl20:outfault ref="tns:Fault-1">
+                <wsp:PolicyReference URI="#Policy11"></wsp:PolicyReference>
+            </wsdl20:outfault>
+        </wsdl20:operation>        
+    </wsdl20:interface>
+
+    <wsdl20:interface name="Interface-2" extends="tns:Base-Interface">
+        <wsp:PolicyReference URI="#Policy12"></wsp:PolicyReference>
+        <wsdl20:fault name="Fault-2" element="s:SimpleFault">
+            <wsp:PolicyReference URI="#Policy13"></wsp:PolicyReference>
+        </wsdl20:fault>
+        <wsdl20:operation name="Operation-2A" pattern="http://www.w3.org/2006/01/wsdl/in-out">
+            <wsp:PolicyReference URI="#Policy14"></wsp:PolicyReference>
+            <wsdl20:input element="s:SimpleRequest">
+                <wsp:PolicyReference URI="#Policy15"></wsp:PolicyReference>
+            </wsdl20:input>
+            <wsdl20:output element="s:SimpleResponse">
+                <wsp:PolicyReference URI="#Policy16"></wsp:PolicyReference>
+            </wsdl20:output>
+            <wsdl20:outfault ref="tns:Fault-2">
+                <wsp:PolicyReference URI="#Policy17"></wsp:PolicyReference>
+            </wsdl20:outfault>
+        </wsdl20:operation>
+        <wsdl20:operation name="Operation-2B" pattern="http://www.w3.org/2006/01/wsdl/in-out">
+            <wsp:PolicyReference URI="#Policy18"></wsp:PolicyReference>
+            <wsdl20:input element="s:SimpleRequest">
+                <wsp:PolicyReference URI="#Policy19"></wsp:PolicyReference>
+            </wsdl20:input>
+            <wsdl20:output element="s:SimpleResponse">
+                <wsp:PolicyReference URI="#Policy20"></wsp:PolicyReference>
+            </wsdl20:output>
+            <wsdl20:outfault ref="tns:Fault-2">
+                <wsp:PolicyReference URI="#Policy21"></wsp:PolicyReference>
+            </wsdl20:outfault>
+        </wsdl20:operation>        
+    </wsdl20:interface>
+    
+    <wsdl20:binding name="Binding-1A" interface="tns:Interface-1"
+        type="http://www.w3.org/2006/01/wsdl/soap"
+        wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP/">
+        <wsp:PolicyReference URI="#Policy22"></wsp:PolicyReference>
+        <wsdl20:operation ref="tns:Operation-1A">
+            <wsp:PolicyReference URI="#Policy23"></wsp:PolicyReference>
+            <wsdl20:input>
+                <wsp:PolicyReference URI="#Policy24"></wsp:PolicyReference>
+            </wsdl20:input>
+            <wsdl20:output>
+                <wsp:PolicyReference URI="#Policy25"></wsp:PolicyReference>
+            </wsdl20:output>
+            <wsdl20:outfault ref="tns:Fault-1">
+                <wsp:PolicyReference URI="#Policy26"></wsp:PolicyReference>
+            </wsdl20:outfault>
+        </wsdl20:operation>
+        <wsdl20:operation ref="tns:Operation-1B">
+            <wsp:PolicyReference URI="#Policy27"></wsp:PolicyReference>
+            <wsdl20:input>
+                <wsp:PolicyReference URI="#Policy28"></wsp:PolicyReference>
+            </wsdl20:input>
+            <wsdl20:output>
+                <wsp:PolicyReference URI="#Policy29"></wsp:PolicyReference>
+            </wsdl20:output>
+            <wsdl20:outfault ref="tns:Fault-1">
+                <wsp:PolicyReference URI="#Policy30"></wsp:PolicyReference>
+            </wsdl20:outfault>
+        </wsdl20:operation>
+    </wsdl20:binding>
+
+    <wsdl20:binding name="Binding-1B" interface="tns:Interface-1"
+        type="http://www.w3.org/2006/01/wsdl/soap"
+        wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP/">
+        <wsp:PolicyReference URI="#Policy31"></wsp:PolicyReference>
+        <wsdl20:operation ref="tns:Operation-1A">
+            <wsp:PolicyReference URI="#Policy32"></wsp:PolicyReference>
+            <wsdl20:input>
+                <wsp:PolicyReference URI="#Policy33"></wsp:PolicyReference>
+            </wsdl20:input>
+            <wsdl20:output>
+                <wsp:PolicyReference URI="#Policy34"></wsp:PolicyReference>
+            </wsdl20:output>
+            <wsdl20:outfault ref="tns:Fault-1">
+                <wsp:PolicyReference URI="#Policy35"></wsp:PolicyReference>
+            </wsdl20:outfault>            
+        </wsdl20:operation>
+        <wsdl20:operation ref="tns:Operation-1B">
+            <wsp:PolicyReference URI="#Policy36"></wsp:PolicyReference>
+            <wsdl20:input>
+                <wsp:PolicyReference URI="#Policy37"></wsp:PolicyReference>
+            </wsdl20:input>
+            <wsdl20:output>
+                <wsp:PolicyReference URI="#Policy38"></wsp:PolicyReference>
+            </wsdl20:output>
+            <wsdl20:outfault ref="tns:Fault-1">
+                <wsp:PolicyReference URI="#Policy39"></wsp:PolicyReference>
+            </wsdl20:outfault>            
+        </wsdl20:operation>
+    </wsdl20:binding>
+
+    <wsdl20:binding name="Binding-2A" interface="tns:Interface-2"
+        type="http://www.w3.org/2006/01/wsdl/soap"
+        wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP/">
+        <wsp:PolicyReference URI="#Policy40"></wsp:PolicyReference>
+        <wsdl20:operation ref="tns:Operation-2A">
+            <wsp:PolicyReference URI="#Policy41"></wsp:PolicyReference>
+            <wsdl20:input>
+                <wsp:PolicyReference URI="#Policy42"></wsp:PolicyReference>
+            </wsdl20:input>
+            <wsdl20:output>
+                <wsp:PolicyReference URI="#Policy43"></wsp:PolicyReference>
+            </wsdl20:output>
+            <wsdl20:outfault ref="tns:Fault-2">
+                <wsp:PolicyReference URI="#Policy44"></wsp:PolicyReference>
+            </wsdl20:outfault>
+        </wsdl20:operation>
+        <wsdl20:operation ref="tns:Operation-2B">
+            <wsp:PolicyReference URI="#Policy45"></wsp:PolicyReference>
+            <wsdl20:input>
+                <wsp:PolicyReference URI="#Policy46"></wsp:PolicyReference>
+            </wsdl20:input>
+            <wsdl20:output>
+                <wsp:PolicyReference URI="#Policy47"></wsp:PolicyReference>
+            </wsdl20:output>
+            <wsdl20:outfault ref="tns:Fault-2">
+                <wsp:PolicyReference URI="#Policy48"></wsp:PolicyReference>
+            </wsdl20:outfault>
+        </wsdl20:operation>
+    </wsdl20:binding>
+    
+    <wsdl20:binding name="Binding-2B" interface="tns:Interface-2"
+        type="http://www.w3.org/2006/01/wsdl/soap"
+        wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP/">
+        <wsp:PolicyReference URI="#Policy49"></wsp:PolicyReference>
+        <wsdl20:operation ref="tns:Operation-2A">
+            <wsp:PolicyReference URI="#Policy50"></wsp:PolicyReference>
+            <wsdl20:input>
+                <wsp:PolicyReference URI="#Policy51"></wsp:PolicyReference>
+            </wsdl20:input>
+            <wsdl20:output>
+                <wsp:PolicyReference URI="#Policy52"></wsp:PolicyReference>
+            </wsdl20:output>
+            <wsdl20:outfault ref="tns:Fault-2">
+                <wsp:PolicyReference URI="#Policy53"></wsp:PolicyReference>
+            </wsdl20:outfault>            
+        </wsdl20:operation>
+        <wsdl20:operation ref="tns:Operation-2B">
+            <wsp:PolicyReference URI="#Policy54"></wsp:PolicyReference>
+            <wsdl20:input>
+                <wsp:PolicyReference URI="#Policy55"></wsp:PolicyReference>
+            </wsdl20:input>
+            <wsdl20:output>
+                <wsp:PolicyReference URI="#Policy56"></wsp:PolicyReference>
+            </wsdl20:output>
+            <wsdl20:outfault ref="tns:Fault-2">
+                <wsp:PolicyReference URI="#Policy57"></wsp:PolicyReference>
+            </wsdl20:outfault>            
+        </wsdl20:operation>
+    </wsdl20:binding>
+            
+    <wsdl20:service name="Service-1" interface="tns:Interface-1">
+        <wsp:PolicyReference URI="#Policy58"></wsp:PolicyReference>
+        <wsdl20:endpoint name="Endpoint-1A" binding="Binding-1A">
+            <wsp:PolicyReference URI="#Policy59"></wsp:PolicyReference>
+        </wsdl20:endpoint>
+        <wsdl20:endpoint name="Endpoint-1B" binding="Binding-1B">
+            <wsp:PolicyReference URI="#Policy60"></wsp:PolicyReference>
+        </wsdl20:endpoint>
+    </wsdl20:service>
+    
+    <wsdl20:service name="Service-2" interface="tns:Interface-2">
+        <wsp:PolicyReference URI="#Policy61"></wsp:PolicyReference>
+        <wsdl20:endpoint name="Endpoint-2A" binding="Binding-2A">
+            <wsp:PolicyReference URI="#Policy62"></wsp:PolicyReference>
+        </wsdl20:endpoint>
+        <wsdl20:endpoint name="Endpoint-2B" binding="Binding-2A">
+            <wsp:PolicyReference URI="#Policy63"></wsp:PolicyReference>
+        </wsdl20:endpoint>
+    </wsdl20:service>
+    
+</wsdl20:description>

Added: webservices/axis2/scratch/c/neethi/axis2c/neethi/test/policy1.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/test/policy1.xml?view=auto&rev=537698
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/test/policy1.xml (added)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/test/policy1.xml Sun May 13 20:41:04 2007
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+    xmlns:pa="http://ws-policy.example.com/assertion" >
+    <pa:Assertion1 marker="1"/>
+</wsp:Policy>

Added: webservices/axis2/scratch/c/neethi/axis2c/neethi/test/policy2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/test/policy2.xml?view=auto&rev=537698
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/test/policy2.xml (added)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/test/policy2.xml Sun May 13 20:41:04 2007
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+    xmlns:pa="http://ws-policy.example.com/assertion">
+    <pa:Assertion2 marker="2"/>
+</wsp:Policy>

Added: webservices/axis2/scratch/c/neethi/axis2c/neethi/test/policy3.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/test/policy3.xml?view=auto&rev=537698
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/test/policy3.xml (added)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/test/policy3.xml Sun May 13 20:41:04 2007
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+    xmlns:pa="http://ws-policy.example.com/assertion">
+    <pa:Assertion3 marker="3"/>
+</wsp:Policy>

Added: webservices/axis2/scratch/c/neethi/axis2c/neethi/test/test
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/test/test?view=auto&rev=537698
==============================================================================
Binary file - no diff available.

Propchange: webservices/axis2/scratch/c/neethi/axis2c/neethi/test/test
------------------------------------------------------------------------------
    svn:executable = *

Propchange: webservices/axis2/scratch/c/neethi/axis2c/neethi/test/test
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: webservices/axis2/scratch/c/neethi/axis2c/neethi/test/test-policy.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/test/test-policy.xml?view=auto&rev=537698
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/test/test-policy.xml (added)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/test/test-policy.xml Sun May 13 20:41:04 2007
@@ -0,0 +1,10 @@
+<wsp:Policy wsu:Id="Policy1">
+    <pa:Assertion1 marker="1"/>
+</wsp:Policy>
+    <wsp:Policy wsu:Id="Policy2">
+        <pa:Assertion2 marker="2"/>
+    </wsp:Policy>
+    <wsp:Policy wsu:Id="Policy3">
+        <pa:Assertion3 marker="3"/>
+    </wsp:Policy>
+

Added: webservices/axis2/scratch/c/neethi/axis2c/neethi/test/test.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/neethi/axis2c/neethi/test/test.c?view=auto&rev=537698
==============================================================================
--- webservices/axis2/scratch/c/neethi/axis2c/neethi/test/test.c (added)
+++ webservices/axis2/scratch/c/neethi/axis2c/neethi/test/test.c Sun May 13 20:41:04 2007
@@ -0,0 +1,204 @@
+#include <axiom.h>
+#include <axutil_utils.h>
+#include <axutil_env.h>
+#include <axutil_log_default.h>
+#include <axutil_error_default.h>
+#include <stdio.h>
+#include <axiom_xml_reader.h>
+#include <neethi_engine.h>
+
+
+axis2_status_t AXIS2_CALL
+om_node_serialize(
+    axiom_node_t *node,
+    const axutil_env_t *env);
+
+
+
+int main(int argc, char **argv)
+{
+    axutil_allocator_t *allocator = axutil_allocator_init (NULL);
+    axutil_error_t *error = axutil_error_create (allocator);
+    const axutil_env_t *env = axutil_env_create_with_error(allocator, error);
+
+    axiom_xml_reader_t *reader = NULL;
+    axiom_stax_builder_t *builder = NULL;
+    axiom_document_t *document = NULL;
+    axiom_node_t *root = NULL;
+    axiom_element_t *root_ele = NULL;
+
+    reader = axiom_xml_reader_create_for_file(env,argv[1],NULL);
+
+    if (!reader)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_CREATING_XML_STREAM_READER,
+                AXIS2_FAILURE);
+        printf("xml reader creation failed\n");
+        return 0;
+    }
+    
+    builder = axiom_stax_builder_create(env, reader);
+    if(!builder)
+    {
+        axiom_xml_reader_free(reader, env);
+        printf("Builder creation failed\n");
+        return 0;
+    }
+    document = axiom_stax_builder_get_document(builder, env);
+    if(!document)
+    {
+        axiom_stax_builder_free(builder, env);
+        printf("Document creation failed\n");
+        return 0;
+    }
+
+    /*root = axiom_document_get_root_element(document, env);*/
+    root = axiom_document_build_all(document, env);
+    if(!root)
+    {
+        axiom_stax_builder_free(builder, env);
+        return 0;
+    }
+
+    if(root)
+    {
+        if(axiom_node_get_node_type(root, env) == AXIOM_ELEMENT)
+        {
+            root_ele = (axiom_element_t*)axiom_node_get_data_element(root, env);
+            if(root_ele)
+            {
+                neethi_policy_t *neethi_policy = NULL;
+                neethi_policy = neethi_engine_get_policy(env,root,root_ele);    
+                if(!neethi_policy)
+                {
+                    printf("Policy Creation fails\n");
+                    return 0;
+                }
+                else
+                {
+                    axiom_node_t *s_node = NULL;
+                    s_node = neethi_engine_serialize(neethi_policy, env);
+                    if(!s_node)
+                    {
+                        printf("Serializing failed\n");
+                        return 0;
+                    }
+                    if(om_node_serialize(s_node, env)!=AXIS2_SUCCESS)
+                        return 0;
+                }
+            }
+        }
+    }
+    
+    printf("Successful\n");
+    return 0;
+
+}
+
+axis2_status_t AXIS2_CALL
+om_node_serialize(
+    axiom_node_t *node,
+    const axutil_env_t *env)
+{
+
+    axiom_output_t *om_output = NULL;
+    axiom_xml_writer_t *writer = NULL;
+    axis2_char_t *output_buffer = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+
+    writer = axiom_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0,
+                                    AXIS2_XML_PARSER_TYPE_BUFFER);
+    om_output = axiom_output_create(env, writer);
+
+    status = axiom_node_serialize(node, env , om_output);
+    if (status != AXIS2_SUCCESS)
+    {
+        printf("\naxiom_node_serialize failed\n");
+        return 0;
+    }
+    else
+        printf("\naxiom_node_serialize success\n");
+        /* end serializing stuff */
+
+    /*axiom_node_free_tree(node1, environment);*/
+    output_buffer = (axis2_char_t*)axiom_xml_writer_get_xml(writer, env);
+
+    printf("\nend test_om_serialize\n");
+
+}
+
+
+
+axutil_array_list_t *AXIS2_CALL
+load_policy_array(
+    int argc, 
+    char **argv,
+    const axutil_env_t *env)
+{
+    
+    axiom_xml_reader_t *reader = NULL;
+    axiom_stax_builder_t *builder = NULL;
+    axiom_document_t *document = NULL;
+    axiom_node_t *root = NULL;
+    axiom_element_t *root_ele = NULL;
+    int i = 0;    
+    axutil_array_list *arraylist = NULL;
+
+    arraylist = axutil_array_list_create(env, 0);
+
+    for(i=1; i<argc; i++)
+    {
+        reader = axiom_xml_reader_create_for_file(env,argv[i],NULL);
+
+        if (!reader)
+        {
+            AXIS2_ERROR_SET(env->error, AXIS2_ERROR_CREATING_XML_STREAM_READER,
+                    AXIS2_FAILURE);
+            printf("xml reader creation failed\n");
+            return NULL;
+        }
+
+        builder = axiom_stax_builder_create(env, reader);
+        if(!builder)
+        {
+            axiom_xml_reader_free(reader, env);
+            printf("Builder creation failed\n");
+            return NULL;
+        }
+        document = axiom_stax_builder_get_document(builder, env);
+        if(!document)
+        {
+            axiom_stax_builder_free(builder, env);
+            printf("Document creation failed\n");
+            return NULL;
+        }
+
+        /*root = axiom_document_get_root_element(document, env);*/
+        root = axiom_document_build_all(document, env);
+        if(!root)
+        {
+            axiom_stax_builder_free(builder, env);
+            return NULL;
+        }
+        if(root)
+        {
+            if(axiom_node_get_node_type(root, env) == AXIOM_ELEMENT)
+            {
+                root_ele = (axiom_element_t*)axiom_node_get_data_element(root, env);
+                if(root_ele)
+                {
+                    neethi_policy_t *neethi_policy = NULL;
+                    neethi_policy = neethi_engine_get_policy(env,root,root_ele);
+                    if(!neethi_policy)
+                    {
+                        printf("Policy Creation fails\n");
+                        return NULL;
+                    }
+                    axutil_array_list_add(arraylist, env, neethi_policy);
+                }
+            }
+        }
+    }
+    return arraylist;
+}
+



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org