The WPS generic web service would work only if we have the security is turned on in WPS server.

To start a long running business process using web service, we need to generate the WSDL clients for generic WPS APIs. To get the generic web service files

logon to admin console. Click on Applications -> Enterprise Applications -> BPEContainer_<serverName><NodeName>_<profileName>. From Additional properties

section, click on Publish WSDL files. From the window opened. Click on the zip file link. This zip file will be downloaded with all the required files for

generating the webservice proxy client. Repeat the same steps for TaskContainer_<serverName><nodeName>_<profileName> application also.

Once we got our WSDL files, generate the web service client as mentioned in Generating a web service proxy client.

Now we can use the proxy client files for making a call to WPS for initiating a long running process. The code to do the same will be


// Create a soap element first. This is for storing the input data.
SOAPFactory factory = SOAPFactory.newInstance();
SOAPElement requestData = factory.createElement(<operation Name>, <namespace prefix>,<nterface uri>);

SOAPElement myData = factory.createElement(<input parameter name>);

SOAPFactory  factory = SOAPFactory.newInstance();
SOAPElement element  = factory.createElement(elementName);
element.addTextNode(elementValue);
myData.addChildElement(element);

factory = SOAPFactory.newInstance();
element  = factory.createElement(elementName);
element.addTextNode(elementValue);
myData.addChildElement(element);

requestData.addChildElement(myData);

SendMessage myMessage = new SendMessage();

myMessage.set_any(requestData);
myMessage.setProcessTemplateName(<process Name>);
myMessage.setOperation(<operation Name>);

QName portQName = new QName(<interface uri>,<process port name>);
myMessage.setPortType(portQName);

BFMIFProxy proxy =  new BFMIFProxy();
SendMessageResponse messageResponse = proxy.sendMessage(myMessage);
String processId = messageResponse.getPIID();

Share/Save/Bookmark

If you enjoyed this post, make sure you subscribe to my RSS feed!



Related Posts:
  • Starting a long running business process using EJB API
  • Creating a Business Calendar in WebSphere Integration Developer 6.1.2
  • Querying human task based on custom property using EJB API
  • WebSphere Process Server Human task custom properties
  • Business calendars in WID 6.1.2


  • 10 Responses to “Start a long running business process using webservice API”  

    1. 1 akkachotu

      Why do we start a long running business process using web service and generic WPS APIs ? I didnt understand the significance of this approach ? since what I am thinking is, whether it is a long running bpel process or a micrflow bpel process we call any bpel process using its wsdl. so for example if we have to call a bpel process from a jsp file then we invoke bpel process as a web service from the jsp file and so I didnt understand the approach you have told in this article. please clarify.

    2. 2 Albin Joseph

      >>we call any bpel process using its wsdl

      Do you mean exporting it as WebService and then using this export for making a call to that process? It would work fine. What if the process has a human task in it? The process would wait till the human task get completed. But our webservice call will not wait till some human completes the operation. The web service call will be timed out after few minutes. I think it will get timed out after 2 minutes. So in these cases we need to make the calls asynchronously. If we are using web service export the calls are synchronous. Moreover its always better to use BPC APIs when dealing with business process and human tasks. It has more power.

    3. 3 akkachotu

      Oh that is a new learning for me. Thank you for the reply.

    4. 4 akkachotu

      Hi Joseph,

      I find Correlation Sets concept in WID/WPS confusing until I do a small hands-on with it. Can you please publish a Hello-World kind of article/tutorial (like this one http://www.webagesolutions.com/knowledgebase/waskb/waskb021/index.html) on using Correlation Sets using WID/WPS.

      Thanks in advance.

    5. 5 Albin Joseph

      A small tutorial on how to use Correlation Sets in WPS/WID has been posted and the url is http://www.albeesonline.com/blog/2008/07/21/creating-a-correlation-set-websphere-integration-developer/

    6. 6 Harish

      hi
      do any one knows how to get the fault message using webservice API.

      Any help .. Thanks in advance

    7. 7 Albin Joseph

      Did you try

      proxy.getFaultMessage() ?

      Seems like that would give you the fault message. I haven’t tried it though.

    8. 8 Harish

      Hi Albin
      Thanks for ur reply… proxy.getFaultMessage(withFaultparameters) works for the
      Long running process, but how to get the fault message for the Micro flow proces.
      is there any other way, where i can get the
      fault message using webservice api for micro flow process. gr8 if u help me on this

    9. 9 Albin Joseph

      I haven’t tried it yet. I am on vacation now. So may be Monday I can provide you some inputs on this matter. If I got something working.

    10. 10 Harish

      Thanks a lot albin… i am not able to get a proper doc on this… it would be gr8 help
      if u get a chance to work out that and help me.

    Leave a Reply