[savara-commits] savara SVN: r639 - in branches/experimental/2.0.x/bundles: org.savara.wsdl/src/main/java/org/savara/wsdl/generator/impl and 7 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Sat Feb 5 11:52:54 EST 2011


Author: objectiser
Date: 2011-02-05 11:52:54 -0500 (Sat, 05 Feb 2011)
New Revision: 639

Added:
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/wsdl/generator/GeneratorTest.java
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ESBBroker_Broker_rpc_0.wsdl
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ESBBroker_Buyer_rpc_0.wsdl
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ESBBroker_CreditAgency_rpc_0.wsdl
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ESBBroker_SupplierQuoteEngine_rpc_0.wsdl
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ESBBroker_SupplierTxnProcessor_rpc_0.wsdl
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/PurchaseGoods_Buyer_rpc_0.wsdl
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/PurchaseGoods_CreditAgency_rpc_0.wsdl
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/PurchaseGoods_Store_rpc_0.wsdl
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ReqRespFault_Buyer_rpc_0.wsdl
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ReqRespFault_Seller_rpc_0.wsdl
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/testmodels/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/testmodels/contract/
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/testmodels/contract/ESBBroker.spr
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/testmodels/contract/PurchaseGoods.spr
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/testmodels/contract/ReqRespFault.spr
Modified:
   branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/java/org/savara/protocol/contract/generator/GeneratorTest.java
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/impl/WSDLGeneratorImpl.java
Log:
Added WSDL generation from protocol based contract test cases.

Modified: branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/java/org/savara/protocol/contract/generator/GeneratorTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/java/org/savara/protocol/contract/generator/GeneratorTest.java	2011-02-05 16:50:12 UTC (rev 638)
+++ branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/java/org/savara/protocol/contract/generator/GeneratorTest.java	2011-02-05 16:52:54 UTC (rev 639)
@@ -183,7 +183,7 @@
     				
     				if (url.getFile().indexOf("target/test-classes") != -1) {
     					f = new java.io.File(url.getFile().replaceFirst("target/test-classes","src/test/resources"));
-    				} if (url.getFile().indexOf("target/classes") != -1) {
+    				} else if (url.getFile().indexOf("target/classes") != -1) {
     					f = new java.io.File(url.getFile().replaceFirst("target/classes","src/test/resources"));
     				} else if (url.getFile().indexOf("classes") != -1) {
         				f = new java.io.File(url.getFile().replaceFirst("classes","src/test/resources"));

Modified: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/impl/WSDLGeneratorImpl.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/impl/WSDLGeneratorImpl.java	2011-02-05 16:50:12 UTC (rev 638)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/impl/WSDLGeneratorImpl.java	2011-02-05 16:52:54 UTC (rev 639)
@@ -172,6 +172,7 @@
 				ret.setQName(new javax.xml.namespace.QName(contract.getName()));
 			}
 			ret.setTargetNamespace(targetNamespace);
