Thursday 8 October 2015

Chapter 23: Web Services Jobs


Chapter 23: Web Services Jobs 



Web Service Jobs 
The term web service describes a standardized method for exchanging data between 
applications and systems. Web services use XML to code and decode the data and 
Simple Object Access Protocol (SOAP) to transfer it. 
Web Service Description Language (WSDL) is an XML-based language that describes a 
web service and how to access it. A WSDL document specifies the location of the service 
and the operations the service exposes. 
Universal Description, Discovery and Integration (UDDI) is an XML-based registry for 
businesses to list their available web services on the Internet. You can use the UDDI to 
access the WSDL. 
Web services provide access to applications written in Java and Microsoft©
.NET. A web 
service lets you invoke operations such as currency conversion, stock exchange quotes, 
or product pricing. In an enterprise workload automation environment, a web service 
might be used to invoke a business process such as posting accounts payable to the 
General Ledger. Some scheduling manager functions are also available as web services. 

The following are the web service job types: 
Web Service RPC/Encoded 
Lets you call an operation within a web service and pass parameters to the 
operation using RPC/encoded style binding. The parameters can be actual values or 
a serialized Java object passed by another job. 
Web Service Document/Literal 
Lets you call an operation within a web service and pass parameters to the 
operation using document/literal style binding. The parameters represent a 
flattened view of the XML document the agent constructs. The values passed into 
the XML document can be literal values or a serialized Java object passed by 
another job. 


 Define a Web Service Document/Literal Job 
When the job invokes the web service, the parameters are passed to the operation. The 
job's output is stored by default as a serialized Java object in the job's spool directory. 
You can also specify a destination file for the output. 
Note: To run these jobs, your system requires CA WA Agent for UNIX, Linux, or Windows 
and CA WA Agent for Web Services. 
The following diagram shows the functional relationship between the scheduling 
manager, CA WA Agent for Web Services, and a web service residing on a web server: 
Note: If your company has a firewall and you must communicate through a proxy server 
to access a computer outside the firewall, agent configuration is required. For more 
information on configuring the agent for a proxy, see the CA Workload Automation 
Agent for Web Services Implementation Guide. 

Web Service Document/Literal lets you call an operation within a web service and pass 
parameters to the operation using document/literal style binding. The parameters 
represent a flattened view of the XML document the agent constructs. 
Follow these steps: 
1. Insert a job and specify the following attributes in the definition: 
job_type: WSDOC 
Specifies that the job type is Web Service Document/Literal. 
machine 
Specifies the name of the machine on which the job runs. 
endpoint_URL 
Specifies the target endpoint address URL. 
port_name 
Specifies the WSDL port name. 
service_name 
Specifies the web service name. 
 Define a Web Service Document/Literal Job 
  
wsdl_operation 
Specifies the operation to be invoked. 
WSDL_URL 
Specifies the URL to the Web Service Description Language (WSDL) of the web 
service to invoke. 
2. (Optional) Specify optional Web Service Document/Literal attributes. 
■ destination_file 
■ job_class 
■ job_criteria 
■ ws_authentication_order 
■ ws_conn_domain 
■ ws_conn_origin 
■ ws_conn_user 
■ ws_global_proxy_defaults 
■ ws_parameter 
■ ws_proxy_domain 
■ ws_proxy_host 
■ ws_proxy_origin 
■ ws_proxy_port 
■ ws_proxy_user 
■ ws_security 
3. (Optional) Specify common attributes that apply to all jobs. 
The Web Service Document/Literal job is defined. When the job runs, it calls an 
operation within a web service. 
 Define a Web Service Document/Literal Job 
