No subject
Fri Apr 16 10:15:54 EDT 2010
of =93open-ils=94 which I=92ll use in next request
*Next Request*
curl -H "X-OpenSRF-service: open-ils.auth" --data 'osrf-msg=3D
[
{
"__c" : "osrfMessage",
"__p" : {
"threadTrace" : 0,
"payload" : {
"__c" : "osrfMethod",
"__p" : {
"params" : {
=93username=94: "admin"
=93Password=94: 92df31e9869a256203560124ea5319ec
"type": "opac"
},"method" : " open-ils.auth.authenticate.complete"
}
},
"locale" : "en-US",
"type" : "REQUEST"
}
}
]
And then the response
--0050450155c27ffd48049f579d70
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
<pre>I want to login through a java application</pre><pre>=A0</pre><pre>Is =
my Approach correct??</pre><pre>=A0</pre><pre>First I will create json obje=
ct in java which is like this</pre><pre>=A0</pre><pre>(</pre><pre>but I don=
=92t know how to use curl =96H over here as it is a command line tool</pre>
<pre>)</pre><pre>=A0</pre><pre>curl -H "X-<span class=3D"il">OpenSRF</=
span>-service: open-ils.auth" --data 'osrf-msg=3D<br><br>[ <br><br=
>=A0 { =A0"__c" : "osrfMessage",<br><br>=A0 =A0 =A0&quo=
t;__p" : { <br>
<br>=A0 =A0 =A0 =A0 "threadTrace" : 0, <br><br>=A0 =A0 =A0 =A0 &q=
uot;payload" : { <br><br>=A0 =A0 =A0 =A0 =A0 =A0"__c" : &quo=
t;osrfMethod","__p" : { "params" : ["admin&qu=
ot;],<br><br>=A0 =A0 =A0 =A0 =A0 =A0 =A0 "method" : "<span s=
tyle=3D"color: black;">open-ils.auth.authenticate.init</span>" <br>
<br>=A0 =A0 =A0 =A0 =A0 =A0} <br><br>=A0 =A0 =A0 =A0 }, <br><br>=A0 =A0 =A0=
=A0 "locale" : "en-US", <br><br>=A0 =A0 =A0 =A0 "=
type" : "REQUEST" <br><br>=A0 =A0 =A0} <br><br>=A0 } <br><br=
>] </pre><pre>=A0</pre><pre>and then send it to url=3D<span class=3D"il"><u=
><span style=3D"color: blue;"><a href=3D"http://192.168.56.102/osrf-http-tr=
anslator">http://192.168.56.102/osrf-http-translator</a> </span></u></span>=
(192.168.56.102 is the ip address of virtual machine because I=92m accessin=
g virtual machine services from host machine in which java application is r=
unning)</pre>
<pre>=A0</pre><pre>=A0</pre><pre>=A0</pre><pre><b style=3D""><span style=3D=
"font-size: 20pt;">Response</span></b></pre><pre>=A0</pre><pre>[<br><br>=A0=
{<br><br>=A0 =A0 =A0"__c" : "osrfMessage",<br><br>=A0 =
=A0 =A0"__p" : {<br>
<br>=A0 =A0 =A0 =A0 "threadTrace" : 0,<br><br>=A0 =A0 =A0 =A0 &qu=
ot;payload" : {<br><br>=A0 =A0 =A0 =A0 =A0 =A0"__c" : "=
osrfResult",<br><br>=A0 =A0 =A0 =A0 =A0 =A0"__p" : {<br><br>=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 "status" : "OK",<br>
<br>=A0 =A0 =A0 =A0 =A0 =A0 =A0 "content" : =936ba0510ab42e028e57=
755bf0151655ed=94</pre><pre>=A0 =A0 =A0 =A0 =A0 =A0 =A0 "statusCode&qu=
ot; : 200<br><br>=A0 =A0 =A0 =A0 =A0 =A0}<br><br>=A0 =A0 =A0 =A0 },<br><br>=
=A0 =A0 =A0 =A0 "locale" : "en-US",<br>
<br>=A0 =A0 =A0 =A0 "type" : "RESULT"<br><br>=A0 =A0 =
=A0}<br><br>=A0 },<br><br>=A0 {<br><br>=A0 =A0 =A0"__c" : "o=
srfMessage",<br><br>=A0 =A0 =A0"__p" : {<br><br>=A0 =A0 =A0 =
=A0 "threadTrace" : 0,<br>
<br>=A0 =A0 =A0 =A0 "payload" : {<br><br>=A0 =A0 =A0 =A0 =A0 =A0&=
quot;__c" : "osrfConnectStatus",<br><br>=A0 =A0 =A0 =A0 =A0 =
=A0"__p" : {<br><br>=A0 =A0 =A0 =A0 =A0 =A0 =A0 "status"=
; : "Request Complete",<br><br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 "statusCode" : 205<br>
<br>=A0 =A0 =A0 =A0 =A0 =A0}<br><br>=A0 =A0 =A0 =A0 },<br><br>=A0 =A0 =A0 =
=A0 "locale" : "en-US",<br><br>=A0 =A0 =A0 =A0 "ty=
pe" : "STATUS"<br><br>=A0 =A0 =A0}<br><br>=A0 }<br><br>]</pr=
e><pre>=A0</pre><pre>From response I take out 6ba0510ab42e028e57755bf015165=
5ed and md5hash of =93open-ils=94<span style=3D"">=A0 </span>which I=92ll u=
se in next request</pre>
<pre>=A0</pre><pre><b style=3D""><span style=3D"font-size: 18pt;">Next Requ=
est</span></b></pre><pre>=A0</pre><pre>=A0</pre><pre>curl -H "X-<span =
class=3D"il">OpenSRF</span>-service: open-ils.auth" --data 'osrf-m=
sg=3D<br>
<br>
[ <br><br>=A0 { <br><br>=A0 =A0 =A0"__c" : "osrfMessage"=
;,<br><br>=A0 =A0 =A0"__p" : { <br><br>=A0 =A0 =A0 =A0 "thre=
adTrace" : 0,<br><br>=A0 =A0 =A0 =A0 "payload" : { <br><br>=
=A0 =A0 =A0 =A0 =A0 =A0"__c" : "osrfMethod", <br>
<br>=A0 =A0 =A0 =A0 =A0 =A0"__p" : { <br><br>=A0 =A0 =A0 =A0 =A0 =
=A0 =A0 "params" : {</pre><pre>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <s=
pan style=3D"">=A0=A0=A0=A0=A0=A0 </span>=93username=94:=A0"admin"=
;</pre><pre><span style=3D"">=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0 </span>=93Password=94: 92df31e9869a256203560124ea5319=
ec</pre>
<pre><span style=3D"">=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0 </span><tt><span style=3D"color: black;">"type": =
"opac"</span></tt><span style=3D"color: black;"></span></pre><pre=
> <br><br>=A0 =A0 =A0 =A0 =A0 =A0 =A0 },"method" : "<span st=
yle=3D"color: red;"> </span><tt><span style=3D"color: black;">open-ils.auth=
.authenticate.complete</span></tt>" <br>
<br>=A0 =A0 =A0 =A0 =A0 =A0} <br><br>=A0 =A0 =A0 =A0 }, <br><br>=A0 =A0 =A0=
=A0 "locale" : "en-US", <br><br>=A0 =A0 =A0 =A0 "=
type" : "REQUEST" <br><br>=A0 =A0 =A0} <br><br>=A0 } <br><br=
>] <br style=3D""><br><br style=3D""><br></pre>
<pre>=A0</pre><pre>And then the response</pre><pre>=A0</pre>
--0050450155c27ffd48049f579d70--
More information about the Open-ils-dev
mailing list