Launching workflow from Perl using SOAP

Document Sample
Launching workflow from Perl using SOAP Powered By Docstoc
					Launching workflow from Perl using SOAP...


       Gordon Mckeown 313 posts since
Dec 7, 2006
Does anyone out there have some working Perl code (preferably using SOAP::Lite) that
launches workflow via RBA's SOAP/WSDL interface?

Tags: platform


         Wayne Keenan 27 posts since
Aug 28, 2007 1. Re: Launching workflow from Perl using SOAP interface Jul 31, 2008 4:25 AM
Hi, I don't have the specific Perl example you are after, but I can providesome general guidance on: 1. how to
obtain the WSDL location for a RBA grid,2. how to assemble an example SOAP request,3. a suggestion of a SOAP
test utility,4. passing XML. Note: Please remember to set the "expose as SOAP" flag on the DevStudioprocess
properties AND also on the Peer properties admin page were theprocess is deployed. 1. Grid WSDL Location: http://
[HOST]:[PORT]/ws/workflow/wsdl?grid-name=[GRID_NAME] ReplacingHOST, PORT with host and port of the RBA
server.GRID_NAME with the RBA grid. 2. Example request As an example for a process called "GetHostInfo" with 1
input parametercalled 'hostname' you might get: <soapenv:Envelopexmlns:soapenv="http://schemas.xmlsoap.org/
soap/envelope/"xmlns:urn="urn:realops.com:amp:workflow"xmlns:oas="http://docs.oasis-open.org/
wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:tra="Training"><soapenv:Header><urn:grid-
name>traininggrid</urn:grid-name><oas:Security><oas:UsernameToken><oas:Username>admin</
oas:Username><oas:Password>admin123</oas:Password></oas:UsernameToken></oas:Security></
soapenv:Header><soapenv:Body><tra:GetHostInfo-Request><tra:hostname>localhost</tra:hostname></
tra:GetHostInfo-Request></soapenv:Body></soapenv:Envelope> Note the passwords are needed in the header,
and that there are options(via attributes in oas:Password) for password encryption that are notutilised here. 3.
Test utility Download www.soapui.orgcreate a project, importing the WSDL from #1 into the project.SOAPUI
can generate default requests (examples) for all the operationsfound 4. Passing XML You can pass XML as
content to the SOAP/Process parameters.Unfortunately you can't modify theWSDL to reflect your custom data
types (XSD's). Which makes the WSDLless useful for design time discovery, and moves the validation intoyour
workflow. Hope that helps. Wayne Keenan Integrations Team Lead TuringSMIDelme Place, Cams Hall Estate,
Fareham Hampshire, PO16 8UX Office: +44 (0) 870 770 4655Fax: +44 (0) 870 421 5406Mobile: +44 (0) 7811 184
637Web Site: www.turingsmi.comeMail: wkeenan@turingsmi.com


         Wayne Keenan 27 posts since
Aug 28, 2007 2. Re: Launching workflow from Perl using SOAP interface Jul 31, 2008 4:33 AM

   in response to: Wayne Keenan Seem like a lot of formatting got lost, please find the SOAP
requestattached. Wayne Keenan Integrations Team Lead TuringSMIDelme Place, Cams Hall Estate,
Fareham Hampshire, PO16 8UX Office: +44 (0) 870 770 4655Fax: +44 (0) 870 421 5406Mobile: +44 (0) 7811 184
637Web Site: www.turingsmi.comeMail: wkeenan@turingsmi.com Attachments:
       • RBA_SOAP_Request_Example.zip (464 bytes)




         Wayne Keenan 27 posts since




Generated by Clearspace on 2010-06-13-06:00
                                                                                                                1
Launching workflow from Perl using SOAP...


Aug 28, 2007 3. Re: Launching workflow from Perl using SOAP interface Jul 31, 2008 5:03 PM
Hi, This turned into a bit more than I thought it would... I thought I might try to implement an example for you, its been
a whilesince I dabbled with Perl, and I've not really done WS in Perl before(Does Frontier.pm count?) Unfortunately
SOAP:Lite failed to parse the WSDL; which I think is dueto a hyphen in the operation names (autogenerated by
RBA). I then found SOAP::WSDL, but that just hurt more; there were hyphens inthe generated perl functions that
wsdl2perl.pl generated for the Perlclass SOAP bindings.I had also tried to use the API directly but it was taking
too much timeto find basic information/examples that demonstrated how to send SOAPheaders together with
XML namespaces. Then I remembered that WSo2.org have a number of multi-platformmulti-language WS library
wrappers around the: battled hardened, crossplatform, client/server Apache Axis2, a marvellous invention, and
isalso what is used within RBA itself. So I downloaded the WSo2 WSF for C http://wso2.org/downloads/wsf/c
as itis a pre-requisite for the "Wso2 WSF for Perl" module from CPAN. Unfortunately it all fell down due to Axis2
not building within a cygwinenvironment: https://issues.apache.org/jira/browse/AXIS2C-627(I'm running perl on
cygwin on win32) So I installed the 'native' ActiveState perl for win32, but then foundthe WSF/Perl module only
supports Unix WSF/C at the moment. Im sure there is an easier 'native' perl way, but is it asconformant/flexible/
performant as an Axis2 based solution?I'm sure that if I had tried from *nix that my life would have beensimpler. If
you want to use Perl/Win32(native|cygwin)/Axis2 you seem to have alot of work cut out - I would gladly be proved
otherwise. If you just need Unix, then I'm sure it would be more fruitful off thebat - maybe I will try it. Regards Wayne
Keenan Integrations Team Lead TuringSMIDelme Place, Cams Hall Estate, Fareham Hampshire, PO16 8UX Office:
+44 (0) 870 770 4655Fax: +44 (0) 870 421 5406Mobile: +44 (0) 7811 184 637Web Site: www.turingsmi.comeMail:
wkeenan@turingsmi.com


         Gordon Mckeown 313 posts since
