Modifying the empinfoclient.java file – HP Integrity NonStop J-Series User Manual

Page 413

Advertising
background image

Figure 168 New Java Class Dialog Box

The EmpInfoClient.java class file under the EmpInfoClient package is created.

Modifying the EmpInfoClient.java File

Modify the newly created class file EmpInfoClient.java file so that it appears as:

package com.hp.client;

import java.util.Scanner;

import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;

public class EmpInfoClient {
public static void main(String [] args) throws AxisFault {

String a;
ServiceClient client = new ServiceClient();
// create option object
Options opts = new Options();
// setting target EPR
opts.setTo(new EndpointReference("http://<IP address of iTP WebServer>:<Port#>/<servlet
directory
>/axis2/services/EmpInfo"));
// Setting action ,and which can be found from the wsdl of the service
Scanner scan=new Scanner(System.in);
do
{
System.out.println("To Insert Employee press 1 \n"+"For Employee Details press 2 \n"+"To Delete Employee
press 3");

Example of Integrating Axis2/Java with Spring

413

Advertising
This manual is related to the following products: