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...
please help me with this.
*Chirag Ahuja
(irc name :chirag)*
--20cf300faee331677b049f5c358d
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
<b>Forgot to put my information over previous mail..</b><br><br><br><div cl=
ass=3D"gmail_quote"><pre>I want to login through a java application</pre><p=
re>=A0</pre><pre>Is my Approach correct??</pre><pre>=A0</pre><pre>First I w=
ill create json object 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>OpenSRF</span>-service=
: open-ils.auth" --data 'osrf-msg=3D<br><br>[ <br><br>=A0 { =A0&qu=
ot;__c" : "osrfMessage",<br><br>=A0 =A0 =A0"__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><u><span style=
=3D"color: blue;"><a href=3D"http://192.168.56.102/osrf-http-translator" ta=
rget=3D"_blank">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 ac=
cessing virtual machine services from host machine in which java applicatio=
n is running)</pre>
<pre>=A0</pre><pre>=A0</pre><pre>=A0</pre><pre><b><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&qu=
ot;__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>=A0 </span>which I=92ll use in next =
request</pre>
<pre>=A0</pre><pre><b><span style=3D"font-size: 18pt;">Next Request</span><=
/b></pre><pre>=A0</pre><pre>=A0</pre><pre>curl -H "X-<span>OpenSRF</sp=
an>-service: open-ils.auth" --data 'osrf-msg=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>=A0=A0=A0=A0=A0=A0 </span>=93username=94:=A0"admin"</pre><pre=
><span>=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: 92df31e9869a256203560124ea5319ec</pre>
<pre><span>=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&q=
uot;</span></tt><span style=3D"color: black;"></span></pre><pre> <br><br>=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 },"method" : "<span style=3D"col=
or: red;"> </span><tt><span style=3D"color: black;">open-ils.auth.authentic=
ate.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><br><br><br></pre>
<pre>=A0</pre><pre>And then the response...<br><br>please help me with this=
.<br><br><br><br><br><br><br><br><b>Chirag Ahuja<br><br>(irc name :chirag)<=
/b><br></pre><pre>=A0</pre>
</div><br>
--20cf300faee331677b049f5c358d--
More information about the Open-ils-dev
mailing list