Notes: 
■ Attributes that have a default value automatically apply to the job definitions; 
therefore, they are optional. For example, jobs with no specified job type are 
defined as command jobs by default. Other optional attributes specify information 
that is not required but affects how or when a job runs, such as attributes that 
specify scheduling conditions. 
■ Some optional attributes are common to all job types but others apply to certain 
jobs types only. Optional attributes that apply to all job types are known as 
common optional attributes. For more information about common optional 
attributes and the values that you can specify for them (including their default 
values when applicable), see the Reference Guide. 
■ For information about required attributes and job type specific optional attributes, 
see the procedure topics that provide instructions for defining jobs. 
■ This guide provides instructions for defining jobs interactively. You also create job 
definitions in script files and then import them using the jil command or use CA 
WCC to define them. For more information about the JIL command and JIL syntax, 
see the Reference Guide. For more information about using CA WCC to define the 
job, see the CA Workload Control Center Workload Scheduling Guide. 
Example: Invoke a Web Service to List All Amazon Buckets Operation 
Suppose that you want to invoke an Amazon web service that lists all your Amazon 
"buckets". The URL for the WSDL that describes the web service and its location is 
http://s3.amazonaws.com/doc/2006-03-01/AmazonS3.wsdl. The target endpoint 
address URL is https://s3.amazonaws.com/soap. The job calls the operation 
ListAllMyBuckets within the AmazonS3 web service. When the job invokes the web 
service, information about the list of my buckets is passed to the operation. The 
ListAllMyBuckets operation assigns different parameter values. 
insert_job: execws 
job_type: WSDOC 
machine: wsagent 
endpoint_URL: "https://s3.amazonaws.com/soap" 
wsdl_url: "http://s3.amazonaws.com/doc/2006-03-01/AmazonS3.wsdl" 
service_name: AmazonS3 
port_name: AmazonS3 
wsdl_operation: ListAllMyBuckets 
ws_proxy_host: 141.202.248.209 
ws_proxy_port: 80 
ws_proxy_user: causer@tant-a01 
ws_proxy_domain: tant-a01 
ws_parameter: Name="/ListAllMyBuckets", Value="" 
ws_parameter: Name="/ListAllMyBuckets/AWSAccessKeyId", Value="0x0102030405060708" 
ws_parameter: Name="/ListAllMyBuckets/Timestamp", Value="2011-08-25T02:24:21" 
ws_parameter: Name="/ListAllMyBuckets/Signature", Value="0x0102030405060708" Define a Web Service RPC/Encoded Job 
Define a Web Service RPC/Encoded Job 
You can define a Web Service RPC/Encoded job to call an operation within a web 
service. 
Note: To run these jobs, your system requires CA WA Agent for UNIX, Linux, or Windows 
and CA WA Agent for Web Services. 
Follow these steps: 
1. Insert a job and specify the following attributes in the definition: 
job_type: WBSVC 
Specifies that the job type is Web Service RPC/Encoded. 
machine 
Specifies the name of the machine on which the job runs. 
target_namespace 
Specifies the target namespace used for the names of messages, port type, 
binding, and services defined in the WSDL for the web service. Complex data 
types such as arrays require the target namespace. 
wsdl_operation 
Specifies the operation to be invoked. 
2. (Optional) Specify optional Web Service RPC/Encoded attributes: 
■ destination_file 
■ endpoint_URL 
■ job_class 
■ one_way 
■ port_name 
■ return_class_name 
■ return_namespace 
■ return_xml_name 
■ service_name 
■ success_pattern 
■ web_parameter 
■ web_user 
■ WSDL_URL 
 Define a Web Service RPC/Encoded Job 
470 User Guide 
Notes: 
■ In a Web Service RPC/Encoded job, if you specify the WSDL_URL attribute but 
not the endpoint_URL attribute, you must specify both the service_name and 
port_name attributes. For the job to run successfully without the 
endpoint_URL attribute, the agent must be running on the same computer as 
the application server such as WebLogic or JBoss. If you specify both the 
WSDL_URL and endpoint_URL attributes, then the service_name and 
port_name attributes are optional. 
■ The agent does not support document/literal styles of web services. 
3. (Optional) Specify common attributes that apply to all job types. 
The Web Service RPC/Encoded job is defined. When the job runs, it calls an 
operation within a web service. 
Notes: 
■ The one_way attribute is set to FALSE by default. If you do not specify this attribute 
in your job definition, the job waits for a response after the agent invokes the 
operation before completing. You can override this default setting by specifying the 
one_way attribute in your job definition. 
■ This guide provides instructions for defining jobs interactively. You also create job 
definitions in script files and then import them using the jil command or use CA 
WCC to define them. For more information about the JIL command and JIL syntax, 
see the Reference Guide. For more information about using CA WCC to define the 
job, see the CA Workload Control Center Workload Scheduling Guide. 
Example: Get a Company Stock Quote 
Suppose that you want to invoke a web service that returns a company stock quote. The 
URL for the WSDL that describes the web service and its location is 
http://www.webservicex.com/stockquote.asmx?WSDL. The WSDL port name within the 
target namespace http://www.webserviceX.NET is StockQuoteSoap. The target 
endpoint address URL is http://www.webservicex.com/stockquote.asmx. The job calls 
the operation GetQuote within the StockQuote web service. When the job invokes the 
web service, the company's stock symbol is passed to the operation. The GetQuote 
operation returns a java.lang.String object, which maps to the XML type string in the 
return namespace http://www.webserviceX.NET/. When the job completes, the stock 
quote for CA is stored as a serialized Java object in the job's spool directory. 
 Define a Web Service RPC/Encoded Job 
