From 037817ff789d4c9b0f66902fd3d103c4fa71a92a Mon Sep 17 00:00:00 2001 From: slaws Date: Mon, 18 Jan 2010 09:38:04 +0000 Subject: A launcher for the payment groovy contribution. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@900315 13f79535-47bb-0310-9956-ffa450edef68 --- .../launchers/payment-groovy/build.xml | 35 ++++++ .../travelsample/launchers/payment-groovy/pom.xml | 111 +++++++++++++++++++ .../tuscanyscatours/emailgateway/EmailGateway.java | 40 +++++++ .../emailgateway/EmailGatewayService.java | 71 +++++++++++++ .../tuscanyscatours/emailgateway/EmailType.java | 118 +++++++++++++++++++++ .../emailgateway/ObjectFactory.java | 79 ++++++++++++++ .../emailgateway/SendEmailResponseType.java | 62 +++++++++++ .../emailgateway/SendEmailType.java | 62 +++++++++++ .../tuscanyscatours/emailgateway/package-info.java | 2 + .../payment/MakePaymentMemberResponseType.java | 62 +++++++++++ .../payment/MakePaymentMemberType.java | 82 ++++++++++++++ .../com/tuscanyscatours/payment/ObjectFactory.java | 71 +++++++++++++ .../java/com/tuscanyscatours/payment/Payment.java | 43 ++++++++ .../tuscanyscatours/payment/PaymentService.java | 71 +++++++++++++ .../com/tuscanyscatours/payment/package-info.java | 2 + .../java/scatours/payment/PaymentLauncher.java | 47 ++++++++ 16 files changed, 958 insertions(+) create mode 100644 sandbox/travelsample/launchers/payment-groovy/build.xml create mode 100644 sandbox/travelsample/launchers/payment-groovy/pom.xml create mode 100644 sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java create mode 100644 sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/EmailGatewayService.java create mode 100644 sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/EmailType.java create mode 100644 sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/ObjectFactory.java create mode 100644 sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/SendEmailResponseType.java create mode 100644 sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/SendEmailType.java create mode 100644 sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/package-info.java create mode 100644 sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java create mode 100644 sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java create mode 100644 sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java create mode 100644 sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/Payment.java create mode 100644 sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/PaymentService.java create mode 100644 sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/package-info.java create mode 100644 sandbox/travelsample/launchers/payment-groovy/src/main/java/scatours/payment/PaymentLauncher.java (limited to 'sandbox/travelsample') diff --git a/sandbox/travelsample/launchers/payment-groovy/build.xml b/sandbox/travelsample/launchers/payment-groovy/build.xml new file mode 100644 index 0000000000..8889eb370c --- /dev/null +++ b/sandbox/travelsample/launchers/payment-groovy/build.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + diff --git a/sandbox/travelsample/launchers/payment-groovy/pom.xml b/sandbox/travelsample/launchers/payment-groovy/pom.xml new file mode 100644 index 0000000000..a4c56c19a5 --- /dev/null +++ b/sandbox/travelsample/launchers/payment-groovy/pom.xml @@ -0,0 +1,111 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + scatours + 1.0-SNAPSHOT + ../../pom.xml + 1.0-SNAPSHOT + scatours-launcher-payment-groovy + Apache Tuscany SCA Tours Payment Groovy Launcher + + + + + org.apache.tuscany.sca + scatours-util-launcher-common + ${pom.version} + provided + + + + org.apache.tuscany.sca + tuscany-node-api + ${tuscany.version} + + + + org.apache.tuscany.sca + tuscany-node-impl + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-script + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + ${tuscany.version} + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + ${tuscany.version} + runtime + + + + junit + junit + 4.5 + test + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + ../util/scatours-util-launcher-common.jar + + + true + ../lib/ + scatours.PaymentLauncher + + + + + + + diff --git a/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java new file mode 100644 index 0000000000..0e4e9726de --- /dev/null +++ b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java @@ -0,0 +1,40 @@ + +package com.tuscanyscatours.emailgateway; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.jws.WebService; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.ws.RequestWrapper; +import javax.xml.ws.ResponseWrapper; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebService(name = "EmailGateway", targetNamespace = "http://www.tuscanyscatours.com/EmailGateway/") +@XmlSeeAlso({ + ObjectFactory.class +}) +public interface EmailGateway { + + + /** + * + * @param email + * @return + * returns java.lang.String + */ + @WebMethod(action = "http://www.tuscanyscatours.com/EmailGateway/sendEmail") + @WebResult(name = "Status", targetNamespace = "") + @RequestWrapper(localName = "sendEmail", targetNamespace = "http://www.tuscanyscatours.com/EmailGateway/", className = "com.tuscanyscatours.emailgateway.SendEmailType") + @ResponseWrapper(localName = "sendEmailResponse", targetNamespace = "http://www.tuscanyscatours.com/EmailGateway/", className = "com.tuscanyscatours.emailgateway.SendEmailResponseType") + public String sendEmail( + @WebParam(name = "Email", targetNamespace = "") + EmailType email); + +} diff --git a/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/EmailGatewayService.java b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/EmailGatewayService.java new file mode 100644 index 0000000000..8f87855dd9 --- /dev/null +++ b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/EmailGatewayService.java @@ -0,0 +1,71 @@ + +package com.tuscanyscatours.emailgateway; + +import java.net.MalformedURLException; +import java.net.URL; +import java.util.logging.Logger; +import javax.xml.namespace.QName; +import javax.xml.ws.Service; +import javax.xml.ws.WebEndpoint; +import javax.xml.ws.WebServiceClient; +import javax.xml.ws.WebServiceFeature; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebServiceClient(name = "EmailGatewayService", targetNamespace = "http://www.tuscanyscatours.com/EmailGateway/", wsdlLocation = "file:/C:/simon/tuscany/travelsample/contributions/payment-groovy/src/main/resources/EmailGateway.wsdl") +public class EmailGatewayService + extends Service +{ + + private final static URL EMAILGATEWAYSERVICE_WSDL_LOCATION; + private final static Logger logger = Logger.getLogger(com.tuscanyscatours.emailgateway.EmailGatewayService.class.getName()); + + static { + URL url = null; + try { + URL baseUrl; + baseUrl = com.tuscanyscatours.emailgateway.EmailGatewayService.class.getResource("."); + url = new URL(baseUrl, "file:/C:/simon/tuscany/travelsample/contributions/payment-groovy/src/main/resources/EmailGateway.wsdl"); + } catch (MalformedURLException e) { + logger.warning("Failed to create URL for the wsdl Location: 'file:/C:/simon/tuscany/travelsample/contributions/payment-groovy/src/main/resources/EmailGateway.wsdl', retrying as a local file"); + logger.warning(e.getMessage()); + } + EMAILGATEWAYSERVICE_WSDL_LOCATION = url; + } + + public EmailGatewayService(URL wsdlLocation, QName serviceName) { + super(wsdlLocation, serviceName); + } + + public EmailGatewayService() { + super(EMAILGATEWAYSERVICE_WSDL_LOCATION, new QName("http://www.tuscanyscatours.com/EmailGateway/", "EmailGatewayService")); + } + + /** + * + * @return + * returns EmailGateway + */ + @WebEndpoint(name = "EmailGatewayPort") + public EmailGateway getEmailGatewayPort() { + return super.getPort(new QName("http://www.tuscanyscatours.com/EmailGateway/", "EmailGatewayPort"), EmailGateway.class); + } + + /** + * + * @param features + * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the features parameter will have their default values. + * @return + * returns EmailGateway + */ + @WebEndpoint(name = "EmailGatewayPort") + public EmailGateway getEmailGatewayPort(WebServiceFeature... features) { + return super.getPort(new QName("http://www.tuscanyscatours.com/EmailGateway/", "EmailGatewayPort"), EmailGateway.class, features); + } + +} diff --git a/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/EmailType.java b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/EmailType.java new file mode 100644 index 0000000000..25935d2303 --- /dev/null +++ b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/EmailType.java @@ -0,0 +1,118 @@ + +package com.tuscanyscatours.emailgateway; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for EmailType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="EmailType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="To" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="Title" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="Body" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "EmailType", propOrder = { + "to", + "title", + "body" +}) +public class EmailType { + + @XmlElement(name = "To", required = true) + protected String to; + @XmlElement(name = "Title", required = true) + protected String title; + @XmlElement(name = "Body", required = true) + protected String body; + + /** + * Gets the value of the to property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTo() { + return to; + } + + /** + * Sets the value of the to property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTo(String value) { + this.to = value; + } + + /** + * Gets the value of the title property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTitle() { + return title; + } + + /** + * Sets the value of the title property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTitle(String value) { + this.title = value; + } + + /** + * Gets the value of the body property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getBody() { + return body; + } + + /** + * Sets the value of the body property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setBody(String value) { + this.body = value; + } + +} diff --git a/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/ObjectFactory.java b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/ObjectFactory.java new file mode 100644 index 0000000000..f414bb3eb3 --- /dev/null +++ b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/ObjectFactory.java @@ -0,0 +1,79 @@ + +package com.tuscanyscatours.emailgateway; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the com.tuscanyscatours.emailgateway package. + *