+			ret.addNamespace("tns", targetNamespace);
 			
 			// Set up namespace mappings
 			java.util.Iterator<Namespace> iter=contract.getNamespaces().iterator();

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/wsdl/generator/GeneratorTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/wsdl/generator/GeneratorTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/wsdl/generator/GeneratorTest.java	2011-02-05 16:52:54 UTC (rev 639)
@@ -0,0 +1,260 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+package org.savara.wsdl.generator;
+
+import javax.wsdl.Definition;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestResult;
+import junit.framework.TestSuite;
+
+import org.savara.contract.model.Contract;
+import org.scribble.common.logging.CachedJournal;
+import org.scribble.protocol.model.Role;
+import org.scribble.protocol.parser.antlr.ANTLRProtocolParser;
+import org.savara.protocol.contract.generator.ContractGenerator;
+import org.savara.protocol.contract.generator.ContractGeneratorFactory;
+import org.savara.wsdl.generator.soap.SOAPRPCWSDLBinding;
+
+public class GeneratorTest {
+
+    public static Test suite() {
+        TestSuite suite = new TestSuite("Protocol->WSDL Generator Tests");
+
+        suite.addTest(new ProtocolToWSDLTester("ESBBroker", "Broker"));
+        suite.addTest(new ProtocolToWSDLTester("ESBBroker", "Buyer"));     
+        suite.addTest(new ProtocolToWSDLTester("ESBBroker", "SupplierTxnProcessor"));
+        suite.addTest(new ProtocolToWSDLTester("ESBBroker", "CreditAgency"));
+        suite.addTest(new ProtocolToWSDLTester("ESBBroker", "SupplierQuoteEngine"));
+        
+        suite.addTest(new ProtocolToWSDLTester("PurchaseGoods", "Buyer"));
+        suite.addTest(new ProtocolToWSDLTester("PurchaseGoods", "CreditAgency"));
+        suite.addTest(new ProtocolToWSDLTester("PurchaseGoods", "Store"));
+        
+        suite.addTest(new ProtocolToWSDLTester("ReqRespFault", "Buyer"));
+        suite.addTest(new ProtocolToWSDLTester("ReqRespFault", "Seller"));
+        
+        return suite;
+    }
+    
+    protected static class ProtocolToWSDLTester extends TestCase {
+
+    	/**
+    	 * This constructor is initialized with the test
+    	 * name.
+    	 * 
+    	 * @param name The test name
+    	 * @param role The role
+    	 */
+    	public ProtocolToWSDLTester(String name,
+    						String role) {
+    		super(name+"@"+role);
+    		m_name = name;
+    		m_role = role;
+    	}
+    	
+    	/**
+    	 * This method runs the test.
+    	 * 
+    	 * @param result The test result
+    	 */
+    	public void run(TestResult result) {
+    		
+    		// Run test
+    		result.startTest(this);
+    		
+    		String filename="testmodels/contract/"+m_name+".spr";
+    		
+    		java.io.InputStream is=
+    			ClassLoader.getSystemResourceAsStream(filename);
+    		
+    		if (is == null) {
+    			result.addError(this,
+    					new Throwable("Unable to locate resource: "+filename));
+    		} else {			
+    			CachedJournal journal=new CachedJournal();
+    			
+    			org.scribble.protocol.model.ProtocolModel model=null;
+    			
+				ANTLRProtocolParser parser=new ANTLRProtocolParser();
+				parser.setAnnotationProcessor(new org.savara.protocol.parser.AnnotationProcessor());
+				
+    			try {
+    				model = parser.parse(is, journal, null);
+    			} catch(Exception e) {
+    				result.addError(this, new Throwable("Parsing choreography failed"));
+    			}
+    			
+    			if (model == null) {
+    				result.addError(this, new Throwable("Model is null"));
+    			} else {
+   					ContractGenerator cg=ContractGeneratorFactory.getContractGenerator();
+					if (cg != null) {
+						Contract contract=cg.generate(model.getProtocol(), null, new Role(m_role), journal);
+						
+						if (contract != null) {
+							
+							// Convert to WSDL
+							WSDLGenerator gen=WSDLGeneratorFactory.getWSDLGenerator();
+							
+							java.util.List<Definition> defns=gen.generate(contract, new SOAPRPCWSDLBinding());
+							
+							for (int i=0; i < defns.size(); i++) {
+								Definition defn=defns.get(i);
+								
+								try {
+									javax.wsdl.xml.WSDLWriter writer=
+										javax.wsdl.factory.WSDLFactory.newInstance().newWSDLWriter();
+	
+									java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream();
+									
+									writer.writeWSDL(defn, baos);
+									
+									byte[] b=baos.toByteArray();
+									
+									baos.close();
+									
+									checkResults(result, new String(b), "rpc", i);
+								} catch(Exception e) {
+									result.addError(this, e);
+								}
+							}
+						} else {
+							result.addError(this, new Throwable("No contract"));
+						}
+					}
+    			}
+    		}
+    		
+    		result.endTest(this);
+    	}
+    	
+    	/**
+    	 * This method checks the generated BPEL against a
+    	 * previously stored correct version.
+    	 * 
+    	 * @param result The test result
+    	 * @param bpel The BPEL
+    	 */
+    	protected void checkResults(TestResult result, String wsdl, String binding, int num) {
+    		boolean f_valid=false;
+
+    		String filename="results/wsdl/"+m_name+"_"+m_role+"_"+binding+"_"+num+".wsdl";
+    		
+    		java.io.InputStream is=
+    				ClassLoader.getSystemResourceAsStream(filename);
+    		
+    		if (is != null) {
+    			
+    			try {
+    				byte[] b=new byte[is.available()];
+    			
+    				is.read(b);
+    				
+    				is.close();
+    				
+    				String orig=new String(b);
+    				
+    				if (orig.equals(wsdl) == false) {
+    					result.addError(this,
+    							new Throwable("Generated WSDL does not match stored version"));
+    				} else {
+    					f_valid = true;
+    				}
+    			} catch(Exception e) {
+    				result.addError(this, e);
+    			}
+    		} else {
+    			result.addError(this,
+    					new Throwable("Resulting WSDL '"+filename+
+    							"' not found for comparison"));
+    		}
+    		
+    		if (f_valid == false) {
+    			String srcfile="testmodels/contract/"+m_name+".spr";
+    			
+    			java.net.URL url=ClassLoader.getSystemResource(srcfile);
+    			
+    			/*
+    			try {
+    				url = org.eclipse.core.runtime.FileLocator.toFileURL(url);
+    			} catch(Exception e) {
+    				e.printStackTrace();
+    			}
+    			*/
+    			
+    			if (url != null) {
+    				// URL will point to copy of test models in the classes folder, so need
+    				// to obtain reference back to source version
+    				java.io.File f=null;
+    				
+    				if (url.getFile().indexOf("target/test-classes") != -1) {
+    					f = new java.io.File(url.getFile().replaceFirst("target/test-classes","src/test/resources"));
+    				} else if (url.getFile().indexOf("target/classes") != -1) {
+    					f = new java.io.File(url.getFile().replaceFirst("target/classes","src/test/resources"));
+    				} else if (url.getFile().indexOf("classes") != -1) {
+        				f = new java.io.File(url.getFile().replaceFirst("classes","src/test/resources"));
+    				} else if (url.getFile().indexOf("bin") != -1) {						
+    					f = new java.io.File(url.getFile().replaceFirst("bin","src/test/resources"));
+    				} else {
+    					result.addError(this, new Exception("Could not locate results folder to record expected result"));
+    				}
+    				
+    				if (f != null && f.exists()) {
+    					f = f.getParentFile().getParentFile().getParentFile();
+    					
+    					java.io.File resultsDir=new java.io.File(f, "results/wsdl");
+    					
+    					if (resultsDir.exists() == false) {
+    						resultsDir.mkdirs();
+    					}
+    					
+    					java.io.File resultFile=new java.io.File(resultsDir,
+    							m_name+"_"+m_role+"_"+binding+"_"+num+".generated");
+    					
+    					//if (resultFile.exists() == false) {
+    						try {
+    							java.io.FileOutputStream fos=new java.io.FileOutputStream(resultFile);
+    							
+    							fos.write(wsdl.getBytes());
+    							
+    							fos.flush();
+    							fos.close();
+    							
+    						} catch(Exception e){
+    							result.addError(this, e);
+    						}
+    						/*
+    					} else {
+    						System.err.println("NOTE: Generated output '"+resultFile+
+    									"' already exists - not being overwritten");
+    					}
+    					*/
+    				} else {
+    					result.addError(this, new Throwable("Unable to obtain URL for model source '"+
+    							m_name+"': "+url));
+    				}
+    			}
+    		}
+    	}
+
+    	private String m_name=null;
+    	private String m_role=null;
+    }
+}

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ESBBroker_Broker_rpc_0.wsdl
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ESBBroker_Broker_rpc_0.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ESBBroker_Broker_rpc_0.wsdl	2011-02-05 16:52:54 UTC (rev 639)
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name="Broker" targetNamespace="http://www.pi4soa.org/ESBBroker/Broker" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.pi4soa.org/ESBBroker/Broker" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+  <wsdl:message name="rejectedFault">
+    <wsdl:part name="content" type="orderRejected">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="makeEnquiryRequest">
+    <wsdl:part name="content" type="enquiry">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="buyResponse">
+    <wsdl:part name="content" type="bookingReference">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="makeEnquiryResponse">
+    <wsdl:part name="content" type="quoteList">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="buyRequest">
+    <wsdl:part name="content" type="buy">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="cancelRequest">
+    <wsdl:part name="content" type="cancel">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:portType name="Broker">
+    <wsdl:operation name="makeEnquiry">
+      <wsdl:input message="tns:makeEnquiryRequest">
+    </wsdl:input>
+      <wsdl:output message="tns:makeEnquiryResponse">
+    </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="buy">
+      <wsdl:input message="tns:buyRequest">
+    </wsdl:input>
+      <wsdl:output message="tns:buyResponse">
+    </wsdl:output>
+      <wsdl:fault name="rejected" message="tns:rejectedFault">
+    </wsdl:fault>
+    </wsdl:operation>
+    <wsdl:operation name="cancel">
+      <wsdl:input message="tns:cancelRequest">
+    </wsdl:input>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="BrokerBinding" type="tns:Broker">
+    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="makeEnquiry">
+      <soap:operation soapAction="" style="rpc"/>
+      <wsdl:input>
+        <soap:body use="literal" namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal" namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="buy">
+      <soap:operation soapAction="" style="rpc"/>
+      <wsdl:input>
+        <soap:body use="literal" namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal" namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
+      </wsdl:output>
+      <wsdl:fault name="rejected">
+        <soap:fault name="rejected" use="literal" namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
+      </wsdl:fault>
+    </wsdl:operation>
+    <wsdl:operation name="cancel">
+      <soap:operation soapAction="" style="rpc"/>
+      <wsdl:input>
+        <soap:body use="literal" namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
+      </wsdl:input>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="BrokerService">
+    <wsdl:port name="BrokerPort" binding="tns:BrokerBinding">
+      <soap:address location="http://localhost:8080/BrokerService/BrokerPort"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ESBBroker_Buyer_rpc_0.wsdl
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ESBBroker_Buyer_rpc_0.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ESBBroker_Buyer_rpc_0.wsdl	2011-02-05 16:52:54 UTC (rev 639)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name="Buyer" targetNamespace="http://www.pi4soa.org/ESBBroker/Buyer" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.pi4soa.org/ESBBroker/Buyer" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+  <wsdl:service name="BuyerService">
+    <wsdl:port name="BuyerPort" binding="tns:BuyerBinding">
+      <soap:address location="http://localhost:8080/BuyerService/BuyerPort"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ESBBroker_CreditAgency_rpc_0.wsdl
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ESBBroker_CreditAgency_rpc_0.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ESBBroker_CreditAgency_rpc_0.wsdl	2011-02-05 16:52:54 UTC (rev 639)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name="CreditAgency" targetNamespace="http://www.pi4soa.org/ESBBroker/CreditAgency" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.pi4soa.org/ESBBroker/CreditAgency" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+  <wsdl:message name="checkCreditResponse">
+    <wsdl:part name="content" type="CreditCheckOk">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="checkCreditRequest">
+    <wsdl:part name="content" type="CreditCheckRequest">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="invalidCreditFault">
+    <wsdl:part name="content" type="CreditCheckInvalid">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:portType name="CreditAgency">
+    <wsdl:operation name="checkCredit">
+      <wsdl:input message="tns:checkCreditRequest">
+    </wsdl:input>
+      <wsdl:output message="tns:checkCreditResponse">
+    </wsdl:output>
+      <wsdl:fault name="invalidCredit" message="tns:invalidCreditFault">
+    </wsdl:fault>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="CreditAgencyBinding" type="tns:CreditAgency">
+    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="checkCredit">
+      <soap:operation soapAction="" style="rpc"/>
+      <wsdl:input>
+        <soap:body use="literal" namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal" namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
+      </wsdl:output>
+      <wsdl:fault name="invalidCredit">
+        <soap:fault name="invalidCredit" use="literal" namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
+      </wsdl:fault>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="CreditAgencyService">
+    <wsdl:port name="CreditAgencyPort" binding="tns:CreditAgencyBinding">
+      <soap:address location="http://localhost:8080/CreditAgencyService/CreditAgencyPort"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ESBBroker_SupplierQuoteEngine_rpc_0.wsdl
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ESBBroker_SupplierQuoteEngine_rpc_0.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ESBBroker_SupplierQuoteEngine_rpc_0.wsdl	2011-02-05 16:52:54 UTC (rev 639)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name="SupplierQuoteEngine" targetNamespace="http://www.pi4soa.org/ESBBroker/Supplier" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.pi4soa.org/ESBBroker/Supplier" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+  <wsdl:message name="getQuoteResponse">
+    <wsdl:part name="content" type="quote">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="getQuoteRequest">
+    <wsdl:part name="content" type="requestForQuote">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:portType name="SupplierQuoteEngine">
+    <wsdl:operation name="getQuote">
+      <wsdl:input message="tns:getQuoteRequest">
+    </wsdl:input>
+      <wsdl:output message="tns:getQuoteResponse">
+    </wsdl:output>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="SupplierQuoteEngineBinding" type="tns:SupplierQuoteEngine">
+    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="getQuote">
+      <soap:operation soapAction="" style="rpc"/>
+      <wsdl:input>
+        <soap:body use="literal" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="SupplierQuoteEngineService">
+    <wsdl:port name="SupplierQuoteEnginePort" binding="tns:SupplierQuoteEngineBinding">
+      <soap:address location="http://localhost:8080/SupplierQuoteEngineService/SupplierQuoteEnginePort"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ESBBroker_SupplierTxnProcessor_rpc_0.wsdl
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ESBBroker_SupplierTxnProcessor_rpc_0.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ESBBroker_SupplierTxnProcessor_rpc_0.wsdl	2011-02-05 16:52:54 UTC (rev 639)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name="SupplierTxnProcessor" targetNamespace="http://www.pi4soa.org/ESBBroker/Supplier" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.pi4soa.org/ESBBroker/Supplier" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+  <wsdl:message name="confirmRequest">
+    <wsdl:part name="content" type="orderConfirmed">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="confirmResponse">
+    <wsdl:part name="content" type="bookingReference">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:portType name="SupplierTxnProcessor">
+    <wsdl:operation name="confirm">
+      <wsdl:input message="tns:confirmRequest">
+    </wsdl:input>
+      <wsdl:output message="tns:confirmResponse">
+    </wsdl:output>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="SupplierTxnProcessorBinding" type="tns:SupplierTxnProcessor">
+    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="confirm">
+      <soap:operation soapAction="" style="rpc"/>
+      <wsdl:input>
+        <soap:body use="literal" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="SupplierTxnProcessorService">
+    <wsdl:port name="SupplierTxnProcessorPort" binding="tns:SupplierTxnProcessorBinding">
+      <soap:address location="http://localhost:8080/SupplierTxnProcessorService/SupplierTxnProcessorPort"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/PurchaseGoods_Buyer_rpc_0.wsdl
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/PurchaseGoods_Buyer_rpc_0.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/PurchaseGoods_Buyer_rpc_0.wsdl	2011-02-05 16:52:54 UTC (rev 639)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name="Buyer" targetNamespace="http://www.jboss.org/savara/examples" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.jboss.org/savara/examples" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+  <wsdl:service name="BuyerService">
+    <wsdl:port name="BuyerPort" binding="tns:BuyerBinding">
+      <soap:address location="http://localhost:8080/BuyerService/BuyerPort"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/PurchaseGoods_CreditAgency_rpc_0.wsdl
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/PurchaseGoods_CreditAgency_rpc_0.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/PurchaseGoods_CreditAgency_rpc_0.wsdl	2011-02-05 16:52:54 UTC (rev 639)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name="CreditAgency" targetNamespace="java:org.jboss.savara.examples.purchasing" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="java:org.jboss.savara.examples.purchasing" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+  <wsdl:message name="checkCreditRequest">
+    <wsdl:part name="content" type="tns:CreditCheckRequest">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="CreditCheckFailedFault">
+    <wsdl:part name="content" type="tns:CreditCheckInvalid">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="checkCreditResponse">
+    <wsdl:part name="content" type="tns:CreditCheckOk">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:portType name="CreditAgency">
+    <wsdl:operation name="checkCredit">
+      <wsdl:input message="tns:checkCreditRequest">
+    </wsdl:input>
+      <wsdl:output message="tns:checkCreditResponse">
+    </wsdl:output>
+      <wsdl:fault name="CreditCheckFailed" message="tns:CreditCheckFailedFault">
+    </wsdl:fault>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="CreditAgencyBinding" type="tns:CreditAgency">
+    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="checkCredit">
+      <soap:operation soapAction="" style="rpc"/>
+      <wsdl:input>
+        <soap:body use="literal" namespace="java:org.jboss.savara.examples.purchasing"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal" namespace="java:org.jboss.savara.examples.purchasing"/>
+      </wsdl:output>
+      <wsdl:fault name="CreditCheckFailed">
+        <soap:fault name="CreditCheckFailed" use="literal" namespace="java:org.jboss.savara.examples.purchasing"/>
+      </wsdl:fault>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="CreditAgencyService">
+    <wsdl:port name="CreditAgencyPort" binding="tns:CreditAgencyBinding">
+      <soap:address location="http://localhost:8080/CreditAgencyService/CreditAgencyPort"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/PurchaseGoods_Store_rpc_0.wsdl
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/PurchaseGoods_Store_rpc_0.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/PurchaseGoods_Store_rpc_0.wsdl	2011-02-05 16:52:54 UTC (rev 639)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name="Store" targetNamespace="http://www.jboss.org/examples/store" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.jboss.org/examples/store" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+  <wsdl:message name="BuyFailedFault">
+    <wsdl:part name="content" type="tns:BuyFailed">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="buyRequest">
+    <wsdl:part name="content" type="tns:BuyRequest">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="buyResponse">
+    <wsdl:part name="content" type="tns:BuyConfirmed">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:portType name="Store">
+    <wsdl:operation name="buy">
+      <wsdl:input message="tns:buyRequest">
+    </wsdl:input>
+      <wsdl:output message="tns:buyResponse">
+    </wsdl:output>
+      <wsdl:fault name="BuyFailed" message="tns:BuyFailedFault">
+    </wsdl:fault>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="StoreBinding" type="tns:Store">
+    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="buy">
+      <soap:operation soapAction="" style="rpc"/>
+      <wsdl:input>
+        <soap:body use="literal" namespace="http://www.jboss.org/examples/store"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal" namespace="http://www.jboss.org/examples/store"/>
+      </wsdl:output>
+      <wsdl:fault name="BuyFailed">
+        <soap:fault name="BuyFailed" use="literal" namespace="http://www.jboss.org/examples/store"/>
+      </wsdl:fault>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="StoreService">
+    <wsdl:port name="StorePort" binding="tns:StoreBinding">
+      <soap:address location="http://localhost:8080/StoreService/StorePort"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ReqRespFault_Buyer_rpc_0.wsdl
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ReqRespFault_Buyer_rpc_0.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ReqRespFault_Buyer_rpc_0.wsdl	2011-02-05 16:52:54 UTC (rev 639)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name="Buyer" targetNamespace="http://www.pi4soa.org/ReqRespFault/Buyer" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.pi4soa.org/ReqRespFault/Buyer" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+  <wsdl:service name="BuyerService">
+    <wsdl:port name="BuyerPort" binding="tns:BuyerBinding">
+      <soap:address location="http://localhost:8080/BuyerService/BuyerPort"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ReqRespFault_Seller_rpc_0.wsdl
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ReqRespFault_Seller_rpc_0.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/results/wsdl/ReqRespFault_Seller_rpc_0.wsdl	2011-02-05 16:52:54 UTC (rev 639)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name="Seller" targetNamespace="http://www.pi4soa.org/ReqRespFault/Seller" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.pi4soa.org/ReqRespFault/Seller" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+  <wsdl:message name="checkCreditRequest">
+    <wsdl:part name="content" type="CreditCheckRequest">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="checkCreditResponse">
+    <wsdl:part name="content" type="CreditCheckOk">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="insufficientCreditFault">
+    <wsdl:part name="content" type="CreditCheckInvalid">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:portType name="Seller">
+    <wsdl:operation name="checkCredit">
+      <wsdl:input message="tns:checkCreditRequest">
+    </wsdl:input>
+      <wsdl:output message="tns:checkCreditResponse">
+    </wsdl:output>
+      <wsdl:fault name="insufficientCredit" message="tns:insufficientCreditFault">
+    </wsdl:fault>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="SellerBinding" type="tns:Seller">
+    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="checkCredit">
+      <soap:operation soapAction="" style="rpc"/>
+      <wsdl:input>
+        <soap:body use="literal" namespace="http://www.pi4soa.org/ReqRespFault/Seller"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal" namespace="http://www.pi4soa.org/ReqRespFault/Seller"/>
+      </wsdl:output>
+      <wsdl:fault name="insufficientCredit">
+        <soap:fault name="insufficientCredit" use="literal" namespace="http://www.pi4soa.org/ReqRespFault/Seller"/>
+      </wsdl:fault>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="SellerService">
+    <wsdl:port name="SellerPort" binding="tns:SellerBinding">
+      <soap:address location="http://localhost:8080/SellerService/SellerPort"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/testmodels/contract/ESBBroker.spr
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/testmodels/contract/ESBBroker.spr	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/testmodels/contract/ESBBroker.spr	2011-02-05 16:52:54 UTC (rev 639)
@@ -0,0 +1,100 @@
+import xsd "bookingReference" as BookingReference, "buy" as Buy, "cancel" as Cancel, "CreditCheckRequest" as CreditInformation, "CreditCheckInvalid" as CreditInvalid, "CreditCheckOk" as CreditValid, "enquiry" as Enquiry, "orderConfirmed" as OrderConfirmed, "orderRejected" as OrderRejected, "quote" as Quote, "quoteList" as QuoteList, "requestForQuote" as RequestForQuote;
+[[ Namespace(name=http://www.pi4soa.org/ESBBroker/Broker,role=Broker) ]]
+[[ Namespace(name=http://www.pi4soa.org/ESBBroker/Buyer,role=Buyer) ]]
+[[ Namespace(name=http://www.pi4soa.org/ESBBroker/CreditAgency,role=CreditAgency) ]]
+[[ Namespace(name=http://www.pi4soa.org/ESBBroker/Supplier,role=Supplier) ]]
+[[ Type(prefix=tns,namespace=http://www.pi4soa.org/ESBBroker) ]]
+[[ Type(prefix=xsd,namespace=http://www.w3.org/2001/XMLSchema) ]]
+[[ Type(prefix=brk,namespace=http://www.pi4soa.org/ESBBroker/Broker) ]]
+[[ Type(prefix=byr,namespace=http://www.pi4soa.org/ESBBroker/Buyer) ]]
+[[ Type(prefix=cay,namespace=http://www.pi4soa.org/ESBBroker/CreditAgency) ]]
+[[ Type(prefix=spr,namespace=http://www.pi4soa.org/ESBBroker/Supplier) ]]
+[[ Namespace(name=http://www.pi4soa.org/ESBBroker/Supplier,role=SupplierTxnProcessor) ]]
+[[ Namespace(name=http://www.pi4soa.org/ESBBroker/Supplier,role=SupplierQuoteEngine) ]]
+protocol ESBBrokerProcess {
+	role Broker, Buyer, CreditAgency, Supplier;
+	[[ Interface(name={http://www.pi4soa.org/ESBBroker}BrokerBehavior) ]]
+	[[ Correlation(request=makeEnquiry) ]]
+	makeEnquiry(Enquiry) from Buyer to Broker;
+	repeat {
+		run RequestForQuote(Broker);
+	}
+	[[ Interface(name={http://www.pi4soa.org/ESBBroker}BrokerBehavior) ]]
+	[[ Correlation(replyTo=makeEnquiry) ]]
+	makeEnquiry(QuoteList) from Broker to Buyer;
+	choice from Buyer to Broker {
+		[[ Correlation(request=buy) ]]
+		buy(Buy):
+			role SupplierTxnProcessor;
+			[[ Interface(name={http://www.pi4soa.org/ESBBroker}CreditAgencyBehavior) ]]
+			[[ Correlation(request=checkCredit) ]]
+			checkCredit(CreditInformation) from Broker to CreditAgency;
+			choice from CreditAgency to Broker {
+				[[ Correlation(replyTo=checkCredit) ]]
+				checkCredit(CreditValid):
+					[[ Interface(name={http://www.pi4soa.org/ESBBroker}SupplierBehavior) ]]
+					[[ Correlation(request=confirm) ]]
+					confirm(OrderConfirmed) from Broker to SupplierTxnProcessor;
+					[[ Interface(name={http://www.pi4soa.org/ESBBroker}SupplierBehavior) ]]
+					[[ Correlation(replyTo=confirm) ]]
+					confirm(BookingReference) from SupplierTxnProcessor to Broker;
+					[[ Interface(name={http://www.pi4soa.org/ESBBroker}BrokerBehavior) ]]
+					[[ Correlation(replyTo=buy) ]]
+					buy(BookingReference) from Broker to Buyer;
+
+				[[ Fault(name=invalidCredit) ]]
+				[[ Correlation(replyTo=checkCredit) ]]
+				checkCredit(CreditInvalid):
+					[[ Fault(name=rejected) ]]
+					[[ Interface(name={http://www.pi4soa.org/ESBBroker}BrokerBehavior) ]]
+					[[ Correlation(replyTo=buy) ]]
+					buy(OrderRejected) from Broker to Buyer;
+
+			}
+
+		cancel(Cancel):
+
+	}
+	[[ Namespace(name=http://www.pi4soa.org/ESBBroker/Supplier,role=SupplierTxnProcessor) ]]
+	protocol CompleteTransaction(role Buyer, role Broker, role CreditAgency) {
+		role SupplierTxnProcessor;
+		[[ Interface(name={http://www.pi4soa.org/ESBBroker}BrokerBehavior) ]]
+		[[ Correlation(request=buy) ]]
+		buy(Buy) from Buyer to Broker;
+		[[ Interface(name={http://www.pi4soa.org/ESBBroker}CreditAgencyBehavior) ]]
+		[[ Correlation(request=checkCredit) ]]
+		checkCredit(CreditInformation) from Broker to CreditAgency;
+		choice from CreditAgency to Broker {
+			[[ Correlation(replyTo=checkCredit) ]]
+			checkCredit(CreditValid):
+				[[ Interface(name={http://www.pi4soa.org/ESBBroker}SupplierBehavior) ]]
+				[[ Correlation(request=confirm) ]]
+				confirm(OrderConfirmed) from Broker to SupplierTxnProcessor;
+				[[ Interface(name={http://www.pi4soa.org/ESBBroker}SupplierBehavior) ]]
+				[[ Correlation(replyTo=confirm) ]]
+				confirm(BookingReference) from SupplierTxnProcessor to Broker;
+				[[ Interface(name={http://www.pi4soa.org/ESBBroker}BrokerBehavior) ]]
+				[[ Correlation(replyTo=buy) ]]
+				buy(BookingReference) from Broker to Buyer;
+
+			[[ Fault(name=invalidCredit) ]]
+			[[ Correlation(replyTo=checkCredit) ]]
+			checkCredit(CreditInvalid):
+				[[ Fault(name=rejected) ]]
+				[[ Interface(name={http://www.pi4soa.org/ESBBroker}BrokerBehavior) ]]
+				[[ Correlation(replyTo=buy) ]]
+				buy(OrderRejected) from Broker to Buyer;
+
+		}
+	}
+	[[ Namespace(name=http://www.pi4soa.org/ESBBroker/Supplier,role=SupplierQuoteEngine) ]]
+	protocol RequestForQuote(role Broker) {
+		role SupplierQuoteEngine;
+		[[ Interface(name={http://www.pi4soa.org/ESBBroker}SupplierBehavior) ]]
+		[[ Correlation(request=getQuote) ]]
+		getQuote(RequestForQuote) from Broker to SupplierQuoteEngine;
+		[[ Interface(name={http://www.pi4soa.org/ESBBroker}SupplierBehavior) ]]
+		[[ Correlation(replyTo=getQuote) ]]
+		getQuote(Quote) from SupplierQuoteEngine to Broker;
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/testmodels/contract/PurchaseGoods.spr
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/testmodels/contract/PurchaseGoods.spr	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/testmodels/contract/PurchaseGoods.spr	2011-02-05 16:52:54 UTC (rev 639)
@@ -0,0 +1,35 @@
+import xsd "{http://www.jboss.org/examples/store}BuyConfirmed" as BuyConfirmed, "{http://www.jboss.org/examples/store}BuyFailed" as BuyFailed, "{http://www.jboss.org/examples/store}BuyRequest" as BuyRequest from "http://www.jboss.org/examples/store";
+import xsd "{java:org.jboss.savara.examples.purchasing}CreditCheckInvalid" as CreditCheckInvalid, "{java:org.jboss.savara.examples.purchasing}CreditCheckOk" as CreditCheckOk, "{java:org.jboss.savara.examples.purchasing}CreditCheckRequest" as CreditCheckRequest from "java:org.jboss.savara.examples.purchasing";
+import xsd "{http://www.w3.org/2001/XMLSchema}string" as IDType, "{http://www.w3.org/2001/XMLSchema}anyURI" as URITokenType from "http://www.w3.org/2001/XMLSchema";
+[[ Namespace(name=http://www.jboss.org/savara/examples,role=Buyer) ]]
+[[ Namespace(name=java:org.jboss.savara.examples.purchasing,role=CreditAgency) ]]
+[[ Namespace(name=http://www.jboss.org/examples/store,role=Store) ]]
+[[ Type(prefix=tns,namespace=http://www.jboss.org/savara/examples) ]]
+[[ Type(prefix=xsd,namespace=http://www.w3.org/2001/XMLSchema) ]]
+[[ Type(prefix=pur,namespace=java:org.jboss.savara.examples.purchasing) ]]
+[[ Type(prefix=sto,namespace=http://www.jboss.org/examples/store) ]]
+protocol PurchaseGoodsProcess {
+	role Buyer, CreditAgency, Store;
+	[[ Interface(name={http://www.jboss.org/examples/store}StoreInterface) ]]
+	[[ Correlation(request=buy) ]]
+	buy(BuyRequest) from Buyer to Store;
+	[[ Interface(name={java:org.jboss.savara.examples.purchasing}CreditAgencyInterface) ]]
+	[[ Correlation(request=checkCredit) ]]
+	checkCredit(CreditCheckRequest) from Store to CreditAgency;
+	choice from CreditAgency to Store {
+		[[ Correlation(replyTo=checkCredit) ]]
+		checkCredit(CreditCheckOk):
+			[[ Interface(name={http://www.jboss.org/examples/store}StoreInterface) ]]
+			[[ Correlation(replyTo=buy) ]]
+			buy(BuyConfirmed) from Store to Buyer;
+
+		[[ Fault(name=CreditCheckFailed) ]]
+		[[ Correlation(replyTo=checkCredit) ]]
+		checkCredit(CreditCheckInvalid):
+			[[ Fault(name=BuyFailed) ]]
+			[[ Interface(name={http://www.jboss.org/examples/store}StoreInterface) ]]
+			[[ Correlation(replyTo=buy) ]]
+			buy(BuyFailed) from Store to Buyer;
+
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/testmodels/contract/ReqRespFault.spr
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/testmodels/contract/ReqRespFault.spr	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/resources/testmodels/contract/ReqRespFault.spr	2011-02-05 16:52:54 UTC (rev 639)
@@ -0,0 +1,22 @@
+import xsd "CreditCheckRequest" as CreditInformation, "CreditCheckInvalid" as CreditInvalid, "CreditCheckOk" as CreditValid;
+[[ Namespace(name=http://www.pi4soa.org/ReqRespFault/Buyer,role=Buyer) ]]
+[[ Namespace(name=http://www.pi4soa.org/ReqRespFault/Seller,role=Seller) ]]
+[[ Type(prefix=tns,namespace=http://www.pi4soa.org/ReqRespFault) ]]
+[[ Type(prefix=xsd,namespace=http://www.w3.org/2001/XMLSchema) ]]
+[[ Type(prefix=byr,namespace=http://www.pi4soa.org/ReqRespFault/Buyer) ]]
+[[ Type(prefix=slr,namespace=http://www.pi4soa.org/ReqRespFault/Seller) ]]
+protocol ReqRespFaultProcess {
+	role Buyer, Seller;
+	[[ Interface(name={http://www.pi4soa.org/ReqRespFault}SellerBehavior) ]]
+	[[ Correlation(request=checkCredit) ]]
+	checkCredit(CreditInformation) from Buyer to Seller;
+	choice from Seller to Buyer {
+		[[ Correlation(replyTo=checkCredit) ]]
+		checkCredit(CreditValid):
+
+		[[ Fault(name=insufficientCredit) ]]
+		[[ Correlation(replyTo=checkCredit) ]]
+		checkCredit(CreditInvalid):
+
+	}
+}



More information about the savara-commits mailing list