A scenario very similar to what you have described below is
demonstrated in our helloworld-reference itest, and responding to your
question, in this case we are not going to make a webservice call, but
a local call, and you can even remove the binding.ws from the
component B service.

As for your previous question about bpel and widget, I'll see if I can
find some time to reproduce the sample scenario in my sandbox.

[1] 
https://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/itest/bpel/helloworld-reference

On Tue, Jun 2, 2009 at 11:01 PM, Rupesh M G
<rupesh.gopinat...@ibsplc.com> wrote:
>
> 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 <han.p...@fernuni-hagen.de>
>
> 06/01/2009 03:50 PM
>
> Please respond to
> u...@tuscany.apache.org
> To
> u...@tuscany.apache.org
> 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 <han.p...@gmail.com> 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 <x...@tongtech.com> 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."
>
>
>
>
>



-- 
Luciano Resende
Apache Tuscany, Apache PhotArk
http://people.apache.org/~lresende
http://lresende.blogspot.com/

Reply via email to