Re: [Architecture] [BPS][BPMN] Extending Support to Implement SOAP Task to invoke SOAP Services

2016-06-28 Thread Natasha Wijesekara
Hi,

I was able to implement the SOAP extension for C4 by extending the Axis2
Service Client.

I re-factored and enhanced the existing REST extension for C4 and
introduced the PUT and DELETE methods for the REST extension.

To use the REST task in a BPMN process, I implemented a REST extension as
an Activiti designer extension to the developer studio. After adding the
REST extension I implemented to the Activiti designer extensions, the REST
task will appear as a separate task in the tools palette. The REST task in
the palette will have all the properties/fields as mentioned below in the
main config tab, the user has to only give the required values to the
respective fields.

The following fields are required. Both fixed values i.e. strings and
expressions can be given :


*Field name*


*Definition*

serviceURL

Rest Endpoint URL

method

HTTP method (GET , POST, PUT or DELETE)

outputVariable

Name of the variable to save response

basicAuthUsername

Username if the endpoints are secured

basicAuthPassword

Password for the username provided

input

Request payload

headers

header values in the format "headerName1:headerValue1,headerName2:header
Value2"

*Eg: *

*Content-Type:application/json,Accept:application/json*

When the process is started and reaches the REST task, the task acts as
Service task and invokes *org.wso2.carbon.bpmn.extensions.rest.RESTTask* (
which is given as the runtime delegate class* @Runtime(javaDelegateClass =
org.wso2.carbon.bpmn.extensions.rest.RESTTask)*) which takes in the
parameters, invokes the rest service ,handles and returns the response
 according to the parameters as given by the user.


​

Given below is an example on how the parameters are specified in the REST
task:

**

* *

* *

* ${serviceURL}*

* *

* *

* admin*

* *

* *

* admin*

* *

* *

* PUT*

* *

* *

