Hello,
Consider this interaction scenario in the same tuscany runtime.
SCA component A --> implementation.bpel
SCA component B --> implementation.java with binding.ws
If A invokes B, will it be a local java call? or a webservice
call.
In my understanding, BPEL can manage only webservice interactions.
I would like to know if SCA / tuscany does any extra step to avoid
this marshalling / unmarshalling overhead.
Regards,
Rupesh
Peng Han <[email protected]>
06/01/2009 03:50 PM
Please respond to
[email protected]
To
[email protected]
cc
Subject
Re: how to access another SCA Component in BPEL
Dear Resende:
Thanks a lot for your prompt response.
I changed the binding to jsoncrpc and get the following error:
Exception in thread "main" org.osoa.sca.ServiceRuntimeException:
java.lang.ClassCastException:
org.apache.tuscany.sca.interfacedef.wsdl.impl.WSDLInterfaceImpl cannot
be cast to org.apache.tuscany.sca.interfacedef.java.JavaInterface
at
org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADomain.java:220)
at
org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(SCADomain.java:63)
at helloworld.BPELClient.main(BPELClient.java:47)
Caused by: java.lang.ClassCastException:
org.apache.tuscany.sca.interfacedef.wsdl.impl.WSDLInterfaceImpl cannot
be cast to org.apache.tuscany.sca.interfacedef.java.JavaInterface
at
org.apache.tuscany.sca.binding.jsonrpc.provider.JSONRPCServiceBindingProvider.getTargetJavaClass(JSONRPCServiceBindingProvider.java:158)
at
org.apache.tuscany.sca.binding.jsonrpc.provider.JSONRPCServiceBindingProvider.start(JSONRPCServiceBindingProvider.java:91)
at
org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl$3.run(CompositeActivatorImpl.java:630)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl.start(CompositeActivatorImpl.java:628)
at
org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl.start(CompositeActivatorImpl.java:560)
at org.apache.tuscany.sca.node.impl.NodeImpl.start(NodeImpl.java:668)
at
org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.init(DefaultSCADomain.java:182)
at
org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.<init>(DefaultSCADomain.java:97)
at
org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADomain.java:182)
... 2 more
However, if I change the interface of BPEL component service from WS to
Java as follows:
<component name="BPELHelloWorldComponent">
<implementation.bpel process="hns:HelloWorld"/>
<service name="helloPartnerLink">
<interface.java
interface="org.apache.tuscany.implementation.bpel.example.helloworld.HelloPortType"/>
<tuscany:binding.jsonrpc uri="http://localhost:8080/services"/>
</service>
</component>
I will get a "null" return value. The code in javascript is as follows:
//@Reference
var mainRegReference = new Reference( "RegistrationReference" );
var mytext = "Hello again";
document.write(mytext);
function getWeather() {
var city = document.getElementById( "cityField" ).value;
var country = document.getElementById( "countryField" ).value;
var returnString = mainRegReference.hello("weather",
displayWeather);
}
function displayWeather(weather){
document.write(weather);
}
Best Regards
Peng
> On Sat, May 30, 2009 at 12:35 PM, Peng Han <[email protected]> wrote:
>
>> Dear Resende:
>>
>> I tried to access the links you provided but it seems that it was
broken.
>> Would you please check it?
>>
>>
>
>
https://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/itest/bpel/helloworld-reference/
>
>
>> Also I would like to ask whether it is possible to consume a service
>> provided by a .bpel implemented component
>> from a component implemented as widget and how. I tried to do it in the
>> following composite but the program
>> seems stuck when invoking the service.
>>
>
> You should be able to do this, using json-rpc binding.
> I responded to your other thread "Wiring a Widget Component and BPEL
> Component" with more details on how to try to accomplish this, but
> feel free to let me know if you are not making progress, and I can try
> to get some examples available.
>
>
>> Thanks a lot!
>>
>> the composite is as follows:
>>
>> <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
>>
>> xmlns:hns="
http://tuscany.apache.org/implementation/bpel/example/helloworld"
>> xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
name="helloworld"
>> targetNamespace="http://bpel">
>> <component name="BPELHelloWorldComponent">
>> <implementation.bpel process="hns:HelloWorld" />
>> <service name="helloPartnerLink">
>> <interface.wsdl
>>
>> interface="
http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl#wsdl.interface(HelloPortType)
"
>> />
>> <binding.ws uri="
http://localhost:8080/BPELHelloWorldComponent" />
>> </service>
>> </component>
>> <component name="RegistrationWidgetComponent">
>> <tuscany:implementation.widget location="Registration.html" />
>> <service name="Widget">
>> <tuscany:binding.http uri="http://localhost:8080/Registration
" />
>> </service>
>> <reference name="RegistrationReference">
>> <interface.wsdl
>>
>> interface="
http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl#wsdl.interface(HelloPortType)
"
>> />
>> <binding.ws uri="
http://localhost:8080/BPELHelloWorldComponent" />
>> </reference>
>> </component>
>> <service name="RegistrationService"
>> promote="RegistrationWidgetComponent/Widget" />
>> <wire source="RegistrationWidgetComponent/RegistrationReference"
>> target="BPELHelloWorldComponent/helloPartnerLink" />
>> </composite>
>>
>> Best Regards
>>
>> P.Han
>>
>>> This is demonstrated in the following bpel-reference iTest [1]. In
>>> this case, we have a grretings java component, and then a BPEL
>>> component that have a reference to this service as described in the
>>> composite below.
>>>
>>> <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
>>> targetNamespace="http://bpel"
>>> xmlns:hns="http://helloworld"
>>> name="helloworld">
>>>
>>> <component name="HelloWorldService">
>>> <implementation.bpel process="hns:HelloWorld"/>
>>> <reference name="greetingsPartnerLink"
>>> target="GreetingsServiceComponent"/>
>>> </component>
>>>
>>> <component name="GreetingsServiceComponent">
>>> <implementation.java class="greetings.GreetingsServiceImpl" />
>>> <service name="GreetingsService">
>>>
>>> <interface.wsdl
>>> interface="http://greetings#wsdl.interface(Greetings)" />
>>> </service>
>>> </component>
>>> </composite>
>>>
>>> Please let me know if you have questions or any problems running the
>>> sample test scenario.
>>>
>>>
>>> [1]
>>>
https://svn.apache.org/repos/asf/tuscany/java/sca/itest/bpel/helloworld-reference/
>>>
>>>
>>> On Thu, Aug 28, 2008 at 8:21 PM, xuhongbo <[email protected]> wrote:
>>>
>>>
>>>> Hi
>>>> Now I am using the sca provided build in bpel engine, and want
to
>>>> invoke another sca-component in the bpel process;
>>>> Though I could deploy the -java-implement sca component as
>>>> web-service by ws binding,then access it in bpel by import a wsdl
>>>> process.
>>>> This way ask for all sca-java-componet deployed as web-service, and
seems
>>>> too trival for deployment.
>>>> So does anyone know how to use a sca-reference in a BPEL
implement
>>>> component to access another sca component? Or some other mechanism
can
>>>> direct access sca-component? Typically sca component invoked by the
bpel
>>>> is
>>>> always implement as Java Language.
>>>>
>>>> Thanks
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>
>
>
>
DISCLAIMER:
"The information in this e-mail and any attachment is intended only for
the person to whom it is addressed and may contain confidential and/or
privileged material. If you have received this e-mail in error, kindly
contact the sender and destroy all copies of the original communication.
IBS makes no warranty, express or implied, nor guarantees the accuracy,
adequacy or completeness of the information contained in this email or any
attachment and is not liable for any errors, defects, omissions, viruses
or for resultant loss or damage, if any, direct or indirect."