source: companies/celepar/phpgwapi/doc/xmlrpc/phpgw_server.html @ 763

Revision 763, 6.9 KB checked in by niltonneto, 15 years ago (diff)

Importação inicial do Expresso da Celepar

Line 
1<HTML
2><HEAD
3><TITLE
4>   eGroupWare XML-RPC/SOAP Methodology
5  </TITLE
6><META
7NAME="GENERATOR"
8CONTENT="Modular DocBook HTML Stylesheet Version 1.64
9"><LINK
10REL="NEXT"
11TITLE="   Business layer requests
12  "
13HREF="phpgw_server-1.html"></HEAD
14><BODY
15CLASS="ARTICLE"
16><DIV
17CLASS="ARTICLE"
18><DIV
19CLASS="TITLEPAGE"
20><H1
21CLASS="TITLE"
22><A
23NAME="AEN2"
24>eGroupWare XML-RPC/SOAP Methodology</A
25></H1
26><H3
27CLASS="AUTHOR"
28><A
29NAME="AEN4"
30></A
31></H3
32><HR></DIV
33><DIV
34CLASS="SECT1"
35><H1
36CLASS="SECT1"
37><A
38NAME="AEN8"
39>System level requests</A
40></H1
41><DIV
42CLASS="SECT2"
43><H2
44CLASS="SECT2"
45><A
46NAME="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
62CLASS="SECT3"
63><H3
64CLASS="SECT3"
65><A
66NAME="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
73BORDER="0"
74BGCOLOR="#E0E0E0"
75WIDTH="100%"
76><TR
77><TD
78><PRE
79CLASS="PROGRAMLISTING"
80>&#60;?xml version="1.0"?&#62;
81&#60;methodCall&#62;
82&#60;methodName&#62;system.login&#60;/methodName&#62;
83&#60;params&#62;
84&#60;param&#62;
85&#60;value&#62;&#60;struct&#62;
86&#60;member&#62;&#60;name&#62;server_name&#60;/name&#62;
87&#60;value&#62;&#60;string&#62;my.host.name&#60;/string&#62;&#60;/value&#62;
88&#60;/member&#62;
89&#60;member&#62;&#60;name&#62;username&#60;/name&#62;
90&#60;value&#62;&#60;string&#62;bubba&#60;/string&#62;&#60;/value&#62;
91&#60;/member&#62;
92&#60;member&#62;&#60;name&#62;password&#60;/name&#62;
93&#60;value&#62;&#60;string&#62;gump&#60;/string&#62;&#60;/value&#62;
94&#60;/member&#62; &#60;/struct&#62;&#60;/value&#62;
95&#60;/param&#62;
96&#60;/params&#62;
97&#60;/methodCall&#62;
98    </PRE
99></TD
100></TR
101></TABLE
102><P
103>     And the same in SOAP:
104    </P
105><TABLE
106BORDER="0"
107BGCOLOR="#E0E0E0"
108WIDTH="100%"
109><TR
110><TD
111><PRE
112CLASS="PROGRAMLISTING"
113>&#60;?xml version="1.0"?&#62;
114&#60;SOAP-ENV:Envelope
115xmlns: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"
116xmlns:ns6="http://soapinterop.org" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&#62;
117&#60;SOAP-ENV:Body&#62; &#60;ns6:system_login&#62;
118&#60;server_name xsi:type=":string"&#62;my.host.name&#60;/server_name&#62;
119&#60;username xsi:type=":string"&#62;bubba&#60;/username&#62;
120&#60;password xsi:type=":string"&#62;gump&#60;/password&#62;
121&#60;/ns6:system_login&#62;
122&#60;/SOAP-ENV:Body&#62;
123&#60;/SOAP-ENV:Envelope&#62;
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
132BORDER="0"
133BGCOLOR="#E0E0E0"
134WIDTH="100%"
135><TR
136><TD
137><PRE
138CLASS="PROGRAMLISTING"
139>&#60;methodResponse&#62;
140&#60;params&#62;
141&#60;param&#62;
142&#60;value&#62;&#60;struct&#62;
143&#60;member&#62;&#60;name&#62;sessionid&#60;/name&#62;
144&#60;value&#62;&#60;string&#62;cf5c5534307562fc57915608377db007&#60;/string&#62;&#60;/value&#62;
145&#60;/member&#62;
146&#60;member&#62;&#60;name&#62;kp3&#60;/name&#62;
147&#60;value&#62;&#60;string&#62;2fe54daa11c8d52116788aa3f93cb70e&#60;/string&#62;&#60;/value&#62;
148&#60;/member&#62;
149&#60;/struct&#62;&#60;/value&#62;
150&#60;/param&#62;
151&#60;/params&#62;
152&#60;/methodResponse&#62;
153    </PRE
154></TD
155></TR
156></TABLE
157><P
158>     And a failed login:
159    </P
160><TABLE
161BORDER="0"
162BGCOLOR="#E0E0E0"
163WIDTH="100%"
164><TR
165><TD
166><PRE
167CLASS="PROGRAMLISTING"
168>&#60;methodResponse&#62;
169&#60;params&#62;
170&#60;param&#62;
171&#60;value&#62;&#60;struct&#62;
172&#60;member&#62;&#60;name&#62;GOAWAY&#60;/name&#62;
173&#60;value&#62;&#60;string&#62;XOXO&#60;/string&#62;&#60;/value&#62;
174&#60;/member&#62;
175&#60;/struct&#62;&#60;/value&#62;
176&#60;/param&#62;
177&#60;/params&#62;
178&#60;/methodResponse&#62;
179    </PRE
180></TD
181></TR
182></TABLE
183><P
184>     eqweqw
185    </P
186></DIV
187><DIV
188CLASS="SECT3"
189><H3
190CLASS="SECT3"
191><A
192NAME="AEN27"
193>system.logout</A
194></H3
195><P
196>     Logout:
197    </P
198><TABLE
199BORDER="0"
200BGCOLOR="#E0E0E0"
201WIDTH="100%"
202><TR
203><TD
204><PRE
205CLASS="PROGRAMLISTING"
206>&#60;?xml version="1.0"?&#62;
207&#60;methodCall&#62;
208&#60;methodName&#62;system.logout&#60;/methodName&#62;
209&#60;params&#62; &#60;param&#62;
210&#60;value&#62;&#60;struct&#62;
211&#60;member&#62;&#60;name&#62;sessionid&#60;/name&#62;
212&#60;value&#62;&#60;string&#62;ea35cac53d2c12bd05caecd97304478a&#60;/string&#62;&#60;/value&#62;
213&#60;/member&#62;
214&#60;member&#62;&#60;name&#62;kp3&#60;/name&#62;
215&#60;value&#62;&#60;string&#62;4f2b256e0da4e7cbbebaac9f1fc8ca4a&#60;/string&#62;&#60;/value&#62;
216&#60;/member&#62;
217&#60;/struct&#62;&#60;/value&#62;
218&#60;/param&#62;
219&#60;/params&#62;
220&#60;/methodCall&#62;
221    </PRE
222></TD
223></TR
224></TABLE
225><P
226>     Logout worked:
227    </P
228><TABLE
229BORDER="0"
230BGCOLOR="#E0E0E0"
231WIDTH="100%"
232><TR
233><TD
234><PRE
235CLASS="PROGRAMLISTING"
236>&#60;methodResponse&#62;
237&#60;params&#62;
238&#60;param&#62;
239&#60;value&#62;&#60;struct&#62;
240&#60;member&#62;&#60;name&#62;GOODBYE&#60;/name&#62;
241&#60;value&#62;&#60;string&#62;XOXO&#60;/string&#62;&#60;/value&#62;
242&#60;/member&#62;
243&#60;/struct&#62;&#60;/value&#62;
244&#60;/param&#62;
245&#60;/params&#62;
246&#60;/methodResponse&#62;
247    </PRE
248></TD
249></TR
250></TABLE
251></DIV
252></DIV
253></DIV
254></DIV
255><DIV
256CLASS="NAVFOOTER"
257><HR
258ALIGN="LEFT"
259WIDTH="100%"><TABLE
260WIDTH="100%"
261BORDER="0"
262CELLPADDING="0"
263CELLSPACING="0"
264><TR
265><TD
266WIDTH="33%"
267ALIGN="left"
268VALIGN="top"
269>&nbsp;</TD
270><TD
271WIDTH="34%"
272ALIGN="center"
273VALIGN="top"
274>&nbsp;</TD
275><TD
276WIDTH="33%"
277ALIGN="right"
278VALIGN="top"
279><A
280HREF="phpgw_server-1.html"
281>Next</A
282></TD
283></TR
284><TR
285><TD
286WIDTH="33%"
287ALIGN="left"
288VALIGN="top"
289>&nbsp;</TD
290><TD
291WIDTH="34%"
292ALIGN="center"
293VALIGN="top"
294>&nbsp;</TD
295><TD
296WIDTH="33%"
297ALIGN="right"
298VALIGN="top"
299>Business layer requests</TD
300></TR
301></TABLE
302></DIV
303></BODY
304></HTML
305>
Note: See TracBrowser for help on using the repository browser.