Saturday, November 28, 2015

[WSO2BPS] Uploading a BPEL archive using admin services

Some users want to automate BPEL deployment using external tools. This blog post discuss how you can use BPEL Uploader admin service for this purpose.

Applies to WSO2 BPS 3.x. ( Tested on 3.2.0 )

Viewing wsdl of BPEL Uploader admin service

  1. Change "HideAdminServiceWSDLs" to false in Carbon.xml.
  2. (Re)Start WSO2 BPS server. 
  3. Now you can view BPEL uploader admin service WSDL from 
    • https://localhost:9443/services/BPELUploader?wsdl

Method 1 - Using SOAP UI. 

Create SOAP UI project using "https://localhost:9443/services/BPELUploader?wsdl"

  1. Open upload service request and add an attachment using Attachment tab.
  2. Select your BPEL file from file system. ( eg: )
  3. Give File Name in SOAP request  ( )
  4. Type "cid:Myzip-File" in dataHandler.
  5. Select Myzip-File in Part column in attachment tab. 
  6. In Auth tab. Configure Basic authentication ( Usernname/passowrd admin/admin - Authenticate Pre-Emptively)
Now you will able to upload BPEL file using SOAP UI. 

Note: When you send above request, SOAP UI automatically replace dataHandler content with base64 encoded content of zip file. 

Method 2 - Using Curl Command line tool.

  1. First Convert zip file content into base64 format. For that use base64 command line tool as follows,

  2. $ base64 > base64.txt

  3. Create request.xml file with following content. Replace dataHandler text with content of base64.txt

  4. Use following curl command to upload your BPEL file. 

curl --user admin:admin -k -s -v --header "Content-Type: text/xml;charset=UTF-8" --header "SOAPAction: urn:uploadService" --data @request.xml https://localhost:9443/services/BPELUploader 

-- End --

No comments:

Post a Comment