You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2010/03/21 18:05:01 UTC
svn commit: r925828 [2/3] - in
/tuscany/sca-java-1.x/trunk/tutorials/travelsample: contributions/
contributions/payment-java-callback/ contributions/payment-java-callback/src/
contributions/payment-java-callback/src/main/
contributions/payment-java-cal...
Added: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CardCompanyImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CardCompanyImpl.java?rev=925828&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CardCompanyImpl.java (added)
+++ tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CardCompanyImpl.java Sun Mar 21 17:05:00 2010
@@ -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 com.tuscanyscatours.payment.creditcard.impl;
+
+import org.osoa.sca.CallableReference;
+import org.osoa.sca.annotations.Service;
+
+import com.tuscanyscatours.payment.creditcard.CardCompany;
+import com.tuscanyscatours.payment.creditcard.CreditCardConfirm;
+import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType;
+
+
+@Service(CardCompany.class)
+public class CardCompanyImpl implements CardCompany {
+
+ public String makePayment(CreditCardDetailsType ccDetails,
+ float amount,
+ CallableReference<CreditCardConfirm> callbackRef){
+ // payment processing happens asynchronously
+ Thread app = new Thread(new AsycnhPaymentProcessing(callbackRef));
+ app.start();
+ return "OK";
+ }
+
+ class AsycnhPaymentProcessing implements Runnable {
+ CallableReference<CreditCardConfirm> callbackRef;
+
+ AsycnhPaymentProcessing(CallableReference<CreditCardConfirm> callbackRef){
+ this.callbackRef = callbackRef;
+ }
+ public void run() {
+ String paymentRef = "123456";
+
+ try {
+ Thread.sleep(1000);
+ } catch (Exception ex) {
+ // do nothing
+ }
+
+ callbackRef.getService().confirmPayment(paymentRef);
+ }
+ }
+}
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CardCompanyImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CardCompanyImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentCallbackImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentCallbackImpl.java?rev=925828&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentCallbackImpl.java (added)
+++ tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentCallbackImpl.java Sun Mar 21 17:05:00 2010
@@ -0,0 +1,78 @@
+/*
+ * 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 com.tuscanyscatours.payment.creditcard.impl;
+
+import org.osoa.sca.RequestContext;
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Context;
+import org.osoa.sca.annotations.Service;
+
+import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType;
+import com.tuscanyscatours.payment.creditcard.CreditCardPayment;
+import com.tuscanyscatours.payment.creditcard.CreditCardSecurity;
+
+@Service(CreditCardPayment.class)
+public class CreditCardPaymentCallbackImpl implements CreditCardPayment {
+
+ @Callback
+ protected CreditCardSecurity ccSecurity;
+
+ @Context
+ protected RequestContext rqContext;
+
+
+ public String authorize(CreditCardDetailsType card, float amount) {
+ if (amount > 1000) {
+ for (int i = 0; i < 3; i++) {
+ String pwd = null;
+ if (amount < 10000) {
+ // using injected callback proxy
+ pwd = ccSecurity.checkSecurity("Enter password");
+ } else {
+ // using request context to get callback proxy
+ CreditCardSecurity ccSecurity = rqContext.getCallback();
+ pwd = ccSecurity.checkSecurity("Enter password");
+ }
+
+ if (verifyPassword(card, pwd)) {
+ break;
+ }
+ if (i == 2) {
+ return "BadPassword";
+ }
+ }
+ }
+ makePayment(card, amount);
+ return "OK";
+ }
+
+ private boolean verifyPassword(CreditCardDetailsType card, String pw) {
+ if (pw.equals("abcxyz")){
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ private void makePayment(CreditCardDetailsType card, float amount) {
+ // payment processing
+ }
+
+}
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentCallbackImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentCallbackImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentConfirmImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentConfirmImpl.java?rev=925828&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentConfirmImpl.java (added)
+++ tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentConfirmImpl.java Sun Mar 21 17:05:00 2010
@@ -0,0 +1,48 @@
+/*
+ * 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 com.tuscanyscatours.payment.creditcard.impl;
+
+import org.osoa.sca.CallableReference;
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+import com.tuscanyscatours.payment.creditcard.CardCompany;
+import com.tuscanyscatours.payment.creditcard.CreditCardConfirm;
+import com.tuscanyscatours.payment.creditcard.CreditCardDetailsType;
+import com.tuscanyscatours.payment.creditcard.CreditCardPaymentConfirm;
+
+@Service(CreditCardPaymentConfirm.class)
+public class CreditCardPaymentConfirmImpl implements CreditCardPaymentConfirm {
+
+ @Callback
+ protected CallableReference<CreditCardConfirm> callbackRef;
+
+ @Reference
+ protected CardCompany cardCompany;
+
+ public String authorize(CreditCardDetailsType card,
+ float amount) {
+ cardCompany.makePayment(card, amount, callbackRef);
+ return "InProgress";
+ }
+
+
+}
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentConfirmImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/creditcard/impl/CreditCardPaymentConfirmImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/CreditCardSecurityImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/CreditCardSecurityImpl.java?rev=925828&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/CreditCardSecurityImpl.java (added)
+++ tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/CreditCardSecurityImpl.java Sun Mar 21 17:05:00 2010
@@ -0,0 +1,38 @@
+/*
+ * 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 com.tuscanyscatours.payment.impl;
+
+import org.osoa.sca.annotations.Service;
+
+import com.tuscanyscatours.payment.creditcard.CreditCardSecurity;
+
+/**
+ * The payment implementation
+ */
+@Service(CreditCardSecurity.class)
+public class CreditCardSecurityImpl implements CreditCardSecurity {
+
+ public String checkSecurity(String securityPrompt) {
+ System.out.println("Extra securiy - " + securityPrompt);
+ System.out.println("password = abcxyz");
+ return "abcxyz";
+ }
+
+}
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/CreditCardSecurityImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/CreditCardSecurityImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackIDImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackIDImpl.java?rev=925828&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackIDImpl.java (added)
+++ tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackIDImpl.java Sun Mar 21 17:05:00 2010
@@ -0,0 +1,90 @@
+/*
+ * 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 com.tuscanyscatours.payment.impl;
+
+import org.osoa.sca.RequestContext;
+import org.osoa.sca.ServiceReference;
+import org.osoa.sca.annotations.Context;
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+import com.tuscanyscatours.customer.Customer;
+import com.tuscanyscatours.customer.CustomerNotFoundException;
+import com.tuscanyscatours.customer.CustomerRegistry;
+import com.tuscanyscatours.emailgateway.EmailGateway;
+import com.tuscanyscatours.payment.Payment;
+import com.tuscanyscatours.payment.creditcard.AuthorizeFault_Exception;
+import com.tuscanyscatours.payment.creditcard.CreditCardPayment;
+import com.tuscanyscatours.payment.creditcard.CreditCardSecurity;
+
+/**
+ * The payment implementation
+ */
+@Service(Payment.class)
+public class PaymentCallbackIDImpl implements Payment,
+ CreditCardSecurity {
+
+ @Reference
+ protected CustomerRegistry customerRegistry;
+
+ @Reference(name="creditCardPayment")
+ protected ServiceReference<CreditCardPayment> cpRef;
+;
+
+ @Reference
+ protected EmailGateway emailGateway;
+
+ @Property
+ protected float transactionFee = 0.01f;
+
+ @Context
+ protected RequestContext rqContext;
+
+ public String makePaymentMember(String customerId, float amount) {
+ try {
+ Customer customer = customerRegistry.getCustomer(customerId);
+ String auditID = "987654321";
+ cpRef.setCallbackID(auditID);
+ String status = cpRef.getService().authorize(customer.getCreditCard(), amount + transactionFee);
+ emailGateway.sendEmail("order@tuscanyscatours.com",
+ customer.getEmail(),
+ "Status for your payment",
+ customer + " >>> Status = " + status);
+ return status;
+ } catch (CustomerNotFoundException ex) {
+ return "Payment failed due to " + ex.getMessage();
+ } catch (AuthorizeFault_Exception e) {
+ return e.getFaultInfo().getErrorCode();
+ } catch (Throwable t) {
+ return "Payment failed due to system error " + t.getMessage();
+ }
+ }
+
+ public String checkSecurity(String securityPrompt) {
+ System.out.println("Extra securiy - " + securityPrompt);
+ System.out.println("password = abcxyz");
+ Object cbID = rqContext.getServiceReference().getCallbackID();
+ System.out.println("callback ID = " + cbID);
+
+ return "abcxyz";
+ }
+
+}
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackIDImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackIDImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackImpl.java?rev=925828&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackImpl.java (added)
+++ tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackImpl.java Sun Mar 21 17:05:00 2010
@@ -0,0 +1,78 @@
+/*
+ * 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 com.tuscanyscatours.payment.impl;
+
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+import com.tuscanyscatours.customer.Customer;
+import com.tuscanyscatours.customer.CustomerNotFoundException;
+import com.tuscanyscatours.customer.CustomerRegistry;
+import com.tuscanyscatours.emailgateway.EmailGateway;
+import com.tuscanyscatours.payment.Payment;
+import com.tuscanyscatours.payment.creditcard.AuthorizeFault_Exception;
+import com.tuscanyscatours.payment.creditcard.CreditCardPayment;
+import com.tuscanyscatours.payment.creditcard.CreditCardSecurity;
+
+/**
+ * The payment implementation
+ */
+@Service(Payment.class)
+public class PaymentCallbackImpl implements Payment,
+ CreditCardSecurity {
+
+ @Reference
+ protected CustomerRegistry customerRegistry;
+
+ @Reference
+ protected CreditCardPayment creditCardPayment;
+
+ @Reference
+ protected EmailGateway emailGateway;
+
+ @Property
+ protected float transactionFee = 0.01f;
+
+ public String makePaymentMember(String customerId, float amount) {
+ try {
+ Customer customer = customerRegistry.getCustomer(customerId);
+ String status = creditCardPayment.authorize(customer.getCreditCard(), amount + transactionFee);
+ emailGateway.sendEmail("order@tuscanyscatours.com",
+ customer.getEmail(),
+ "Status for your payment",
+ customer + " >>> Status = " + status);
+ return status;
+ } catch (CustomerNotFoundException ex) {
+ return "Payment failed due to " + ex.getMessage();
+ } catch (AuthorizeFault_Exception e) {
+ return e.getFaultInfo().getErrorCode();
+ } catch (Throwable t) {
+ return "Payment failed due to system error " + t.getMessage();
+ }
+ }
+
+ public String checkSecurity(String securityPrompt) {
+ System.out.println("Extra securiy - " + securityPrompt);
+ System.out.println("password = abcxyz");
+ return "abcxyz";
+ }
+
+}
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackRedirectImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackRedirectImpl.java?rev=925828&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackRedirectImpl.java (added)
+++ tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackRedirectImpl.java Sun Mar 21 17:05:00 2010
@@ -0,0 +1,83 @@
+/*
+ * 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 com.tuscanyscatours.payment.impl;
+
+import org.osoa.sca.ServiceReference;
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+import com.tuscanyscatours.customer.Customer;
+import com.tuscanyscatours.customer.CustomerNotFoundException;
+import com.tuscanyscatours.customer.CustomerRegistry;
+import com.tuscanyscatours.emailgateway.EmailGateway;
+import com.tuscanyscatours.payment.Payment;
+import com.tuscanyscatours.payment.creditcard.AuthorizeFault_Exception;
+import com.tuscanyscatours.payment.creditcard.CreditCardPayment;
+import com.tuscanyscatours.payment.creditcard.CreditCardSecurity;
+
+/**
+ * The payment implementation
+ */
+@Service(Payment.class)
+public class PaymentCallbackRedirectImpl implements Payment,
+ CreditCardSecurity {
+
+ @Reference
+ protected CustomerRegistry customerRegistry;
+
+ @Reference(name="creditCardPayment")
+ protected ServiceReference<CreditCardPayment> cpRef;
+
+ @Reference(name="creditCardSecurity")
+ protected ServiceReference<CreditCardSecurity> csRef;
+
+ @Reference
+ protected EmailGateway emailGateway;
+
+ @Property
+ protected float transactionFee = 0.01f;
+
+ public String makePaymentMember(String customerId, float amount) {
+ try {
+ Customer customer = customerRegistry.getCustomer(customerId);
+ cpRef.setCallback(csRef);
+ String status = cpRef.getService().authorize(customer.getCreditCard(), amount + transactionFee);
+ emailGateway.sendEmail("order@tuscanyscatours.com",
+ customer.getEmail(),
+ "Status for your payment",
+ customer + " >>> Status = " + status);
+ return status;
+ } catch (CustomerNotFoundException ex) {
+ return "Payment failed due to " + ex.getMessage();
+ } catch (AuthorizeFault_Exception e) {
+ return e.getFaultInfo().getErrorCode();
+ } catch (Throwable t) {
+ return "Payment failed due to system error " + t.getMessage();
+ }
+ }
+
+ public String checkSecurity(String securityPrompt) {
+ System.out.println("Extra securiy - " + securityPrompt);
+ System.out.println("password = abcxyz");
+ return "abcxyz";
+ }
+
+}
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackRedirectImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentCallbackRedirectImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentConfirmImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentConfirmImpl.java?rev=925828&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentConfirmImpl.java (added)
+++ tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentConfirmImpl.java Sun Mar 21 17:05:00 2010
@@ -0,0 +1,77 @@
+/*
+ * 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 com.tuscanyscatours.payment.impl;
+
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+import com.tuscanyscatours.customer.Customer;
+import com.tuscanyscatours.customer.CustomerNotFoundException;
+import com.tuscanyscatours.customer.CustomerRegistry;
+import com.tuscanyscatours.emailgateway.EmailGateway;
+import com.tuscanyscatours.payment.Payment;
+import com.tuscanyscatours.payment.creditcard.AuthorizeFault_Exception;
+import com.tuscanyscatours.payment.creditcard.CreditCardConfirm;
+import com.tuscanyscatours.payment.creditcard.CreditCardPayment;
+import com.tuscanyscatours.payment.creditcard.CreditCardPaymentConfirm;
+
+/**
+ * The payment implementation
+ */
+@Service(Payment.class)
+public class PaymentConfirmImpl implements Payment,
+ CreditCardConfirm {
+
+ @Reference
+ protected CustomerRegistry customerRegistry;
+
+ @Reference
+ protected CreditCardPaymentConfirm creditCardPayment;
+
+ @Reference
+ protected EmailGateway emailGateway;
+
+ @Property
+ protected float transactionFee = 0.01f;
+
+ public String makePaymentMember(String customerId, float amount) {
+ try {
+ Customer customer = customerRegistry.getCustomer(customerId);
+ String status = creditCardPayment.authorize(customer.getCreditCard(), amount + transactionFee);
+ emailGateway.sendEmail("order@tuscanyscatours.com",
+ customer.getEmail(),
+ "Status for your payment",
+ customer + " >>> Status = " + status);
+ return status;
+ } catch (CustomerNotFoundException ex) {
+ return "Payment failed due to " + ex.getMessage();
+ } catch (AuthorizeFault_Exception e) {
+ return e.getFaultInfo().getErrorCode();
+ } catch (Throwable t) {
+ return "Payment failed due to system error " + t.getMessage();
+ }
+ }
+
+ public void confirmPayment(String paymentRef) {
+ System.out.println("Pament ref is - " + paymentRef);
+ }
+
+}
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentConfirmImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/java/com/tuscanyscatours/payment/impl/PaymentConfirmImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/CreditCardPayment.wsdl
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/CreditCardPayment.wsdl?rev=925828&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/CreditCardPayment.wsdl (added)
+++ tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/CreditCardPayment.wsdl Sun Mar 21 17:05:00 2010
@@ -0,0 +1,132 @@
+<?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="CreditCardPayment"
+ targetNamespace="http://www.tuscanyscatours.com/CreditCardPayment/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://www.tuscanyscatours.com/CreditCardPayment/"
+ 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/CreditCardPayment/"
+ xmlns:tns="http://www.tuscanyscatours.com/CreditCardPayment/">
+
+ <xsd:element name="authorize">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="CreditCard" type="tns:CreditCardDetailsType"></xsd:element>
+ <xsd:element name="Amount" type="xsd:float"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="authorizeResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="Status" type="xsd:string"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:complexType name="CreditCardDetailsType">
+ <xsd:sequence>
+ <xsd:element name="CreditCardType" type="tns:CreditCardTypeType" minOccurs="0" />
+ <xsd:element name="CreditCardNumber" type="xsd:string" minOccurs="0" />
+ <xsd:element name="ExpMonth" type="xsd:int" minOccurs="0" />
+ <xsd:element name="ExpYear" type="xsd:int" minOccurs="0" />
+ <xsd:element name="CardOwner" type="tns:PayerType" minOccurs="0" />
+ <xsd:element name="CVV2" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:simpleType name="CreditCardTypeType">
+ <xsd:restriction base="xsd:token">
+ <xsd:enumeration value="Visa" />
+ <xsd:enumeration value="MasterCard" />
+ <xsd:enumeration value="Discover" />
+ <xsd:enumeration value="Amex" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ <xsd:complexType name="PayerType">
+ <xsd:sequence>
+ <xsd:element name="Name" type="xsd:string" />
+ <xsd:element name="Address" type="tns:AddressType" />
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="AddressType">
+ <xsd:sequence>
+ <xsd:element name="Street" type="xsd:string" />
+ <xsd:element name="City" type="xsd:string" />
+ <xsd:element name="State" type="xsd:string" />
+ <xsd:element name="ZipCode" type="xsd:string" />
+ <xsd:element name="HomePhone" type="xsd:string" />
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:element name="authorizeFault">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="errorCode" type="xsd:string"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="AuthorizeRequest">
+ <wsdl:part name="parameters" element="tns:authorize"></wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="AuthorizeResponse">
+ <wsdl:part name="parameters" element="tns:authorizeResponse"></wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="AuthorizeFault">
+ <wsdl:part name="parameters" element="tns:authorizeFault"></wsdl:part>
+ </wsdl:message>
+ <wsdl:portType name="CreditCardPayment">
+ <wsdl:operation name="authorize">
+ <wsdl:input message="tns:AuthorizeRequest"></wsdl:input>
+ <wsdl:output message="tns:AuthorizeResponse"></wsdl:output>
+ <wsdl:fault name="authorizationFailure" message="tns:AuthorizeFault"></wsdl:fault>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="CreditCardPaymentBinding" type="tns:CreditCardPayment">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="authorize">
+ <soap:operation soapAction="http://www.tuscanyscatours.com/CreditCardPayment/authorize" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ <wsdl:fault name="authorizationFailure">
+ <soap:fault name="authorizationFailure" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="CreditCardPaymentService">
+ <wsdl:port name="CreditCardPaymentPort" binding="tns:CreditCardPaymentBinding">
+ <soap:address location="http://localhost:8080/CreditCardPayment" />
+ </wsdl:port>
+ </wsdl:service>
+
+ <plnk:partnerLinkType name="CreditCardPaymentLinkType">
+ <plnk:role name="forward" portType="tns:CreditCardPayment"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions>
\ No newline at end of file
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/CreditCardPayment.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/CreditCardPayment.wsdl
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/CreditCardPayment.wsdl
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/META-INF/sca-contribution.xml?rev=925828&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/META-INF/sca-contribution.xml (added)
+++ tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/META-INF/sca-contribution.xml Sun Mar 21 17:05:00 2010
@@ -0,0 +1,24 @@
+<?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:scatours="http://tuscanyscatours.com/">
+ <export.java package="com.tuscanyscatours.payment" />
+ <deployable composite="scatours:payment" />
+</contribution>
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/Payment.wsdl
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/Payment.wsdl?rev=925828&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/Payment.wsdl (added)
+++ tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/Payment.wsdl Sun Mar 21 17:05:00 2010
@@ -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
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/Payment.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/Payment.wsdl
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/Payment.wsdl
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/definitions.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/definitions.xml?rev=925828&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/definitions.xml (added)
+++ tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/definitions.xml Sun Mar 21 17:05:00 2010
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * 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.
+-->
+<definitions xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:sca="http://www.osoa.org/xmlns/sca/1.0">
+
+ <!-- Policy Intents Defined by the SCA Runtime -->
+ <intent name="authorization" constrains="sca:implementation"/>
+ <intent name="managedTransaction" constrains="sca:implementation"/>
+ <intent name="managedTransaction.global"/>
+
+ <!-- Policy intents -->
+ <policySet name="ps1" provides="sca:authorization" appliesTo="sca:implementation.java"/>
+
+ <policySet name="ps2" provides="sca:managedTransaction.global" appliesTo="sca:implementation.java"/>
+
+</definitions>
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/definitions.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/definitions.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/definitions.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/payment.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/payment.composite?rev=925828&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/payment.composite (added)
+++ tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/payment.composite Sun Mar 21 17:05:00 2010
@@ -0,0 +1,118 @@
+<?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://tuscanyscatours.com/"
+ name="payment">
+
+ <!-- standard callbacks -->
+ <component name="Payment1">
+ <implementation.java class="com.tuscanyscatours.payment.impl.PaymentCallbackImpl" />
+ <service name="Payment">
+ <binding.ws uri="http://localhost:8081/Payment" />
+ <binding.sca />
+ </service>
+ <reference name="customerRegistry" target="CustomerRegistry" />
+ <reference name="creditCardPayment" target="CreditCardPayment"/>
+ <reference name="emailGateway" target="EmailGateway" />
+ <property name="transactionFee">0.02</property>
+ </component>
+
+ <component name="Payment2">
+ <implementation.java class="com.tuscanyscatours.payment.impl.PaymentCallbackImpl" />
+ <service name="Payment">
+ <binding.ws uri="http://localhost:8081/Payment" />
+ <binding.sca />
+ </service>
+ <reference name="customerRegistry" target="CustomerRegistry" />
+ <reference name="creditCardPayment" target="CreditCardPayment"/>
+ <reference name="emailGateway" target="EmailGateway" />
+ <property name="transactionFee">0.02</property>
+ </component>
+
+ <!-- callbacks passed as callable references -->
+ <component name="PaymentConfirm">
+ <implementation.java class="com.tuscanyscatours.payment.impl.PaymentConfirmImpl" />
+ <service name="Payment">
+ <binding.ws uri="http://localhost:8081/Payment" />
+ <binding.sca />
+ </service>
+ <reference name="customerRegistry" target="CustomerRegistry" />
+ <reference name="creditCardPayment" target="CreditCardPaymentConfirm"/>
+ <reference name="emailGateway" target="EmailGateway" />
+ <property name="transactionFee">0.02</property>
+ </component>
+
+ <component name="CreditCardPaymentConfirm">
+ <implementation.java class="com.tuscanyscatours.payment.creditcard.impl.CreditCardPaymentConfirmImpl" />
+ <reference name="cardCompany" target="CardCompany" />
+ </component>
+
+ <component name="CardCompany">
+ <implementation.java class="com.tuscanyscatours.payment.creditcard.impl.CardCompanyImpl" />
+ </component>
+
+ <!-- callback ID -->
+
+ <component name="PaymentCallbackID">
+ <implementation.java class="com.tuscanyscatours.payment.impl.PaymentCallbackIDImpl" />
+ <service name="Payment">
+ <binding.ws uri="http://localhost:8081/Payment" />
+ <binding.sca />
+ </service>
+ <reference name="customerRegistry" target="CustomerRegistry" />
+ <reference name="creditCardPayment" target="CreditCardPayment"/>
+ <reference name="emailGateway" target="EmailGateway" />
+ <property name="transactionFee">0.02</property>
+ </component>
+
+ <!-- callback Redirection -->
+
+ <component name="PaymentCallbackRedirect">
+ <implementation.java class="com.tuscanyscatours.payment.impl.PaymentCallbackRedirectImpl" />
+ <service name="Payment">
+ <binding.ws uri="http://localhost:8081/Payment" />
+ <binding.sca />
+ </service>
+ <reference name="customerRegistry" target="CustomerRegistry" />
+ <reference name="creditCardPayment" target="CreditCardPayment"/>
+ <reference name="creditCardSecurity" target="CreditCardSecurity"/>
+ <reference name="emailGateway" target="EmailGateway" />
+ <property name="transactionFee">0.02</property>
+ </component>
+
+ <component name="CreditCardSecurity">
+ <implementation.java class="com.tuscanyscatours.payment.impl.CreditCardSecurityImpl" />
+ </component>
+
+ <!-- component common to multiple scenarios -->
+
+ <component name="CustomerRegistry">
+ <implementation.java class="com.tuscanyscatours.customer.impl.CustomerRegistryImpl" />
+ </component>
+
+ <component name="CreditCardPayment">
+ <implementation.java class="com.tuscanyscatours.payment.creditcard.impl.CreditCardPaymentCallbackImpl" />
+ </component>
+
+ <component name="EmailGateway">
+ <implementation.java class="com.tuscanyscatours.emailgateway.impl.EmailGatewayImpl" />
+ </component>
+
+</composite>
\ No newline at end of file
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/payment.composite
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/payment.composite
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/main/resources/payment.composite
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/test/java/scatours/payment/PaymentTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/test/java/scatours/payment/PaymentTestCase.java?rev=925828&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/test/java/scatours/payment/PaymentTestCase.java (added)
+++ tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/test/java/scatours/payment/PaymentTestCase.java Sun Mar 21 17:05:00 2010
@@ -0,0 +1,103 @@
+/*
+ * 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 org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCAContribution;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import com.tuscanyscatours.payment.Payment;
+
+public class PaymentTestCase {
+ private static SCANode node;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ node =
+ SCANodeFactory.newInstance()
+ .createSCANode(null,
+ new SCAContribution("payment", "./target/classes"));
+ node.start();
+ }
+
+ @Test
+ public void testPayment() {
+ SCAClient client = (SCAClient)node;
+ Payment payment1 = client.getService(Payment.class, "Payment1");
+ Payment payment2 = client.getService(Payment.class, "Payment2");
+ Payment paymentConfirm = client.getService(Payment.class, "PaymentConfirm");
+ Payment paymentCallbackID = client.getService(Payment.class, "PaymentCallbackID");
+ Payment paymentCallbackRedirect = client.getService(Payment.class, "PaymentCallbackRedirect");
+
+ System.out.println("===================================================");
+ System.out.println("\n\nPayment1 under limit - Status = \n\n" + payment1.makePaymentMember("c-0", 100.00f));
+ System.out.println("===================================================");
+ System.out.println("\n\nPayment2 under limit - Status = \n\n" + payment2.makePaymentMember("c-0", 100.00f));
+ System.out.println("===================================================");
+ System.out.println("\n\nPayment1 over limit - Status = \n\n" + payment1.makePaymentMember("c-0", 1500.00f));
+ System.out.println("===================================================");
+ System.out.println("\n\nPayment2 over limit - Status = \n\n" + payment2.makePaymentMember("c-0", 1500.00f));
+ System.out.println("===================================================");
+ System.out.println("\n\nPayment2 using request context - Status = \n\n" + payment2.makePaymentMember("c-0", 20000.00f));
+ System.out.println("===================================================");
+ System.out.println("\n\nPaymentConfirm - Status = \n\n" + paymentConfirm.makePaymentMember("c-0", 20000.00f));
+ System.out.println("===================================================");
+
+ // wait for longer that the asynch payment processing waits.
+ try {
+ Thread.sleep(2000);
+ } catch (Exception ex) {
+ // do nothing
+ }
+
+ System.out.println("===================================================");
+ System.out.println("\n\nPaymentCallbackID - Status = \n\n" + paymentCallbackID.makePaymentMember("c-0", 20000.00f));
+ System.out.println("===================================================");
+ System.out.println("\n\nPaymentCallbackRedirect - Status = \n\n" + paymentCallbackRedirect.makePaymentMember("c-0", 20000.00f));
+ System.out.println("===================================================");
+
+
+ }
+
+ @Test
+ @Ignore
+ public void testWaitForInput() {
+ System.out.println("Press a key to end");
+ try {
+ System.in.read();
+ } catch (Exception ex) {
+ }
+ System.out.println("Shutting down");
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (node != null) {
+ node.stop();
+ node = null;
+ }
+ }
+
+}
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/test/java/scatours/payment/PaymentTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/payment-java-callback/src/test/java/scatours/payment/PaymentTestCase.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/pom.xml?rev=925828&r1=925827&r2=925828&view=diff
==============================================================================
--- tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/pom.xml (original)
+++ tuscany/sca-java-1.x/trunk/tutorials/travelsample/contributions/pom.xml Sun Mar 21 17:05:00 2010
@@ -83,6 +83,7 @@
<module>trip</module>
<module>scatours</module>
<module>payment-java</module>
+ <module>payment-java-callback</module>
<module>payment-java-policy</module>
<module>payment-spring</module>
<module>payment-spring-policy</module>
Added: tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/build.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/build.xml?rev=925828&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/build.xml (added)
+++ tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/build.xml Sun Mar 21 17:05:00 2010
@@ -0,0 +1,35 @@
+<!--
+ * 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-launcher-payment-java-callback" default="compile">
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/>
+ </path>
+
+ <target name="run">
+ <java classname="scatours.payment.PaymentLauncher" fork="true" failonerror="true">
+ <classpath>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <path refid="compile-path"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </java>
+ </target>
+</project>
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/build.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/build.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/build.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/pom.xml?rev=925828&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/pom.xml (added)
+++ tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/pom.xml Sun Mar 21 17:05:00 2010
@@ -0,0 +1,122 @@
+<?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-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-payment-java-callback</artifactId>
+ <name>Apache Tuscany SCA Tours Payment Java Callback Launcher</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours-util-launcher-common</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.1</version>
+ </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>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path>
+ </manifestEntries>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.payment.PaymentLauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java?rev=925828&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java (added)
+++ tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java Sun Mar 21 17:05:00 2010
@@ -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;
+
+
+/**
+ * <p>Java class for MakePaymentMemberResponseType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <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>
+ * </pre>
+ *
+ *
+ */
+@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;
+ }
+
+}
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java?rev=925828&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java (added)
+++ tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java Sun Mar 21 17:05:00 2010
@@ -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;
+
+
+/**
+ * <p>Java class for MakePaymentMemberType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <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>
+ * </pre>
+ *
+ *
+ */
+@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;
+ }
+
+}
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java?rev=925828&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java (added)
+++ tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java Sun Mar 21 17:05:00 2010
@@ -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.
+ * <p>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<MakePaymentMemberType> createMakePaymentMember(MakePaymentMemberType value) {
+ return new JAXBElement<MakePaymentMemberType>(_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<MakePaymentMemberResponseType> createMakePaymentMemberResponse(MakePaymentMemberResponseType value) {
+ return new JAXBElement<MakePaymentMemberResponseType>(_MakePaymentMemberResponse_QNAME, MakePaymentMemberResponseType.class, null, value);
+ }
+
+}
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/Payment.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/Payment.java?rev=925828&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/Payment.java (added)
+++ tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/Payment.java Sun Mar 21 17:05:00 2010
@@ -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);
+
+}
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/Payment.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/Payment.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/PaymentService.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/PaymentService.java?rev=925828&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/PaymentService.java (added)
+++ tuscany/sca-java-1.x/trunk/tutorials/travelsample/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/PaymentService.java Sun Mar 21 17:05:00 2010
@@ -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 <code>features</code> 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);
+ }
+
+}