Reg: Asynchronous Webservice in BPEL
Hi, I'm trying to create a BPEL for asynchronous web service call. A snippet of it is shown below: !-Receive request from client -- receive createInstance=yes operation=initiate partnerLink=ApprovalProcessClient portType=ns1:approvalProcessPT variable=approvalProcessRequestMessage/ !-Asynchronous Web Service Invoke -- invoke inputVariable=asyncApprovalRequest operation=submitForApproval partnerLink=AsyncApprovalPartner portType=ns2:asyncApprovalServicePT correlations correlation initiate=yes pattern=request set=CS1/ /correlations /invoke !-Receive Response from Asynchronous Web Service invoked above -- receive operation=onResult partnerLink= AsyncApprovalPartner portType=ns1:asyncApprovalCallbackPT variable=asyncApprovalResponse correlations correlation initiate=no set=CS1/ /correlations /receive The first receive in the above BPEL snippet is called by a client and therefore I have declared it as a 'service' in componentType file. The invoke is for invoking an asynchronous web service operation. The portType of that I have declared as 'reference' in the componentType file. The second receive in the above BPEL snippet acts as a callback to receive response from an asynchronous web service. Where and How do I specify that this is a callback? Is there way of specifying callbacks in componentType file.? Thanks Regards Ashwini Kumar Jeksani CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
Re: How to use references using multiplicity=1..n with binding.ws or binding.rmi
On Wed, Apr 30, 2008 at 12:44 PM, [EMAIL PROTECTED] wrote: Hi Simon, I just created a Jira to keep track of this issue: https://issues.apache.org/jira/browse/TUSCANY-2281 Besides using multiplicity=1..n, the interface Crawler is also Conversational. As mentioned in document Java Common Annotations APIs, conversations are created when - a @Reference to a conversational service is injected - a call is made to CompositeContext.getServiceReference() and then a method of the service is called So the only way of having multiple conversations in parallel on the same Service from one client is to create multiple ServiceReferences. So if I use a injected reference, then I can not have multiple conversations on this reference. Or are there any other options to achieve this ? A workaround for my project could be - to use Factory classes for each Crawler. So in my client I could use a multiplicity reference to 1..n CrawlerFactories and in each CrawlerFactory a single 1..1 reference to a Crawler service. Then in the CrawlerFactory it would be possible to create ServiceReferences. - to simply don't use SCAs conversation mechanism but implement my own conversation handling. Any suggestions ? Bye, Daniel Hi Daniel Good question. The OASIS TC has proposed a solution to this issue ( http://www.osoa.org/jira/browse/JAVA-9) but this isn't part of the API we have implemented as we have taken the V1 API. Can you raise a JIRA for this as I can't see one already and at least in that way we can track it. Is it possible for you to inject the references you need. You can specify a reference with multiplicity as a collection, for example, from itest/references @Reference(name = dServiceReferences) public ListServiceReferenceDComponent dServiceReferences; Which is populated by component name=AComponent ... reference name=dServiceReferences target=DComponent DComponent1 / /component component name=DComponent implementation.java class=org.apache.tuscany.sca.itest.references.DComponentImpl / /component component name=DComponent1 implementation.java class=org.apache.tuscany.sca.itest.references.DComponentImpl / /component See the test for alternatives. Regards Simon Thanks Daniel for the JIRA. multiple conversations in parallel on the same Service from one client. Can I just check that this is a requirement in you scenario. I'm imagining that the effect you want is to have multiple ongoing crawl actions associated with a particular type of crawler. Sound right? Also what is the scope of the crawler controller component. Is it composite scoped? In the factory approach you suggest, would there be a factory for each type of crawler. So you would have an injected reference to get the factory reference from the multiplicity of factory references and then the factory would be responsible for having multiple conversations with the crawler. This would work I think but it doesn't sounds quite right. I probably don't quite understand the scenario properly. Can you say a little more about the the interactions between the crawler controller and the crawlers themselves. (the real answer of course is for us to fix the JIRA;-) Regards Simon
Re: Are there plans to provide bindging directly to mq?
On Wed, Apr 30, 2008 at 3:45 PM, Marian, Radu [EMAIL PROTECTED] wrote: In many cases it is more efficient to not rely on jms server at all. Instead a component can talk directly to an mq client via mq bindgings. Are there plans to have binding.mq suported in tuscany? Thanks, Radu Hi Radu I haven't seen anyone talking about it to date. Simon
Re: Reg: Asynchronous Webservice in BPEL
Ashwini Kumar Jeksani wrote: Hi, I'm trying to create a BPEL for asynchronous web service call. A snippet of it is shown below: !-Receive request from client -- receive createInstance=yes operation=initiate partnerLink=ApprovalProcessClient portType=ns1:approvalProcessPT variable=approvalProcessRequestMessage/ !-Asynchronous Web Service Invoke -- invoke inputVariable=asyncApprovalRequest operation=submitForApproval partnerLink=AsyncApprovalPartner portType=ns2:asyncApprovalServicePT correlations correlation initiate=yes pattern=request set=CS1/ /correlations /invoke !-Receive Response from Asynchronous Web Service invoked above -- receive operation=onResult partnerLink= AsyncApprovalPartner portType=ns1:asyncApprovalCallbackPT variable=asyncApprovalResponse correlations correlation initiate=no set=CS1/ /correlations /receive The first receive in the above BPEL snippet is called by a client and therefore I have declared it as a 'service' in componentType file. The invoke is for invoking an asynchronous web service operation. The portType of that I have declared as 'reference' in the componentType file. The second receive in the above BPEL snippet acts as a callback to receive response from an asynchronous web service. Where and How do I specify that this is a callback? Is there way of specifying callbacks in componentType file.? Thanks Regards Ashwini Kumar Jeksani Ashwini, ** WARNING - Long Post ** You're certainly going in the right direction here. One way of specifying that a callback interface is in use is to declare it in the SCDL files - in particular in the componentType file, using something like this: interface.java interface=services.invoicing.ComputePrice callbackInterface=services.invoicing.InvoiceCallback/ This isn't the only way of specifying the callback, at least for Java interfaces, since it is possible to use annotations within the interface files, such as: @Remotable @Callback(MyServiceCallback.class) public interface MyService { @OneWay void someMethod(String arg); } ...and... @Remotable public interface MyServiceCallback { void receiveResult(String result); } Note the @Callback annotation in the forward call interface, which points at the callback interface. However, there is nothing like this available in WSDL. Instead, a WSDL file can contain multiple service definitions (ie PortTypes) - and so a single WSDL can hold both the forward and callback interfaces, which might look something like this: wsdl:portType name=MyService wsdl:operation name=someMethod wsdl:input message=tns:someMethodRequest name=someMethodRequest/ /wsdl:operation /wsdl:portType wsdl:portType name=MyServiceCallback wsdl:operation name=receiveResult wsdl:input message=tns:receiveResultRequest name=receiveResultRequest/ wsdl:output message=tns:receiveResultResponse name=receiveResultResponse/ /wsdl:operation /wsdl:portType In the SCDL which references a WSDL like this, in the component type and in any relevant composite file, then it would look like this: interface.wsdl interface=http://simplecallback#wsdl.interface(MyService) callbackInterface=http://simplecallback#wsdl.interface(MyServiceCallback) / When you set up a component which uses Web services the SCDL will look something like this: component name=MyServiceComponent implementation.java class=simplecallback.MyServiceImpl / service name=MyService interface.wsdl interface=http://simplecallback#wsdl.interface(MyService) callbackInterface=http://simplecallback#wsdl.interface(MyServiceCallback)/ binding.ws wsdlElement=http://simplecallback#wsdl.port(MyServiceSoapService/MyServiceSoapPort)/ callback binding.ws wsdlElement=http://simplecallback#wsdl.port(MyServiceCallbackSoapService/MyServiceCallbackSoapPort)/ /callback /service /component Excuse the formatting - it does not fit well into the width limits. Of course, the WSDL that you produce will also have to have the BPEL PartnerLinkType elements pointing to the appropriate PortType elements. I think that's it... ...you can see an example of this in the simple-callback-ws sample in Tuscany. BTW, what I am working on right now is the code to eliminate the need to build the componentType file. The BPELDocumentProcessor code is bing modified to read the BPEL process file and also to follow the links to the WSDL files and to resolve the PartnerLink - PartnerLinkType - PortType chains. This will result in the generation of the component type interface definition as above, with a reference to the PortType for forward and callback interfaces. I should post some code in the next couple of days. Yours, Mike.
Re: wsdl reference question
Abraham Washington wrote: sorry, should have included the code. this is just the calculator-ws-webapp composite (which is below). i added this code: service name=CalculatorService promote=CalculatorServiceComponentbinding.ws//service which exposes the CalculatorService. but, now the wsdl has operations like: setAddService setDivideService i don't want to expose the methods to the outside world. is there a way around that ? Just put @Remotable on the CalculatorService interface. Without this, the class is introspected to derive the WSDL service definition. With this, only the interface will be introspected. Simon thx abe?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://sample; xmlns:sample=http://sample; name=Calculatorservice name=CalculatorService promote=CalculatorServiceComponentbinding.ws//servicecomponent name=CalculatorServiceComponent implementation.java class=calculator.CalculatorServiceImpl/ reference name=addService interface.java interface=calculator.AddService / binding.ws uri=http://localhost:8080/sample-calculator-ws-webapp/AddServiceComponent/ /reference reference name=subtractService target=SubtractServiceComponent/reference reference name=multiplyService target=MultiplyServiceComponent/reference reference name=divideService target=DivideServiceComponent/reference /component component name=AddServiceComponent implementation.java class=calculator.AddServiceImpl/ service name=AddService interface.java interface=calculator.AddService / binding.ws/ /service /component component name=SubtractServiceComponent implementation.java class=calculator.SubtractServiceImpl/ /component component name=MultiplyServiceComponent implementation.java class=calculator.MultiplyServiceImpl/ /component component name=DivideServiceComponent implementation.java class=calculator.DivideServiceImpl/ /component /composite - Original Message From: Mike Edwards [EMAIL PROTECTED] To: tuscany-user@ws.apache.org Sent: Wednesday, April 30, 2008 4:41:26 AM Subject: Re: wsdl reference question Abraham Washington wrote: hi all, i have a service that has a reference to another service.� so, in my impl class there's a setter method for the reference.�� when the app is deployed, the wsdl generates the setter method operation, thus making it available to be invoked (not a good thing).� is there a way around this ? thx abe Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ Hi Abe, Can you explain what your app is doing in some more detail - maybe post some code and the composite file? If you have declared a reference in your code, with a setter method, then I would expect the setter method to get called at runtime with the reference proxy for the target service that you configure in your composite file. For the setter method to get included in the WSDL generated for the service offered by the component, then: a) presumably you are not marking the service offered by the implementation code, so that the defaulting process is happening - you do this by using the @Service annotation b) also, I suspect that your class does not say something like public fooClass implements barInterface { ... } - since the default service generation will look at the barInterface to generate the WSDL for the service. If there is no implements clause then the SCA code has little to go on as to which methods should be included. In this case, as the SCA Java Client Implementation specification says: If none of the implemented interfaces is remotable, then by default the implementation offers a single service whose type is the implementation class. I recommend that you consider using one of the above techniques to control which class methods are used for the operations of the Service interface. Yours, Mike. Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it
[DAS] Are re ready for a DAS 1.0 release ?
Looks like we now have a good and stable DAS that went trough two beta releases. If the community thinks we are ready, I'd like to propose a 1.0 release of DAS that would depend on the latest SDO 1.1 release. Thoughts ? -- Luciano Resende Apache Tuscany Committer http://people.apache.org/~lresende http://lresende.blogspot.com/
RE: Reg: Asynchronous Webservice in BPEL
Thanks mike. That was very useful information, I will try to implement it and get back to you. Regarding the Test cases could you tell me if there is any standard format/template that we use in Tuscany for writing test cases. Thanks Regards Ashwini Kumar Jeksani -Original Message- From: Mike Edwards [mailto:[EMAIL PROTECTED] Sent: Thursday, May 01, 2008 5:19 PM To: tuscany-user@ws.apache.org Subject: Re: Reg: Asynchronous Webservice in BPEL Ashwini Kumar Jeksani wrote: Hi, I'm trying to create a BPEL for asynchronous web service call. A snippet of it is shown below: !-Receive request from client -- receive createInstance=yes operation=initiate partnerLink=ApprovalProcessClient portType=ns1:approvalProcessPT variable=approvalProcessRequestMessage/ !-Asynchronous Web Service Invoke -- invoke inputVariable=asyncApprovalRequest operation=submitForApproval partnerLink=AsyncApprovalPartner portType=ns2:asyncApprovalServicePT correlations correlation initiate=yes pattern=request set=CS1/ /correlations /invoke !-Receive Response from Asynchronous Web Service invoked above -- receive operation=onResult partnerLink= AsyncApprovalPartner portType=ns1:asyncApprovalCallbackPT variable=asyncApprovalResponse correlations correlation initiate=no set=CS1/ /correlations /receive The first receive in the above BPEL snippet is called by a client and therefore I have declared it as a 'service' in componentType file. The invoke is for invoking an asynchronous web service operation. The portType of that I have declared as 'reference' in the componentType file. The second receive in the above BPEL snippet acts as a callback to receive response from an asynchronous web service. Where and How do I specify that this is a callback? Is there way of specifying callbacks in componentType file.? Thanks Regards Ashwini Kumar Jeksani Ashwini, ** WARNING - Long Post ** You're certainly going in the right direction here. One way of specifying that a callback interface is in use is to declare it in the SCDL files - in particular in the componentType file, using something like this: interface.java interface=services.invoicing.ComputePrice callbackInterface=services.invoicing.InvoiceCallback/ This isn't the only way of specifying the callback, at least for Java interfaces, since it is possible to use annotations within the interface files, such as: @Remotable @Callback(MyServiceCallback.class) public interface MyService { @OneWay void someMethod(String arg); } ...and... @Remotable public interface MyServiceCallback { void receiveResult(String result); } Note the @Callback annotation in the forward call interface, which points at the callback interface. However, there is nothing like this available in WSDL. Instead, a WSDL file can contain multiple service definitions (ie PortTypes) - and so a single WSDL can hold both the forward and callback interfaces, which might look something like this: wsdl:portType name=MyService wsdl:operation name=someMethod wsdl:input message=tns:someMethodRequest name=someMethodRequest/ /wsdl:operation /wsdl:portType wsdl:portType name=MyServiceCallback wsdl:operation name=receiveResult wsdl:input message=tns:receiveResultRequest name=receiveResultRequest/ wsdl:output message=tns:receiveResultResponse name=receiveResultResponse/ /wsdl:operation /wsdl:portType In the SCDL which references a WSDL like this, in the component type and in any relevant composite file, then it would look like this: interface.wsdl interface=http://simplecallback#wsdl.interface(MyService) callbackInterface=http://simplecallback#wsdl.interface(MyServiceCallback) / When you set up a component which uses Web services the SCDL will look something like this: component name=MyServiceComponent implementation.java class=simplecallback.MyServiceImpl / service name=MyService interface.wsdl interface=http://simplecallback#wsdl.interface(MyService) callbackInterface=http://simplecallback#wsdl.interface(MyServiceCallback)/ binding.ws wsdlElement=http://simplecallback#wsdl.port(MyServiceSoapService/MyServiceSoapPort)/ callback binding.ws wsdlElement=http://simplecallback#wsdl.port(MyServiceCallbackSoapService/MyServiceCallbackSoapPort)/ /callback /service /component Excuse the formatting - it does not fit well into the width limits. Of course, the WSDL that you produce will also have to have the BPEL PartnerLinkType elements pointing to the appropriate PortType elements. I think that's it... ...you can see an example of this in the simple-callback-ws sample in Tuscany. BTW, what I am working on right now is the code to eliminate the need to build the componentType file. The
Re: Reg: Asynchronous Webservice in BPEL
Test cases are based on JUnit, you could use any existing one from iTest or iTest/bpel as an example. If you find issues or have questions, don't hesitate to ask. On Thu, May 1, 2008 at 9:01 PM, Ashwini Kumar Jeksani [EMAIL PROTECTED] wrote: Thanks mike. That was very useful information, I will try to implement it and get back to you. Regarding the Test cases could you tell me if there is any standard format/template that we use in Tuscany for writing test cases. Thanks Regards Ashwini Kumar Jeksani -Original Message- From: Mike Edwards [mailto:[EMAIL PROTECTED] Sent: Thursday, May 01, 2008 5:19 PM To: tuscany-user@ws.apache.org Subject: Re: Reg: Asynchronous Webservice in BPEL Ashwini Kumar Jeksani wrote: Hi, I'm trying to create a BPEL for asynchronous web service call. A snippet of it is shown below: !-Receive request from client -- receive createInstance=yes operation=initiate partnerLink=ApprovalProcessClient portType=ns1:approvalProcessPT variable=approvalProcessRequestMessage/ !-Asynchronous Web Service Invoke -- invoke inputVariable=asyncApprovalRequest operation=submitForApproval partnerLink=AsyncApprovalPartner portType=ns2:asyncApprovalServicePT correlations correlation initiate=yes pattern=request set=CS1/ /correlations /invoke !-Receive Response from Asynchronous Web Service invoked above -- receive operation=onResult partnerLink= AsyncApprovalPartner portType=ns1:asyncApprovalCallbackPT variable=asyncApprovalResponse correlations correlation initiate=no set=CS1/ /correlations /receive The first receive in the above BPEL snippet is called by a client and therefore I have declared it as a 'service' in componentType file. The invoke is for invoking an asynchronous web service operation. The portType of that I have declared as 'reference' in the componentType file. The second receive in the above BPEL snippet acts as a callback to receive response from an asynchronous web service. Where and How do I specify that this is a callback? Is there way of specifying callbacks in componentType file.? Thanks Regards Ashwini Kumar Jeksani Ashwini, ** WARNING - Long Post ** You're certainly going in the right direction here. One way of specifying that a callback interface is in use is to declare it in the SCDL files - in particular in the componentType file, using something like this: interface.java interface=services.invoicing.ComputePrice callbackInterface=services.invoicing.InvoiceCallback/ This isn't the only way of specifying the callback, at least for Java interfaces, since it is possible to use annotations within the interface files, such as: @Remotable @Callback(MyServiceCallback.class) public interface MyService { @OneWay void someMethod(String arg); } ...and... @Remotable public interface MyServiceCallback { void receiveResult(String result); } Note the @Callback annotation in the forward call interface, which points at the callback interface. However, there is nothing like this available in WSDL. Instead, a WSDL file can contain multiple service definitions (ie PortTypes) - and so a single WSDL can hold both the forward and callback interfaces, which might look something like this: wsdl:portType name=MyService wsdl:operation name=someMethod wsdl:input message=tns:someMethodRequest name=someMethodRequest/ /wsdl:operation /wsdl:portType wsdl:portType name=MyServiceCallback wsdl:operation name=receiveResult wsdl:input message=tns:receiveResultRequest name=receiveResultRequest/ wsdl:output message=tns:receiveResultResponse name=receiveResultResponse/ /wsdl:operation /wsdl:portType In the SCDL which references a WSDL like this, in the component type and in any relevant composite file, then it would look like this: interface.wsdl interface=http://simplecallback#wsdl.interface(MyService) callbackInterface=http://simplecallback#wsdl.interface(MyServiceCallback) / When you set up a component which uses Web services the SCDL will look something like this: component name=MyServiceComponent implementation.java class=simplecallback.MyServiceImpl / service name=MyService interface.wsdl interface=http://simplecallback#wsdl.interface(MyService) callbackInterface=http://simplecallback#wsdl.interface(MyServiceCallback)/ binding.ws wsdlElement=http://simplecallback#wsdl.port(MyServiceSoapService/MyServiceSoapPort)/ callback binding.ws wsdlElement=http://simplecallback#wsdl.port(MyServiceCallbackSoapService/MyServiceCallbackSoapPort)/ /callback /service /component Excuse the formatting - it does not fit well into the width limits. Of course, the WSDL that you produce will also have