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:

*<serviceTask id="servicetask1" name="Service Task"
activiti:class="org.wso2.carbon.bpmn.extensions.soap.WebServiceTask">*

*<extensionElements>*

*<activiti:field name="serviceURL">*

*<activiti:expression><![CDATA[${serviceURL}]]></activiti:expression>*

*</activiti:field>*

*<activiti:field name="method">*

*<activiti:expression><![CDATA[${method}]]></activiti:expression>*

*</activiti:field>*

*<activiti:field name="input">*

*<activiti:expression><![CDATA[${input}]]></activiti:expression>*

*</activiti:field>*

*<activiti:field name="outputVariable">*

*<activiti:string><![CDATA[outputVariable]]></activiti:string>*

*</activiti:field>*

*</extensionElements>*

*</serviceTask>*

>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.

*<activiti:field name="serviceURL">*

*<activiti:expression><![CDATA[${serviceURL}]]></activiti:expression>*

*</activiti:field>*

“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 <nata...@wso2.com>
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 <nand...@wso2.com>
> 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 <nata...@wso2.com>
>> 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 <nata...@wso2.com>
>>> 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 <http://wso2.com/>*
>>>> *email  : nata...@wso2.com <nata...@wso2.com>*
>>>> *mobile: +94 771358651 <%2B94%20771358651>*
>>>>
>>>
>>>
>>>
>>> --
>>> *Natasha Wijesekare*
>>>
>>> *Software Engineering Intern, WSO2  Inc:  http://wso2.com
>>> <http://wso2.com/>*
>>> *email  : nata...@wso2.com <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
> <http://wso2.com/>*
> *email  : nata...@wso2.com <nata...@wso2.com>*
> *mobile: +94 771358651 <%2B94%20771358651>*
>



-- 
*Natasha Wijesekare*

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

Reply via email to