Dec 7, 2006 4. Re: Launching workflow from Perl using SOAP interface Jul 31, 2008 5:28 PM

   in response to: Wayne Keenan
Thanks for this, Wayne. Your SOAP request and recommendation of the SoapUI app
have been extremely helpful in figuring out how to get this done.I put together some code
using SOAP::Lite a few days ago, but was getting constant authentication failures due to
apparently invalid headers. It turns out that, due to Perl's use of hashes, the Username and
Password tags were not being output in the right order (and the WSDL specifies them as a
sequence).I've been battling with SOAP::Lite most of today, and in the last half hour have
actually managed to get a launch a workflow from a Perl script. It's still a bit rough around
the edges, and I'm not yet getting the results back from the workflow, but it's a start.



         Touloumis 41 posts since
Oct 10, 2008 5. Re: Launching workflow from Perl using SOAP interface Dec 26, 2008 10:56 AM

SOAP::Lite is pretty limited but is an easy interface to use.



Browse http://search.cpan.org for other modules which may have richer WSDL support such
as:

http://search.cpan.org/~mkutter/SOAP-WSDL-2.00.06/lib/SOAP/WSDL/Manual.pod




Generated by Clearspace on 2010-06-13-06:00
                                                                                                                        2
Launching workflow from Perl using SOAP...




         Richard de Vries 90 posts since
Oct 21, 2008 6. Re: Launching workflow from Perl using SOAP interface Jul 30, 2009 5:36 PM

I am great with Perl, but new to SOAP myself as well.



This post has helped me a lot! Via SoapUI I was able to construct a valid soap request and
successfully triggered a workflow.



However, I've only been able to get it to work when using the admin account. If I create an
other account in the Access Manager - even if it is part of the admin group - and use it, I get
authorization errors.



So, how would I go about in changing these privileges so that I can use alternate accounts
to interface with the web service?



Thanks everyone!



 Richard



         Touloumis 41 posts since
Oct 10, 2008 7. Re: Launching workflow from Perl using SOAP interface Aug 13, 2009 1:27 PM

Not authorized to view the specified document 7281




Generated by Clearspace on 2010-06-13-06:00
                                                                                                  3