1 | <HTML |
---|
2 | ><HEAD |
---|
3 | ><TITLE |
---|
4 | > eGroupWare XML-RPC/SOAP Methodology |
---|
5 | </TITLE |
---|
6 | ><META |
---|
7 | NAME="GENERATOR" |
---|
8 | CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
---|
9 | "><LINK |
---|
10 | REL="NEXT" |
---|
11 | TITLE=" Business layer requests |
---|
12 | " |
---|
13 | HREF="phpgw_server-1.html"></HEAD |
---|
14 | ><BODY |
---|
15 | CLASS="ARTICLE" |
---|
16 | ><DIV |
---|
17 | CLASS="ARTICLE" |
---|
18 | ><DIV |
---|
19 | CLASS="TITLEPAGE" |
---|
20 | ><H1 |
---|
21 | CLASS="TITLE" |
---|
22 | ><A |
---|
23 | NAME="AEN2" |
---|
24 | >eGroupWare XML-RPC/SOAP Methodology</A |
---|
25 | ></H1 |
---|
26 | ><H3 |
---|
27 | CLASS="AUTHOR" |
---|
28 | ><A |
---|
29 | NAME="AEN4" |
---|
30 | ></A |
---|
31 | ></H3 |
---|
32 | ><HR></DIV |
---|
33 | ><DIV |
---|
34 | CLASS="SECT1" |
---|
35 | ><H1 |
---|
36 | CLASS="SECT1" |
---|
37 | ><A |
---|
38 | NAME="AEN8" |
---|
39 | >System level requests</A |
---|
40 | ></H1 |
---|
41 | ><DIV |
---|
42 | CLASS="SECT2" |
---|
43 | ><H2 |
---|
44 | CLASS="SECT2" |
---|
45 | ><A |
---|
46 | NAME="AEN10" |
---|
47 | >Login and authentication</A |
---|
48 | ></H2 |
---|
49 | ><P |
---|
50 | > Authentication for user logins is handled internally no differently than for the typical eGroupWare login via web browser. Server logins, added for XML-RPC and SOAP, are only slightly different. For either protocol, user and server login and authentication and subsequent requests are handled by their respective server apps, xmlrpc.php and soap.php. A server is identified by a custom HTTP header, without which a normal user login will be undertaken. |
---|
51 | </P |
---|
52 | ><P |
---|
53 | > A client or server sends the appropriate XML-RPC or SOAP packet containing host, user, and password information to the phpgw server. The server then assigns a sessionid and key, which is returned to the client in the appropriate format. |
---|
54 | </P |
---|
55 | ><P |
---|
56 | > Our current method for authenticating requests after successful login is via the Authorization: Basic HTTP header to be sent by the client or requesting server. The format of this header is a base64 encoding of the assigned sessionid and kp3 variables, seperated by a ':'. |
---|
57 | </P |
---|
58 | ><P |
---|
59 | > Further security may be obtained by using SSL on the client and server. In the future, we may encrypt/descrypt the data on either end, or at least provide this as an option. The sessionid and key variables will make this possible, and relatively secure. |
---|
60 | </P |
---|
61 | ><DIV |
---|
62 | CLASS="SECT3" |
---|
63 | ><H3 |
---|
64 | CLASS="SECT3" |
---|
65 | ><A |
---|
66 | NAME="AEN16" |
---|
67 | >system.login</A |
---|
68 | ></H3 |
---|
69 | ><P |
---|
70 | > The first request a client will make is the system.login method. Here is a sample of a server login packet in XML-RPC: |
---|
71 | </P |
---|
72 | ><TABLE |
---|
73 | BORDER="0" |
---|
74 | BGCOLOR="#E0E0E0" |
---|
75 | WIDTH="100%" |
---|
76 | ><TR |
---|
77 | ><TD |
---|
78 | ><PRE |
---|
79 | CLASS="PROGRAMLISTING" |
---|
80 | ><?xml version="1.0"?> |
---|
81 | <methodCall> |
---|
82 | <methodName>system.login</methodName> |
---|
83 | <params> |
---|
84 | <param> |
---|
85 | <value><struct> |
---|
86 | <member><name>server_name</name> |
---|
87 | <value><string>my.host.name</string></value> |
---|
88 | </member> |
---|
89 | <member><name>username</name> |
---|
90 | <value><string>bubba</string></value> |
---|
91 | </member> |
---|
92 | <member><name>password</name> |
---|
93 | <value><string>gump</string></value> |
---|
94 | </member> </struct></value> |
---|
95 | </param> |
---|
96 | </params> |
---|
97 | </methodCall> |
---|
98 | </PRE |
---|
99 | ></TD |
---|
100 | ></TR |
---|
101 | ></TABLE |
---|
102 | ><P |
---|
103 | > And the same in SOAP: |
---|
104 | </P |
---|
105 | ><TABLE |
---|
106 | BORDER="0" |
---|
107 | BGCOLOR="#E0E0E0" |
---|
108 | WIDTH="100%" |
---|
109 | ><TR |
---|
110 | ><TD |
---|
111 | ><PRE |
---|
112 | CLASS="PROGRAMLISTING" |
---|
113 | ><?xml version="1.0"?> |
---|
114 | <SOAP-ENV:Envelope |
---|
115 | xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:si="http://soapinterop.org/xsd" |
---|
116 | xmlns:ns6="http://soapinterop.org" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> |
---|
117 | <SOAP-ENV:Body> <ns6:system_login> |
---|
118 | <server_name xsi:type=":string">my.host.name</server_name> |
---|
119 | <username xsi:type=":string">bubba</username> |
---|
120 | <password xsi:type=":string">gump</password> |
---|
121 | </ns6:system_login> |
---|
122 | </SOAP-ENV:Body> |
---|
123 | </SOAP-ENV:Envelope> |
---|
124 | </PRE |
---|
125 | ></TD |
---|
126 | ></TR |
---|
127 | ></TABLE |
---|
128 | ><P |
---|
129 | > The same style of packet would be required for a user/client login. A successful login should yield the following reply: |
---|
130 | </P |
---|
131 | ><TABLE |
---|
132 | BORDER="0" |
---|
133 | BGCOLOR="#E0E0E0" |
---|
134 | WIDTH="100%" |
---|
135 | ><TR |
---|
136 | ><TD |
---|
137 | ><PRE |
---|
138 | CLASS="PROGRAMLISTING" |
---|
139 | ><methodResponse> |
---|
140 | <params> |
---|
141 | <param> |
---|
142 | <value><struct> |
---|
143 | <member><name>sessionid</name> |
---|
144 | <value><string>cf5c5534307562fc57915608377db007</string></value> |
---|
145 | </member> |
---|
146 | <member><name>kp3</name> |
---|
147 | <value><string>2fe54daa11c8d52116788aa3f93cb70e</string></value> |
---|
148 | </member> |
---|
149 | </struct></value> |
---|
150 | </param> |
---|
151 | </params> |
---|
152 | </methodResponse> |
---|
153 | </PRE |
---|
154 | ></TD |
---|
155 | ></TR |
---|
156 | ></TABLE |
---|
157 | ><P |
---|
158 | > And a failed login: |
---|
159 | </P |
---|
160 | ><TABLE |
---|
161 | BORDER="0" |
---|
162 | BGCOLOR="#E0E0E0" |
---|
163 | WIDTH="100%" |
---|
164 | ><TR |
---|
165 | ><TD |
---|
166 | ><PRE |
---|
167 | CLASS="PROGRAMLISTING" |
---|
168 | ><methodResponse> |
---|
169 | <params> |
---|
170 | <param> |
---|
171 | <value><struct> |
---|
172 | <member><name>GOAWAY</name> |
---|
173 | <value><string>XOXO</string></value> |
---|
174 | </member> |
---|
175 | </struct></value> |
---|
176 | </param> |
---|
177 | </params> |
---|
178 | </methodResponse> |
---|
179 | </PRE |
---|
180 | ></TD |
---|
181 | ></TR |
---|
182 | ></TABLE |
---|
183 | ><P |
---|
184 | > eqweqw |
---|
185 | </P |
---|
186 | ></DIV |
---|
187 | ><DIV |
---|
188 | CLASS="SECT3" |
---|
189 | ><H3 |
---|
190 | CLASS="SECT3" |
---|
191 | ><A |
---|
192 | NAME="AEN27" |
---|
193 | >system.logout</A |
---|
194 | ></H3 |
---|
195 | ><P |
---|
196 | > Logout: |
---|
197 | </P |
---|
198 | ><TABLE |
---|
199 | BORDER="0" |
---|
200 | BGCOLOR="#E0E0E0" |
---|
201 | WIDTH="100%" |
---|
202 | ><TR |
---|
203 | ><TD |
---|
204 | ><PRE |
---|
205 | CLASS="PROGRAMLISTING" |
---|
206 | ><?xml version="1.0"?> |
---|
207 | <methodCall> |
---|
208 | <methodName>system.logout</methodName> |
---|
209 | <params> <param> |
---|
210 | <value><struct> |
---|
211 | <member><name>sessionid</name> |
---|
212 | <value><string>ea35cac53d2c12bd05caecd97304478a</string></value> |
---|
213 | </member> |
---|
214 | <member><name>kp3</name> |
---|
215 | <value><string>4f2b256e0da4e7cbbebaac9f1fc8ca4a</string></value> |
---|
216 | </member> |
---|
217 | </struct></value> |
---|
218 | </param> |
---|
219 | </params> |
---|
220 | </methodCall> |
---|
221 | </PRE |
---|
222 | ></TD |
---|
223 | ></TR |
---|
224 | ></TABLE |
---|
225 | ><P |
---|
226 | > Logout worked: |
---|
227 | </P |
---|
228 | ><TABLE |
---|
229 | BORDER="0" |
---|
230 | BGCOLOR="#E0E0E0" |
---|
231 | WIDTH="100%" |
---|
232 | ><TR |
---|
233 | ><TD |
---|
234 | ><PRE |
---|
235 | CLASS="PROGRAMLISTING" |
---|
236 | ><methodResponse> |
---|
237 | <params> |
---|
238 | <param> |
---|
239 | <value><struct> |
---|
240 | <member><name>GOODBYE</name> |
---|
241 | <value><string>XOXO</string></value> |
---|
242 | </member> |
---|
243 | </struct></value> |
---|
244 | </param> |
---|
245 | </params> |
---|
246 | </methodResponse> |
---|
247 | </PRE |
---|
248 | ></TD |
---|
249 | ></TR |
---|
250 | ></TABLE |
---|
251 | ></DIV |
---|
252 | ></DIV |
---|
253 | ></DIV |
---|
254 | ></DIV |
---|
255 | ><DIV |
---|
256 | CLASS="NAVFOOTER" |
---|
257 | ><HR |
---|
258 | ALIGN="LEFT" |
---|
259 | WIDTH="100%"><TABLE |
---|
260 | WIDTH="100%" |
---|
261 | BORDER="0" |
---|
262 | CELLPADDING="0" |
---|
263 | CELLSPACING="0" |
---|
264 | ><TR |
---|
265 | ><TD |
---|
266 | WIDTH="33%" |
---|
267 | ALIGN="left" |
---|
268 | VALIGN="top" |
---|
269 | > </TD |
---|
270 | ><TD |
---|
271 | WIDTH="34%" |
---|
272 | ALIGN="center" |
---|
273 | VALIGN="top" |
---|
274 | > </TD |
---|
275 | ><TD |
---|
276 | WIDTH="33%" |
---|
277 | ALIGN="right" |
---|
278 | VALIGN="top" |
---|
279 | ><A |
---|
280 | HREF="phpgw_server-1.html" |
---|
281 | >Next</A |
---|
282 | ></TD |
---|
283 | ></TR |
---|
284 | ><TR |
---|
285 | ><TD |
---|
286 | WIDTH="33%" |
---|
287 | ALIGN="left" |
---|
288 | VALIGN="top" |
---|
289 | > </TD |
---|
290 | ><TD |
---|
291 | WIDTH="34%" |
---|
292 | ALIGN="center" |
---|
293 | VALIGN="top" |
---|
294 | > </TD |
---|
295 | ><TD |
---|
296 | WIDTH="33%" |
---|
297 | ALIGN="right" |
---|
298 | VALIGN="top" |
---|
299 | >Business layer requests</TD |
---|
300 | ></TR |
---|
301 | ></TABLE |
---|
302 | ></DIV |
---|
303 | ></BODY |
---|
304 | ></HTML |
---|
305 | > |
---|