insert_job: quote 
job_type: WBSVC 
machine: wsagent 
target_namespace: "http://www.webserviceX.NET/" 
service_name: StockQuote 
port_name: StockQuoteSoap 
wsdl_operation: GetQuote 
one_way: FALSE 
WSDL_URL: "http://www.webservicex.com/stockquote.asmx?WSDL" 
endpoint_URL: "http://www.webservicex.com/stockquote.asmx" 
web_parameter: xsd\:string="CA" 
return_class_name: java.lang.String 
return_xml_name: string 
return_namespace: "http://www.webserviceX.NET/" 
Example: Validate an Email Address in a Web Service Job 
Suppose that you want to invoke a web service that validates an email address. The URL 
for the WSDL that describes the web service and its location is 
http://www.webservicex.net/ValidateEmail.asmx?wsdl. The job calls the IsValidEmail 
operation within the ValidateEmail web service. When the job invokes the web service, 
the email address is passed to the operation. If the email address is valid, the operation 
returns true and the job completes successfully. If the email address is invalid, the 
operation returns false and the job fails. 
insert_job: subscribe 
job_type: WBSVC 
machine: wsagent 
target_namespace: "http://www.webserviceX.NET/" 
service_name: ValidateEmail 
port_name: ValidateEmailSoap 
wsdl_operation: IsValidEmail 
WSDL_URL: "http://www.webservicex.net/ValidateEmail.asmx?wsdl" 
endpoint_URL: "http://www.webservicex.net/ValidateEmail.asmx" 
web_parameter: xsd\:string="john.smith@example.com" 
return_class_name: java.lang.Boolean 
return_xml_name: boolean 
return_namespace: "http://www.webservicex.net" 
success_pattern: true 
More information: 
Insert a Job Definition (see page 88) 
 Attributes with Default Values 
472 User Guide 
Attributes with Default Values 
Attributes that have a default value automatically apply to the job definition. Therefore, 
you do not have to specify those attributes in the definition. Your agent administrator 
can define some default values on the agent in the agentparm.txt file. 
If you specify the attribute in a job definition, it overrides the default. 
The following Web Service Document/Literal Job attributes have default values: 
ws_global_proxy_defaults 
Specifies whether to use the global proxy configuration specified by the proxy 
parameters in the agentparm.txt file. 
Default: Y (The job uses the global proxy configuration specified by the proxy 
parameters in the agentparm.txt file.) 
ws_proxy_domain 
Specifies the domain for proxy authentication. 
Default: http.proxyDomain agent parameter, if specified 
ws_proxy_host 
Specifies the proxy host name to use for the request. 
Default: http.proxyHost agent parameter, if specified 
ws_proxy_origin 
Specifies the origin host name for proxy authentication. 
Default: http.proxyOrigin agent parameter, if specified 
ws_proxy_port 
Specifies the proxy port to use for the request. 
Default: http.proxyPort agent parameter, if specified 
ws_proxy_user 
Specifies the user name required for proxy authentication. 
Default: http.proxyUser agent parameter, if specified 
Note: For more information about JIL job types and other job definition attributes, the 
values that you can specify for those attributes, and JIL syntax, see the Reference Guide. 
 Attributes with Default Values 
Example: Override the Proxy Host, Proxy User, and the Proxy Domain in a Web Service 
Document/Literal Job 
Several attributes in the following job definition override the default values. 
Suppose that the service name and the port name are AmazonS3. In this example, 
ws_proxy_host, ws_proxy_port, ws_proxy_user and ws_proxy_domain attributes 
override the global proxy defaults specified in the agentparm.txt file. The credentials of 
user causer@tant-a01 are used for authorization to the proxy server. 
insert_job: execws 
job_type: WSDOC 
machine: wsagent 
endpoint_URL: "https://s3.amazonaws.com/soap" 
wsdl_url: "http://s3.amazonaws.com/doc/2006-03-01/AmazonS3.wsdl" 
service_name: AmazonS3 
port_name: AmazonS3 
wsdl_operation: ListAllMyBuckets 
ws_proxy_host: 141.202.248.209 
ws_proxy_port: 80 
ws_proxy_user: causer@tant-a01 
ws_proxy_domain: tant-a01 
ws_parameter: Name="/ListAllMyBuckets", Value="" 
ws_parameter: Name="/ListAllMyBuckets/AWSAccessKeyId", Value="0x0102030405060708" 
ws_parameter: Name="/ListAllMyBuckets/Timestamp", Value="2011-08-25T02:24:21" 
ws_parameter: Name="/ListAllMyBuckets/Signature", Value="0x0102030405060708"

No comments:

Post a Comment