summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/tags/travelsample-1.0/contributions/policy-client
diff options
context:
space:
mode:
authornash <nash@13f79535-47bb-0310-9956-ffa450edef68>2010-06-10 20:27:31 +0000
committernash <nash@13f79535-47bb-0310-9956-ffa450edef68>2010-06-10 20:27:31 +0000
commit98eec492c08e491401841dd33e8392b41c1e6660 (patch)
treeaf1129e753a0923a51db744214be4bced2d694aa /sca-java-1.x/tags/travelsample-1.0/contributions/policy-client
parent9437c0186c353b9b379f92937421cd722d6f2c31 (diff)
Copy travelsample-1.0-RC3 tag as travelsample-1.0
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@953445 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-1.x/tags/travelsample-1.0/contributions/policy-client')
-rw-r--r--sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/build.xml33
-rw-r--r--sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/pom.xml107
-rw-r--r--sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/src/main/java/scatours/client/TestClient.java60
-rw-r--r--sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/src/main/resources/META-INF/sca-contribution.xml25
-rw-r--r--sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/src/main/resources/Payment.wsdl83
-rw-r--r--sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/src/main/resources/client.composite29
6 files changed, 337 insertions, 0 deletions
diff --git a/sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/build.xml b/sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/build.xml
new file mode 100644
index 0000000000..2a85f58a3f
--- /dev/null
+++ b/sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/build.xml
@@ -0,0 +1,33 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<project name="scatours-contribution-policy-client" default="compile">
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../common/target/scatours-contribution-common.jar"/>
+ </path>
+
+ <target name="wsdljava">
+ <antcall target="wsimport">
+ <param name="wsdlfile" value="Payment.wsdl"/>
+ <param name="javaclass" value="com/tuscanyscatours/payment/Payment.class"/>
+ <param name="package" value="com.tuscanyscatours.payment"/>
+ </antcall>
+ </target>
+</project>
diff --git a/sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/pom.xml b/sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/pom.xml
new file mode 100644
index 0000000000..8cb418405e
--- /dev/null
+++ b/sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/pom.xml
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours</artifactId>
+ <version>1.0</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <artifactId>scatours-contribution-policy-client</artifactId>
+ <name>Apache Tuscany SCA Tours Policy Client Contribution</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours-contribution-common</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.xml.ws</groupId>
+ <artifactId>jaxws-api</artifactId>
+ <version>2.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.xml.soap</groupId>
+ <artifactId>saaj-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>target/jaxws-source</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jaxws-maven-plugin</artifactId>
+ <version>1.12</version>
+ <executions>
+ <execution>
+ <id>payment</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>wsimport</goal>
+ </goals>
+ <configuration>
+ <packageName>com.tuscanyscatours.payment</packageName>
+ <wsdlDirectory>${basedir}/src/main/resources</wsdlDirectory>
+ <wsdlFiles>
+ <wsdlFile>Payment.wsdl</wsdlFile>
+ </wsdlFiles>
+ <sourceDestDir>${project.build.directory}/jaxws-source</sourceDestDir>
+ <verbose>false</verbose>
+ <xnocompile>true</xnocompile>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/src/main/java/scatours/client/TestClient.java b/sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/src/main/java/scatours/client/TestClient.java
new file mode 100644
index 0000000000..6f1243b103
--- /dev/null
+++ b/sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/src/main/java/scatours/client/TestClient.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package scatours.client;
+
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+import com.tuscanyscatours.payment.Payment;
+
+import com.tuscanyscatours.common.Book;
+import com.tuscanyscatours.common.TripItem;
+
+/**
+ * A client for calling payment and trip components directly. The components in this
+ * case are expected to have policy configuration associated with the in the
+ * composite files that define them
+ *
+ */
+@Service(Runnable.class)
+public class TestClient {
+ @Reference
+ protected Payment payment;
+
+ @Reference
+ protected Book tripBooking;
+
+ public TestClient() {
+ }
+
+ public void run() {
+ System.out.println("===============================================");
+ System.out.println("Test the loggin policy by calling the trip component");
+ TripItem tripItem =
+ new TripItem("1234", "5678", TripItem.TRIP, "FS1DEC06", "Florence and Siena pre-packaged tour", "FLR",
+ "06/12/09", "13/12/09", 450, "EUR", "http://localhost:8085/tbd");
+ System.out.println("Result = " + tripBooking.book(tripItem));
+ System.out.println("===============================================");
+ System.out.println("Test the basic authentication policy by calling the payment component");
+ System.out.println("TestClient - Successful Payment - Status = " + payment.makePaymentMember("c-0", 100.00f));
+ System.out.println("===============================================");
+ }
+}
diff --git a/sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..4300ce0dc0
--- /dev/null
+++ b/sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:client="http://client.scatours/">
+ <import.java package="payment" />
+ <import.java package="com.tuscanyscatours.common"/>
+ <deployable composite="client:Client" />
+</contribution>
diff --git a/sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/src/main/resources/Payment.wsdl b/sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/src/main/resources/Payment.wsdl
new file mode 100644
index 0000000000..2519d7642e
--- /dev/null
+++ b/sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/src/main/resources/Payment.wsdl
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions name="Payment"
+ targetNamespace="http://www.tuscanyscatours.com/Payment/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://www.tuscanyscatours.com/Payment/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
+ xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
+ <wsdl:types>
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.tuscanyscatours.com/Payment/"
+ xmlns:tns="http://www.tuscanyscatours.com/Payment/">
+
+ <xsd:complexType name="MakePaymentMemberType">
+ <xsd:sequence>
+ <xsd:element name="CustomerId" type="xsd:string"></xsd:element>
+ <xsd:element name="Amount" type="xsd:float"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:element name="makePaymentMember" type="tns:MakePaymentMemberType"/>
+
+ <xsd:complexType name="MakePaymentMemberResponseType">
+ <xsd:sequence>
+ <xsd:element name="Status" type="xsd:string"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:element name="makePaymentMemberResponse" type="tns:MakePaymentMemberResponseType"/>
+
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="MakePaymentMemberRequest">
+ <wsdl:part name="parameters" element="tns:makePaymentMember"></wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="MakePaymentMemberResponse">
+ <wsdl:part name="parameters" element="tns:makePaymentMemberResponse"></wsdl:part>
+ </wsdl:message>
+ <wsdl:portType name="Payment">
+ <wsdl:operation name="makePaymentMember">
+ <wsdl:input message="tns:MakePaymentMemberRequest"></wsdl:input>
+ <wsdl:output message="tns:MakePaymentMemberResponse"></wsdl:output>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="PaymentBinding" type="tns:Payment">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="makePaymentMember">
+ <soap:operation soapAction="http://www.tuscanyscatours.com/Payment/makePayment" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="PaymentService">
+ <wsdl:port name="PaymentPort" binding="tns:PaymentBinding">
+ <soap:address location="http://localhost:8083/Payment" />
+ </wsdl:port>
+ </wsdl:service>
+
+ <plnk:partnerLinkType name="PaymentLinkType">
+ <plnk:role name="forward" portType="tns:Payment"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions> \ No newline at end of file
diff --git a/sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/src/main/resources/client.composite b/sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/src/main/resources/client.composite
new file mode 100644
index 0000000000..5b632b4be2
--- /dev/null
+++ b/sca-java-1.x/tags/travelsample-1.0/contributions/policy-client/src/main/resources/client.composite
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://client.scatours/"
+ name="Client">
+
+ <component name="TestClient">
+ <implementation.java class="scatours.client.TestClient" />
+ <reference name="payment" target="Payment/Payment" />
+ <reference name="tripBooking" target="Trip/Book" />
+ </component>
+</composite>