User bio
404 bio not found
Member since Mar 2, 2016
Posts:
Ohm has not published any posts yet.
Replies:

Hi Herman,

I tried to modify my code as per your suggestions. The URLinside route is set to /UserAccounts. But, it didn't work. I have added trace elements to check what I receive.

The _tEmailID element for which I used the %request.Get, it does not receive the parameter passed to it.

The Event log for service shows that _tEmailID is empty.

 Can you have a look at my method and suggest anything if I have missed? Is it required to add any library to use %request?

Method retrieveAccount(pInput As %Library.AbstractStream, Output pOutput As %Stream.Object) As %Status
{
set status = $$$OK
try{
  SET tEmailID = %request.Get("account")
  $$$TRACE("tEmaildID = "_tEmailID)
ZNSpace "INSTATEMPNS"
&sql(SELECT EmailID,Password INTO :email,:pwd FROM InstaTemp.ISAccounts WHERE EmailID = :tEmailID )

$$$TRACE("email = "_email)
set tProxy = ##class(%ZEN.proxyObject).%New()
  IF SQLCODE'=0
 
  set tProxy.Email = tEmailID
  set tProxy.Pwd = "no password"
  set tProxy.SqlCode = SQLCODE
       }
       ELSE 
       {  
    set tProxy.Email = email
  set tProxy.Pwd = pwd
  set tProxy.SqlCode = SQLCODE 
    }
 
  //set tProxy = ##class(%ZEN.proxyObject).%New()
  //set tProxy.Email = email
  //set tProxy.Pwd = pwd
 
  // You could just write the output manually or use helper methods like ..ObjectToJSONStream() to generate JSON
  do pOutput.SetAttribute("Content-Type","application/json")
  do pOutput.Write("[")
 
  Set tOut=##class(%IO.StringStream).%New()
  do ..ObjectToJSONStream(tProxy,.tOut)
 
  do tOut.Rewind()
  do pOutput.Write( tOut.Read() )
  do pOutput.Write("]"_$C(13,10))
 
catch (e) {
set status = e.AsStatus()
}
      quit status
}

Certifications & Credly badges:
Ohm has no Certifications & Credly badges yet.
Global Masters badges:
Ohm has no Global Masters badges yet.
Followers:
Ohm has no followers yet.
Following:
Ohm has not followed anybody yet.