1 import LPClient.*;
2
3
4
5
6
7
8
9
10
11
12
13
14 public class lpclient_wsdl
15 {
16 public static void main(String args[]) throws Exception
17 {
18
19
20
21
22
23
24 LPClientInterfaceServiceLocator locator = new LPClientInterfaceServiceLocator();
25
26
27
28
29
30 locator.setMaintainSession(true);
31
32
33
34
35 LPClientInterface clientObj = locator.getLPClient();
36 if ( clientObj == null ) {
37 System.out.println("Error has occured, could not create client Object.");
38 return;
39 }
40
41
42
43
44 boolean res = clientObj.dsConnect();
45 System.out.println( "Connection Status = " + res );
46
47
48
49
50
51 if ( res ) {
52
53
54
55
56
57
58
59
60
61 String result = new String();
62
63
64
65
66
67
68
69
70
71 try {
72 result = clientObj.getXMLLesseeDoc("25");
73 System.out.println("Result was " + result);
74
75
76
77
78
79
80
81
82
83 } catch ( Exception e ) {
84 System.out.println(e.toString());
85 clientObj.dsDisconnect();
86 return;
87 }
88
89
90
91
92
93 StringBuffer xmldocument = new StringBuffer();
94 xmldocument.append("<?xml version=\"1.0\"?><MSI_APP_ORIG><LESSEE_RECORD>");
95 xmldocument.append("<clientNumber>25</clientNumber>");
96 xmldocument.append("<portfolio>" + "2" + "</portfolio>");
97 xmldocument.append("<region>" + "1" + "</region>");
98 xmldocument.append("<office>" + "1" + "</office>");
99 xmldocument.append("<company>" + "1" + "</company>");
100 xmldocument.append("<address1>" + "111 Anza Blvd" + "</address1>");
101 xmldocument.append("<city>" + "San Francisco" + "</city>");
102 xmldocument.append("<state>" + "CA" + "</state>");
103 xmldocument.append("<zipCode>" + "90141" + "</zipCode>");
104 xmldocument.append("</LESSEE_RECORD></MSI_APP_ORIG>");
105
106 if ( clientObj.apiInitXMLParser( xmldocument.toString() ) ) {
107
108
109
110
111
112 int rc = clientObj.processLessee( true );
113 System.out.println("Update returned = " + rc);
114 switch ( rc ) {
115 case 0:
116 System.out.println( clientObj.getErrorMessage() );
117 break;
118 case 1:
119 System.out.println( clientObj.getInfoMessage() );
120 break;
121 }
122 }
123
124
125
126
127 clientObj.dsDisconnect();
128 }
129
130 }
131 }
132