* { "assignee": "Natasha", "description": "Changed from
PUT request"}*

* *

* *

* output*

* *

* *

*
Content-Type:application/json,Accept:application/json*

* *

* *

* *

To add the new extension which contains the rest and soap task extensions
for the Activiti designer, build [1] or download the jar file attached in
[2].

To add the extension to Activiti Designer so the new customization i.e. the
rest task and soap task are applied, follow the instructions given below :

Go to Eclipse > select Window > Preferences .

In the preferences screen, type user as keyword. You should see an option
to access the User Libraries in Eclipse in the Java section.

Select the User Libraries item and a tree view shows up to the right where
you can add libraries. You should see the default group where you can add
extensions to Activiti Designer (depending on your Eclipse installation,
you might see several others as well).

Select the Activiti Designer Extensions group and add the extension jar as
an external jar to Activiti. After completing this, the preferences screen
will show the new extension as a part of the Activiti Designer Extensions
group. After adding the extension as above, the REST task and the SOAP task
will appear as separate tasks in the tool palette. These tasks can now be
used when designing bpmn processes.

[1]
https://github.com/NatashaWso2/devstudio-tooling-bps/tree/master/plugins/org.wso2.developerstudio.bpmn.extensions

[2] https://wso2.org/jira/browse/BPS-1054

Best Regards,

Natasha Wijesekare

On Tue, Jun 14, 2016 at 9:12 AM, Natasha Wijesekara 
wrote:

> Hi,
>
> Please find my comments inline
>
>> To use the SOAP task when designing BPMN processes, I implemented a SOAP
 extension as an Activiti designer extension to the developer studio [1].
 After adding the SOAP extension I implemented to the Activiti designer
 extensions, the SOAP task will appear as a separate task in the tools
 palette. The SOAP task in the palette will have all the properties/fields
 as mentioned above in the main config tab, the user has to only give the
 required values.

>>> ​+1. This is great. Can ​we do same for Rest Task as well.
>>>
>>
>
>>  +1 To use the REST task in a BPMN process I'll implement a REST
>> extension as  an Activiti designer extension to the developer studio.
>>
>
>
>> **

 *${headers}*
 *​*

>>> ​In Header field, will it accept both expressions and fixed values ? if
>>> fixed values are supported can check feasibility implementing Activiti
>>> Designer's form support or
>>> PropertyType.DATA_GRID
>>> ​ support for header fields. ?
>>>
>>
> This header property defines the Header block attached to the SOAP
> Header when creating the SOAP request. Yes, it can accept both expressions
> and fixed values. If its the HTTP transport headers you are
> referring to as given below , the HTTP transport headers are given as
> key,value pairs so it can accept both expressions and fixed
> values.
>
>  **
>
> * Cache-Control: no-cache, Pragma:
> no-cache*
>
> * *
>
>  I have completed the implementatio

Re: [Architecture] [BPS][BPMN] Extending Support to Implement SOAP Task to invoke SOAP Services

2016-06-13 Thread Natasha Wijesekara
Hi,

Please find my comments inline

> To use the SOAP task when designing BPMN processes, I implemented a SOAP
>>> extension as an Activiti designer extension to the developer studio [1].
>>> After adding the SOAP extension I implemented to the Activiti designer
>>> extensions, the SOAP task will appear as a separate task in the tools
>>> palette. The SOAP task in the palette will have all the properties/fields
>>> as mentioned above in the main config tab, the user has to only give the
>>> required values.
>>>
>> ​+1. This is great. Can ​we do same for Rest Task as well.
>>
>

>  +1 To use the REST task in a BPMN process I'll implement a REST
> extension as  an Activiti designer extension to the developer studio.
>


> **
>>>
>>> *${headers}*
>>> *​*
>>>
>> ​In Header field, will it accept both expressions and fixed values ? if
>> fixed values are supported can check feasibility implementing Activiti
>> Designer's form support or
>> PropertyType.DATA_GRID
>> ​ support for header fields. ?
>>
>
This header property defines the Header block attached to the SOAP
Header when creating the SOAP request. Yes, it can accept both expressions
and fixed values. If its the HTTP transport headers you are
referring to as given below , the HTTP transport headers are given as
key,value pairs so it can accept both expressions and fixed
values.

 **

* Cache-Control: no-cache, Pragma:
no-cache*

* *

 I have completed the implementation of the BPMN SOAP extension for C5
using Netty as the sender. Currently I'm working on the implementation of
the  SOAP extension for C4 using the Axis 2 service client.

>
>> ​+1. You will be able to implement ​
>> ​this easily by extending Axis2 Service client.
>>
> +1 I will use the Axis2 Service client to implement the SOAP
extension for C4.

>
>>
>>
Best Regards,
*Natasha Wijesekare*

*Software Engineering Intern, WSO2  Inc:  http://wso2.com
*
*email  : nata...@wso2.com *
*mobile: +94 771358651*
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] [BPS][BPMN] Extending Support to Implement SOAP Task to invoke SOAP Services

2016-05-03 Thread Natasha Wijesekara
Hi,

I was able to implement an Apache CXF Soap Client using JAX-WS to provide
SOAP service invocation support within BPMN processes. This approach uses
Dispatch and Service.Mode.MESSAGE to construct a JAX-WS dynamic call, when
the complete request payload i.e. complete soap:Envelope is provided.

This WebService task which is implemented as a BPMN extension to the
Service task invokes the SOAP web service given by “serviceURL” parameter.
"serviceURL" parameter can be used to give a URL of a SOAP service
endpoint. It invokes the operation of the invoked web service given by the
“method” parameter. The input/request payload can be provided using the
"input" parameter. Output received  from the SOAP service invocation will
be assigned to a process variable (as raw content) or parts of the output
can be mapped to different process variables.

The parameters that should be specified by the user :

- serviceURL : URL of a SOAP service endpoint

- method : method to be invoked

- input : request payload

- outputVariable : process variable to save the response

The response of the SOAP service invocation can be retrieved from the
variable specified above in the succession steps of the workflow. The class
name of the Soap client implemented as an extension is given as the class
name to the Service task i.e.  "
*org.wso2.carbon.bpmn.extensions.soap.WebServiceTask". *

Given below is an example on how the parameters are specified in the
WebService task:

**

**

**

**

**

**

**

**

**

**

**

**

**

**

**

**

>From the parameters specified by the user, the “serviceURL”, “method” and
“input” are given as JuelExpressions i.e. the values for those variables
are passed as expressions since they can have dynamic values.

**

**

**

“outputVariable” is a fixed value since it contains the response of the
SOAP service invocation.

Appreciate your suggestions on the above approach.

Thanks and Best Regards,

Natasha Wijesekare

On Fri, Mar 18, 2016 at 3:00 PM, Natasha Wijesekara 
wrote:

> Hi,
>
> I encountered the above issues/limitations when trying to implement the
> SOAP client using the above mentioned dynamic client capability.
>
> Best Regards,
> Natasha Wijesekare
>
> On Fri, Mar 18, 2016 at 2:57 PM, Nandika Jayawardana 
> wrote:
>
>> Hi Natasha,
>>
>> Lets try with CXF. According to the documentation, there is a dynamic
>> client capabilty with CXF. Can you give it a try.
>>
>> http://cxf.apache.org/docs/dynamic-clients.html
>>
>> Regards
>> Nandika
>>
>> On Thu, Mar 17, 2016 at 4:58 PM, Natasha Wijesekara 
>> wrote:
>>
>>> Hi All,
>>>
>>> I tried implementing a SOAP client using Apache CXF and came across the
>>> following limitations.
>>>
>>> - When invoking the operation with  parameters it expects a Java object
>>> to be passed as the parameter when a complex type is used i.e. not a
>>> primitive type.
>>>
>>> -  Apache CXF SOAP client  cannot create java objects from
>>> dynamic WSDLs which is one of our requirements.
>>>
>>> Is there any way to overcome these limitations when using CXF or is
>>> there any other alternative ways to create SOAP clients?
>>> Any suggestions and feedback are highly appreciated.
>>>
>>> Best Regards,
>>> Natasha Wiejsekare
>>>
>>>
>>> On Thu, Mar 17, 2016 at 10:19 AM, Natasha Wijesekara 
>>> wrote:
>>>
 Hi All,

 WSO2 BPS  contains a RESTInvokerTask to invoke/send a  message from a
 BPMN process instance to a REST service. Similarly, we can extend support
 to implement  a SOAP Task to invoke external soap services from a BPMN
 process instance.

 The diagram below is a sample BPMN process which invokes an external
 soap service to get data in order to complete the process.

 [image: Inline image 2]


 This is an example for a two-way communication i.e. the request is sent
 to the soap service and a response is excepted back. There can be scenarios
 where a response is not expected back from the service(One-way).

 In order to achieve this we have to create a soap client which invokes
 the needed soap service by passing the payload (Soap message, headers etc.)
  There are many ways to write a soap client.
 For this, what will be the best-suited option out of the following?

 [1] Using Apache CXF

 [2] Using Axis2
 [3] Using Java XML Soap

 Any suggestions and feedback are highly appreciated.

 Best Regards,
 *Natasha Wijesekare*

 *WSO2  Inc:  http://wso2.com *
 *email  : nata...@wso2.com *
 *mobile: +94 771358651 <%2B94%20771358651>*

>>>
>>>
>>>
>>> --
>>> *Natasha Wijesekare*
>>>
>>> *Software Engineering Intern, WSO2  Inc:  http://wso2.com
>>> *
>>> *email  : nata...@wso2.com *
>>> *mobile: +94 771358651 <%2B94%20771358651>*
>>>
>>
>>
>>
>> --
>> Nandika Jayawardana
>> WSO2 Inc ; http://wso2.com
>> lean.enterprise.middleware
>>
>
>
>
> --
> *Natasha Wijesekare*
>
> *Software Engineering Inter

Re: [Architecture] [BPS][BPMN] Extending Support to Implement SOAP Task to invoke SOAP Services

2016-03-19 Thread Natasha Wijesekara
Hi,

I encountered the above issues/limitations when trying to implement the
SOAP client using the above mentioned dynamic client capability.

Best Regards,
Natasha Wijesekare

On Fri, Mar 18, 2016 at 2:57 PM, Nandika Jayawardana 
wrote:

> Hi Natasha,
>
> Lets try with CXF. According to the documentation, there is a dynamic
> client capabilty with CXF. Can you give it a try.
>
> http://cxf.apache.org/docs/dynamic-clients.html
>
> Regards
> Nandika
>
> On Thu, Mar 17, 2016 at 4:58 PM, Natasha Wijesekara 
> wrote:
>
>> Hi All,
>>
>> I tried implementing a SOAP client using Apache CXF and came across the
>> following limitations.
>>
>> - When invoking the operation with  parameters it expects a Java object
>> to be passed as the parameter when a complex type is used i.e. not a
>> primitive type.
>>
>> -  Apache CXF SOAP client  cannot create java objects from
>> dynamic WSDLs which is one of our requirements.
>>
>> Is there any way to overcome these limitations when using CXF or is there
>> any other alternative ways to create SOAP clients?
>> Any suggestions and feedback are highly appreciated.
>>
>> Best Regards,
>> Natasha Wiejsekare
>>
>>
>> On Thu, Mar 17, 2016 at 10:19 AM, Natasha Wijesekara 
>> wrote:
>>
>>> Hi All,
>>>
>>> WSO2 BPS  contains a RESTInvokerTask to invoke/send a  message from a
>>> BPMN process instance to a REST service. Similarly, we can extend support
>>> to implement  a SOAP Task to invoke external soap services from a BPMN
>>> process instance.
>>>
>>> The diagram below is a sample BPMN process which invokes an external
>>> soap service to get data in order to complete the process.
>>>
>>> [image: Inline image 2]
>>>
>>>
>>> This is an example for a two-way communication i.e. the request is sent
>>> to the soap service and a response is excepted back. There can be scenarios
>>> where a response is not expected back from the service(One-way).
>>>
>>> In order to achieve this we have to create a soap client which invokes
>>> the needed soap service by passing the payload (Soap message, headers etc.)
>>>  There are many ways to write a soap client.
>>> For this, what will be the best-suited option out of the following?
>>>
>>> [1] Using Apache CXF
>>>
>>> [2] Using Axis2
>>> [3] Using Java XML Soap
>>>
>>> Any suggestions and feedback are highly appreciated.
>>>
>>> Best Regards,
>>> *Natasha Wijesekare*
>>>
>>> *WSO2  Inc:  http://wso2.com *
>>> *email  : nata...@wso2.com *
>>> *mobile: +94 771358651 <%2B94%20771358651>*
>>>
>>
>>
>>
>> --
>> *Natasha Wijesekare*
>>
>> *Software Engineering Intern, WSO2  Inc:  http://wso2.com
>> *
>> *email  : nata...@wso2.com *
>> *mobile: +94 771358651 <%2B94%20771358651>*
>>
>
>
>
> --
> Nandika Jayawardana
> WSO2 Inc ; http://wso2.com
> lean.enterprise.middleware
>



-- 
*Natasha Wijesekare*

*Software Engineering Intern, WSO2  Inc:  http://wso2.com
*
*email  : nata...@wso2.com *
*mobile: +94 771358651*
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] [BPS][BPMN] Extending Support to Implement SOAP Task to invoke SOAP Services

2016-03-19 Thread Natasha Wijesekara
Hi All,

I tried implementing a SOAP client using Apache CXF and came across the
following limitations.

- When invoking the operation with  parameters it expects a Java object to
be passed as the parameter when a complex type is used i.e. not a primitive
type.

-  Apache CXF SOAP client  cannot create java objects from
dynamic WSDLs which is one of our requirements.

Is there any way to overcome these limitations when using CXF or is there
any other alternative ways to create SOAP clients?
Any suggestions and feedback are highly appreciated.

Best Regards,
Natasha Wiejsekare


On Thu, Mar 17, 2016 at 10:19 AM, Natasha Wijesekara 
wrote:

