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 &quot;X-<span class=3D"il">OpenSRF</=
span>-service: open-ils.auth&quot; --data &#39;osrf-msg=3D<br><br>[ <br><br=
>=A0 { =A0&quot;__c&quot; : &quot;osrfMessage&quot;,<br><br>=A0 =A0 =A0&quo=
t;__p&quot; : { <br>

<br>=A0 =A0 =A0 =A0 &quot;threadTrace&quot; : 0, <br><br>=A0 =A0 =A0 =A0 &q=
uot;payload&quot; : { <br><br>=A0 =A0 =A0 =A0 =A0 =A0&quot;__c&quot; : &quo=
t;osrfMethod&quot;,&quot;__p&quot; : { &quot;params&quot; : [&quot;admin&qu=
ot;],<br><br>=A0 =A0 =A0 =A0 =A0 =A0 =A0 &quot;method&quot; : &quot;<span s=
tyle=3D"color: black;">open-ils.auth.authenticate.init</span>&quot; <br>

<br>=A0 =A0 =A0 =A0 =A0 =A0} <br><br>=A0 =A0 =A0 =A0 }, <br><br>=A0 =A0 =A0=
 =A0 &quot;locale&quot; : &quot;en-US&quot;, <br><br>=A0 =A0 =A0 =A0 &quot;=
type&quot; : &quot;REQUEST&quot; <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&quot;__c&quot; : &quot;osrfMessage&quot;,<br><br>=A0 =
=A0 =A0&quot;__p&quot; : {<br>

<br>=A0 =A0 =A0 =A0 &quot;threadTrace&quot; : 0,<br><br>=A0 =A0 =A0 =A0 &qu=
ot;payload&quot; : {<br><br>=A0 =A0 =A0 =A0 =A0 =A0&quot;__c&quot; : &quot;=
osrfResult&quot;,<br><br>=A0 =A0 =A0 =A0 =A0 =A0&quot;__p&quot; : {<br><br>=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 &quot;status&quot; : &quot;OK&quot;,<br>

<br>=A0 =A0 =A0 =A0 =A0 =A0 =A0 &quot;content&quot; : =936ba0510ab42e028e57=
755bf0151655ed=94</pre><pre>=A0 =A0 =A0 =A0 =A0 =A0 =A0 &quot;statusCode&qu=
ot; : 200<br><br>=A0 =A0 =A0 =A0 =A0 =A0}<br><br>=A0 =A0 =A0 =A0 },<br><br>=
=A0 =A0 =A0 =A0 &quot;locale&quot; : &quot;en-US&quot;,<br>

<br>=A0 =A0 =A0 =A0 &quot;type&quot; : &quot;RESULT&quot;<br><br>=A0 =A0 =
=A0}<br><br>=A0 },<br><br>=A0 {<br><br>=A0 =A0 =A0&quot;__c&quot; : &quot;o=
srfMessage&quot;,<br><br>=A0 =A0 =A0&quot;__p&quot; : {<br><br>=A0 =A0 =A0 =
=A0 &quot;threadTrace&quot; : 0,<br>

<br>=A0 =A0 =A0 =A0 &quot;payload&quot; : {<br><br>=A0 =A0 =A0 =A0 =A0 =A0&=
quot;__c&quot; : &quot;osrfConnectStatus&quot;,<br><br>=A0 =A0 =A0 =A0 =A0 =
=A0&quot;__p&quot; : {<br><br>=A0 =A0 =A0 =A0 =A0 =A0 =A0 &quot;status&quot=
; : &quot;Request Complete&quot;,<br><br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 &quot;statusCode&quot; : 205<br>
<br>=A0 =A0 =A0 =A0 =A0 =A0}<br><br>=A0 =A0 =A0 =A0 },<br><br>=A0 =A0 =A0 =
=A0 &quot;locale&quot; : &quot;en-US&quot;,<br><br>=A0 =A0 =A0 =A0 &quot;ty=
pe&quot; : &quot;STATUS&quot;<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 &quot;X-<span =
class=3D"il">OpenSRF</span>-service: open-ils.auth&quot; --data &#39;osrf-m=
sg=3D<br>
<br>
[ <br><br>=A0 { <br><br>=A0 =A0 =A0&quot;__c&quot; : &quot;osrfMessage&quot=
;,<br><br>=A0 =A0 =A0&quot;__p&quot; : { <br><br>=A0 =A0 =A0 =A0 &quot;thre=
adTrace&quot; : 0,<br><br>=A0 =A0 =A0 =A0 &quot;payload&quot; : { <br><br>=
=A0 =A0 =A0 =A0 =A0 =A0&quot;__c&quot; : &quot;osrfMethod&quot;, <br>

<br>=A0 =A0 =A0 =A0 =A0 =A0&quot;__p&quot; : { <br><br>=A0 =A0 =A0 =A0 =A0 =
=A0 =A0 &quot;params&quot; : {</pre><pre>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <s=
pan style=3D"">=A0=A0=A0=A0=A0=A0 </span>=93username=94:=A0&quot;admin&quot=
;</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;">&quot;type&quot;: =
&quot;opac&quot;</span></tt><span style=3D"color: black;"></span></pre><pre=
> <br><br>=A0 =A0 =A0 =A0 =A0 =A0 =A0 },&quot;method&quot; : &quot;<span st=
yle=3D"color: red;"> </span><tt><span style=3D"color: black;">open-ils.auth=
.authenticate.complete</span></tt>&quot; <br>

<br>=A0 =A0 =A0 =A0 =A0 =A0} <br><br>=A0 =A0 =A0 =A0 }, <br><br>=A0 =A0 =A0=
 =A0 &quot;locale&quot; : &quot;en-US&quot;, <br><br>=A0 =A0 =A0 =A0 &quot;=
type&quot; : &quot;REQUEST&quot; <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