cancel
Showing results for 
Search instead for 
Did you mean: 

Published Web Services

Former Member
0 Kudos

Hi All,

Anyone who knows about Published Web Services on job definition?

How it works?

Thanks!

Alyssa

Accepted Solutions (1)

Accepted Solutions (1)

h_carpenter
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Thanks HP.

Where can i find the documentation about published web service.

What are the benefits of using it?

-Alyssa

h_carpenter
Active Contributor
0 Kudos

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

Answers (0)