> Hi All,
>
> WSO2 BPS  contains a RESTInvokerTask to invoke/send a  message from a BPMN
> process instance to a REST service. Similarly, we can extend support to
> implement  a SOAP Task to invoke external soap services from a BPMN process
> instance.
>
> The diagram below is a sample BPMN process which invokes an external soap
> service to get data in order to complete the process.
>
> [image: Inline image 2]
>
>
> This is an example for a two-way communication i.e. the request is sent to
> the soap service and a response is excepted back. There can be scenarios
> where a response is not expected back from the service(One-way).
>
> In order to achieve this we have to create a soap client which invokes the
> needed soap service by passing the payload (Soap message, headers etc.)
>  There are many ways to write a soap client.
> For this, what will be the best-suited option out of the following?
>
> [1] Using Apache CXF
>
> [2] Using Axis2
> [3] Using Java XML Soap
>
> Any suggestions and feedback are highly appreciated.
>
> Best Regards,
> *Natasha Wijesekare*
>
> *WSO2  Inc:  http://wso2.com *
> *email  : nata...@wso2.com *
> *mobile: +94 771358651 <%2B94%20771358651>*
>



-- 
*Natasha Wijesekare*

*Software Engineering Intern, WSO2  Inc:  http://wso2.com
*
*email  : nata...@wso2.com *
*mobile: +94 771358651*
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] [BPS][BPMN] Extending Support to Implement SOAP Task to invoke SOAP Services

2016-03-18 Thread Nandika Jayawardana
Hi Natasha,

Lets try with CXF. According to the documentation, there is a dynamic
client capabilty with CXF. Can you give it a try.

http://cxf.apache.org/docs/dynamic-clients.html

Regards
Nandika

On Thu, Mar 17, 2016 at 4:58 PM, Natasha Wijesekara 
wrote:

> Hi All,
>
> I tried implementing a SOAP client using Apache CXF and came across the
> following limitations.
>
> - When invoking the operation with  parameters it expects a Java object to
> be passed as the parameter when a complex type is used i.e. not a primitive
> type.
>
> -  Apache CXF SOAP client  cannot create java objects from
> dynamic WSDLs which is one of our requirements.
>
> Is there any way to overcome these limitations when using CXF or is there
> any other alternative ways to create SOAP clients?
> Any suggestions and feedback are highly appreciated.
>
> Best Regards,
> Natasha Wiejsekare
>
>
> On Thu, Mar 17, 2016 at 10:19 AM, Natasha Wijesekara 
> wrote:
>
>> Hi All,
>>
>> WSO2 BPS  contains a RESTInvokerTask to invoke/send a  message from a
>> BPMN process instance to a REST service. Similarly, we can extend support
>> to implement  a SOAP Task to invoke external soap services from a BPMN
>> process instance.
>>
>> The diagram below is a sample BPMN process which invokes an external soap
>> service to get data in order to complete the process.
>>
>> [image: Inline image 2]
>>
>>
>> This is an example for a two-way communication i.e. the request is sent
>> to the soap service and a response is excepted back. There can be scenarios
>> where a response is not expected back from the service(One-way).
>>
>> In order to achieve this we have to create a soap client which invokes
>> the needed soap service by passing the payload (Soap message, headers etc.)
>>  There are many ways to write a soap client.
>> For this, what will be the best-suited option out of the following?
>>
>> [1] Using Apache CXF
>>
>> [2] Using Axis2
>> [3] Using Java XML Soap
>>
>> Any suggestions and feedback are highly appreciated.
>>
>> Best Regards,
>> *Natasha Wijesekare*
>>
>> *WSO2  Inc:  http://wso2.com *
>> *email  : nata...@wso2.com *
>> *mobile: +94 771358651 <%2B94%20771358651>*
>>
>
>
>
> --
> *Natasha Wijesekare*
>
> *Software Engineering Intern, WSO2  Inc:  http://wso2.com
> *
> *email  : nata...@wso2.com *
> *mobile: +94 771358651 <%2B94%20771358651>*
>



-- 
Nandika Jayawardana
WSO2 Inc ; http://wso2.com
lean.enterprise.middleware
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture