[OPEN-ILS-DEV] Help:opensrf over http using java

chiwe123456@gmail.com chiragahuja.nsit at gmail.com
Fri Mar 25 20:15:40 EDT 2011


I want to login through a java application



Is my Approach correct??



First I will create json object in java which is like this



(

but I don’t know how to use curl –H over here as it is a command line tool

)



curl -H "X-OpenSRF-service: open-ils.auth" --data 'osrf-msg=

[

  {  "__c" : "osrfMessage",

     "__p" : {

        "threadTrace" : 0,

        "payload" : {

           "__c" : "osrfMethod","__p" : { "params" : ["admin"],

              "method" : "open-ils.auth.authenticate.init"

           }

        },

        "locale" : "en-US",

        "type" : "REQUEST"

     }

  }

]



and then send it to url=*http://192.168.56.102/osrf-http-translator
*(192.168.56.102 is the ip address of virtual machine because I’m
accessing virtual machine services from host machine in which java
application is running)







*Response*



[

  {

     "__c" : "osrfMessage",

     "__p" : {

        "threadTrace" : 0,

        "payload" : {

           "__c" : "osrfResult",

           "__p" : {

              "status" : "OK",

              "content" : “6ba0510ab42e028e57755bf0151655ed”

              "statusCode" : 200

           }

        },

        "locale" : "en-US",

        "type" : "RESULT"

     }

  },

  {

     "__c" : "osrfMessage",

     "__p" : {

        "threadTrace" : 0,

        "payload" : {

           "__c" : "osrfConnectStatus",

           "__p" : {

              "status" : "Request Complete",

              "statusCode" : 205

           }

        },

        "locale" : "en-US",

        "type" : "STATUS"

     }

  }

]





More information about the Open-ils-dev mailing list