on 12-10-2014 4:37 PM
Hi All,
Anyone who knows about Published Web Services on job definition?
How it works?
Thanks!
Alyssa
Hi Alyssa,
You publish a job definition as a web service. The web service is made available to third party tools that can use it to submit the job definition.
For example, publish a web service:
1. Create a job definition of type RedwoodScript named "Sleep", the source should be: {Thread.sleep(5000);}
2. On the "published web services" tab, click Add. The default name is WS_Sleep.
3. The URL to call the web service should be http://server:port/scheduler/api-soap/submit/WS_Sleep
You can use the following on UNIX; create a file named submit.sh containing the following:
#!/bin/sh
#Set Environment
ENDPOINT="http://server:port/scheduler/api-soap/submit/$1"
read -s -p "Enter Username: " user
echo ""
read -s -p "Enter Password: " passwd
echo ""
#Call the web service
USERPASSWD=`echo -n $user:$passwd | base64`
curl -H 'SOAPAction: "/scheduler/api-soap/submit/$1"' -H "Content-Type: application/xml; charset=utf-8" -H "Authorization:Basic $USERPASSWD" --data @- "${ENDPOINT}" <<EOF
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:red="Redwood.customer.redwood.com">
<soapenv:Header/>
<soapenv:Body>
<red:SubmitJobParameters>
<red:Queue>System</red:Queue>
</red:SubmitJobParameters>
</soapenv:Body>
</soapenv:Envelope>
EOF
###END of file
Make it executable: $ chmod +x submit.sh
Now call it with the name of the published web service, here WS_Sleep:
./submit.sh WS_Sleep
You need curl, it is a command line web browser. There are examples for this in the documentation for VBS as well.
Regards,
HP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alyssa,
The benefit here is third-party application integration. A lot of applications allow you to call web services, PeopleSoft, for example. So you could submit a job in CPS from within PeopleSoft by publishing the web service. You configure PeopleSoft to connect to CPS and call the published web service, this will submit the job in CPS.
The published web services documentation can be found here:
http://server:port/scheduler/help/user_guide/scripting/soap/soap_inbound.html
You can also call third party web services from within CPS.
The main topic on web services is this one:
http://server:port/scheduler/help/user_guide/scripting/soap/soap_main.html
Regards,
HP
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.