An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _SendEmailResponse_QNAME = new QName("http://www.tuscanyscatours.com/EmailGateway/", "sendEmailResponse"); + private final static QName _SendEmail_QNAME = new QName("http://www.tuscanyscatours.com/EmailGateway/", "sendEmail"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.tuscanyscatours.emailgateway + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link SendEmailType } + * + */ + public SendEmailType createSendEmailType() { + return new SendEmailType(); + } + + /** + * Create an instance of {@link EmailType } + * + */ + public EmailType createEmailType() { + return new EmailType(); + } + + /** + * Create an instance of {@link SendEmailResponseType } + * + */ + public SendEmailResponseType createSendEmailResponseType() { + return new SendEmailResponseType(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link SendEmailResponseType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/EmailGateway/", name = "sendEmailResponse") + public JAXBElement createSendEmailResponse(SendEmailResponseType value) { + return new JAXBElement(_SendEmailResponse_QNAME, SendEmailResponseType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link SendEmailType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/EmailGateway/", name = "sendEmail") + public JAXBElement createSendEmail(SendEmailType value) { + return new JAXBElement(_SendEmail_QNAME, SendEmailType.class, null, value); + } + +} diff --git a/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/SendEmailResponseType.java b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/SendEmailResponseType.java new file mode 100644 index 0000000000..6d366b7554 --- /dev/null +++ b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/SendEmailResponseType.java @@ -0,0 +1,62 @@ + +package com.tuscanyscatours.emailgateway; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for SendEmailResponseType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="SendEmailResponseType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Status" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "SendEmailResponseType", propOrder = { + "status" +}) +public class SendEmailResponseType { + + @XmlElement(name = "Status", required = true) + protected String status; + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatus(String value) { + this.status = value; + } + +} diff --git a/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/SendEmailType.java b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/SendEmailType.java new file mode 100644 index 0000000000..cc8e15366c --- /dev/null +++ b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/SendEmailType.java @@ -0,0 +1,62 @@ + +package com.tuscanyscatours.emailgateway; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for SendEmailType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="SendEmailType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Email" type="{http://www.tuscanyscatours.com/EmailGateway/}EmailType"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "SendEmailType", propOrder = { + "email" +}) +public class SendEmailType { + + @XmlElement(name = "Email", required = true) + protected EmailType email; + + /** + * Gets the value of the email property. + * + * @return + * possible object is + * {@link EmailType } + * + */ + public EmailType getEmail() { + return email; + } + + /** + * Sets the value of the email property. + * + * @param value + * allowed object is + * {@link EmailType } + * + */ + public void setEmail(EmailType value) { + this.email = value; + } + +} diff --git a/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/package-info.java b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/package-info.java new file mode 100644 index 0000000000..2c2d603ada --- /dev/null +++ b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/package-info.java @@ -0,0 +1,2 @@ +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.tuscanyscatours.com/EmailGateway/") +package com.tuscanyscatours.emailgateway; diff --git a/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java new file mode 100644 index 0000000000..e5f3ef3cad --- /dev/null +++ b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java @@ -0,0 +1,62 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for MakePaymentMemberResponseType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="MakePaymentMemberResponseType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Status" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MakePaymentMemberResponseType", propOrder = { + "status" +}) +public class MakePaymentMemberResponseType { + + @XmlElement(name = "Status", required = true) + protected String status; + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatus(String value) { + this.status = value; + } + +} diff --git a/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java new file mode 100644 index 0000000000..ca94d86628 --- /dev/null +++ b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java @@ -0,0 +1,82 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for MakePaymentMemberType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="MakePaymentMemberType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="CustomerId" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="Amount" type="{http://www.w3.org/2001/XMLSchema}float"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MakePaymentMemberType", propOrder = { + "customerId", + "amount" +}) +public class MakePaymentMemberType { + + @XmlElement(name = "CustomerId", required = true) + protected String customerId; + @XmlElement(name = "Amount") + protected float amount; + + /** + * Gets the value of the customerId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCustomerId() { + return customerId; + } + + /** + * Sets the value of the customerId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCustomerId(String value) { + this.customerId = value; + } + + /** + * Gets the value of the amount property. + * + */ + public float getAmount() { + return amount; + } + + /** + * Sets the value of the amount property. + * + */ + public void setAmount(float value) { + this.amount = value; + } + +} diff --git a/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java new file mode 100644 index 0000000000..b069b2ba94 --- /dev/null +++ b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java @@ -0,0 +1,71 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the com.tuscanyscatours.payment package. + *

An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _MakePaymentMember_QNAME = new QName("http://www.tuscanyscatours.com/Payment/", "makePaymentMember"); + private final static QName _MakePaymentMemberResponse_QNAME = new QName("http://www.tuscanyscatours.com/Payment/", "makePaymentMemberResponse"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.tuscanyscatours.payment + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link MakePaymentMemberResponseType } + * + */ + public MakePaymentMemberResponseType createMakePaymentMemberResponseType() { + return new MakePaymentMemberResponseType(); + } + + /** + * Create an instance of {@link MakePaymentMemberType } + * + */ + public MakePaymentMemberType createMakePaymentMemberType() { + return new MakePaymentMemberType(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link MakePaymentMemberType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/Payment/", name = "makePaymentMember") + public JAXBElement createMakePaymentMember(MakePaymentMemberType value) { + return new JAXBElement(_MakePaymentMember_QNAME, MakePaymentMemberType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link MakePaymentMemberResponseType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/Payment/", name = "makePaymentMemberResponse") + public JAXBElement createMakePaymentMemberResponse(MakePaymentMemberResponseType value) { + return new JAXBElement(_MakePaymentMemberResponse_QNAME, MakePaymentMemberResponseType.class, null, value); + } + +} diff --git a/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/Payment.java b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/Payment.java new file mode 100644 index 0000000000..bbbd03d89a --- /dev/null +++ b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/Payment.java @@ -0,0 +1,43 @@ + +package com.tuscanyscatours.payment; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.jws.WebService; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.ws.RequestWrapper; +import javax.xml.ws.ResponseWrapper; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebService(name = "Payment", targetNamespace = "http://www.tuscanyscatours.com/Payment/") +@XmlSeeAlso({ + ObjectFactory.class +}) +public interface Payment { + + + /** + * + * @param amount + * @param customerId + * @return + * returns java.lang.String + */ + @WebMethod(action = "http://www.tuscanyscatours.com/Payment/makePayment") + @WebResult(name = "Status", targetNamespace = "") + @RequestWrapper(localName = "makePaymentMember", targetNamespace = "http://www.tuscanyscatours.com/Payment/", className = "com.tuscanyscatours.payment.MakePaymentMemberType") + @ResponseWrapper(localName = "makePaymentMemberResponse", targetNamespace = "http://www.tuscanyscatours.com/Payment/", className = "com.tuscanyscatours.payment.MakePaymentMemberResponseType") + public String makePaymentMember( + @WebParam(name = "CustomerId", targetNamespace = "") + String customerId, + @WebParam(name = "Amount", targetNamespace = "") + float amount); + +} diff --git a/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/PaymentService.java b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/PaymentService.java new file mode 100644 index 0000000000..a430175976 --- /dev/null +++ b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/PaymentService.java @@ -0,0 +1,71 @@ + +package com.tuscanyscatours.payment; + +import java.net.MalformedURLException; +import java.net.URL; +import java.util.logging.Logger; +import javax.xml.namespace.QName; +import javax.xml.ws.Service; +import javax.xml.ws.WebEndpoint; +import javax.xml.ws.WebServiceClient; +import javax.xml.ws.WebServiceFeature; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebServiceClient(name = "PaymentService", targetNamespace = "http://www.tuscanyscatours.com/Payment/", wsdlLocation = "file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl") +public class PaymentService + extends Service +{ + + private final static URL PAYMENTSERVICE_WSDL_LOCATION; + private final static Logger logger = Logger.getLogger(com.tuscanyscatours.payment.PaymentService.class.getName()); + + static { + URL url = null; + try { + URL baseUrl; + baseUrl = com.tuscanyscatours.payment.PaymentService.class.getResource("."); + url = new URL(baseUrl, "file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl"); + } catch (MalformedURLException e) { + logger.warning("Failed to create URL for the wsdl Location: 'file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl', retrying as a local file"); + logger.warning(e.getMessage()); + } + PAYMENTSERVICE_WSDL_LOCATION = url; + } + + public PaymentService(URL wsdlLocation, QName serviceName) { + super(wsdlLocation, serviceName); + } + + public PaymentService() { + super(PAYMENTSERVICE_WSDL_LOCATION, new QName("http://www.tuscanyscatours.com/Payment/", "PaymentService")); + } + + /** + * + * @return + * returns Payment + */ + @WebEndpoint(name = "PaymentPort") + public Payment getPaymentPort() { + return super.getPort(new QName("http://www.tuscanyscatours.com/Payment/", "PaymentPort"), Payment.class); + } + + /** + * + * @param features + * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the features parameter will have their default values. + * @return + * returns Payment + */ + @WebEndpoint(name = "PaymentPort") + public Payment getPaymentPort(WebServiceFeature... features) { + return super.getPort(new QName("http://www.tuscanyscatours.com/Payment/", "PaymentPort"), Payment.class, features); + } + +} diff --git a/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/package-info.java b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/package-info.java new file mode 100644 index 0000000000..acd208f5c9 --- /dev/null +++ b/sandbox/travelsample/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/package-info.java @@ -0,0 +1,2 @@ +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.tuscanyscatours.com/Payment/") +package com.tuscanyscatours.payment; diff --git a/sandbox/travelsample/launchers/payment-groovy/src/main/java/scatours/payment/PaymentLauncher.java b/sandbox/travelsample/launchers/payment-groovy/src/main/java/scatours/payment/PaymentLauncher.java new file mode 100644 index 0000000000..8eade64632 --- /dev/null +++ b/sandbox/travelsample/launchers/payment-groovy/src/main/java/scatours/payment/PaymentLauncher.java @@ -0,0 +1,47 @@ +/* + * 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.payment; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import com.tuscanyscatours.payment.Payment; + +public class PaymentLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = SCANodeFactory.newInstance().createSCANode(null, + locate("payment-groovy"), + locate("creditcard-payment-jaxb"), + locate("emailgateway")); + node.start(); + + SCAClient client = (SCAClient)node; + Payment payment = client.getService(Payment.class, "Payment"); + + System.out.println("Payment Script test"); + System.out.println("\nSuccessful Payment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f)); + + node.stop(); + } +} -- cgit v1.2.3