Please use NodeFactory/Node APIs instead. For example,

        String location = 
ContributionLocationHelper.getContributionLocation(SampleClient.class);
        Node node = NodeFactory.newInstance().createNode(new Contribution("c1", 
location));
        
        node.start();

        SampleClient sampleClient = node.getService(SampleClient.class, 
"SampleClient");
        sampleClient.runSample();

Thanks,
Raymond


From: amit patel 
Sent: Thursday, December 03, 2009 4:20 PM
To: [email protected] 
Subject: tuscany 2 and SCADomain


I am using tuscany 2.0-M4 to run ram's sample from here

http://svn.apache.org/repos/asf/tuscany/sandbox/ramkumar/helloworld-ws-reference/

I can't find the SCADomain class, is it deprecated? what should I use now?
Is there an equivalent sample for tuscany 2?

public

class HelloWorldClient { 


public final static void main(String[] args) throws Exception { 
SCADomain scaDomain = SCADomain.newInstance(

"helloworldwsclient.composite"); 
HelloWorldService helloWorldService = scaDomain.getService(HelloWorldService.

class, "HelloWorldServiceComponent"); 

OMFactory fac = OMAbstractFactory.getOMFactory();

OMElement imageElement = fac.createOMElement(

"image", null); 

// Creating the Data Handler for the file. 
DataHandler dataHandler = 

new DataHandler(new FileDataSource("C:/attachedfile.jpg")); 

//create an OMText node with the above DataHandler and set optimized to true 
OMText textData = fac.createOMText(dataHandler, 

true); 
imageElement.addChild(textData); 


String value = helloWorldService.getGreetings(

"attachedfile.jpg", imageElement); 
System.

out.println(value); 

scaDomain.close();

}

}

Reply via email to