Topic
1 reply Latest Post - ‏2013-02-05T16:42:19Z by SystemAdmin
SystemAdmin
SystemAdmin
126 Posts
ACCEPTED ANSWER

Pinned topic Are conversational services supported by WAS 8.5.0.1 with SCA 1.0?

‏2012-12-19T14:56:25Z |
Having defined:



package shop;

import org.osoa.sca.annotations.Conversational;
import org.osoa.sca.annotations.EndsConversation;
import org.osoa.sca.annotations.Remotable;

@Remotable
@Conversational
public interface ICart {

public void addProduct(String name, int quantity);

public void removeProduct(String name, int quantity);
public double calculatePrice();
@EndsConversation
public void reset();

}



package shop;

import java.util.ArrayList;
import java.util.List;

import org.osoa.sca.annotations.ConversationID;
import org.osoa.sca.annotations.Destroy;
import org.osoa.sca.annotations.Init;
import org.osoa.sca.annotations.Scope;
import org.osoa.sca.annotations.Service;

import data.Product;

@Scope(value="CONVERSATION")
@Service(interfaces={shop.ICart.class})
public class Cart implements ICart{

private List<Product> products=null;

@ConversationID
private String cardID;

@Init
public void initCart(){
products=new ArrayList<Product>();
System.out.println("Init "+cardID);
}

@Destroy
public void destroyCart(){
products=null;
System.out.println("Destroy "+cardID);
}

@Override
public void addProduct(String name, int quantity) {
Product p = new Product(name);
for(int i = 0;i<=quantity; i++)
products.add(p);
System.out.println("Add "quantity" product "name" to "+cardID);
}

@Override
public void removeProduct(String name, int quantity) {
for(int i=0; i<quantity;i++)
products.remove(new Product(name));
System.out.println("Remove "quantity" product "name" to "+cardID);
}

@Override
public double calculatePrice() {
double price=0.0;
for(Product p :products)
price +=p.getPrice();
return price;

}

@Override
public void reset() {
products.clear();
System.out.println("Reset "+cardID);

}

}

ShoppingCartComposite.composite

<?xml version="1.0" encoding="UTF-8"?>
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" autowire="false" name="ShoppingCartComposite" targetNamespace="http://demo.conversation">
<component name="ShoppingCart">
<implementation.java class="shop.Cart"/>
<service name="ICart">
<interface.java interface="shop.ICart"/>
<binding.ws/>
</service>
</component>
</composite>

sca.contribution.xml

<?xml version="1.0" encoding="UTF-8"?>
<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0">
<deployable composite="ns1:ShoppingCartComposite" xmlns:ns1="http://demo.conversation"></deployable>
</contribution>

I get the following error when I deploy to WAS 8.5.1::

12/19/12 15:45:21:334 CET] 0000008a WASLoggingMon E CWSOA1006E: The conversation is not supported on ICart.

Is WAS 8.5.0.1 supporting Conversational SCA 1.0 services?
Updated on 2013-02-05T16:42:19Z at 2013-02-05T16:42:19Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    126 Posts
    ACCEPTED ANSWER

    Re: Are conversational services supported by WAS 8.5.0.1 with SCA 1.0?

    ‏2013-02-05T16:42:19Z  in response to SystemAdmin
    Hello Lara,

    There is a list of unsupported SCA sepecification sections, and Conversational Interfaces is one of the unsupported ones. You can take a look at such list for WAS 8.5 here: http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/index.jsp?topic=%2Fcom.ibm.websphere.base.doc%2Fae%2Fcsca_spec_gaps.html