how to send json with url

1,179 views
Skip to first unread message

Vikram Chhajer

unread,
Nov 8, 2019, 8:34:03 AM11/8/19
to Harbour Users
Hello , 

I want to post json with the provied url  how to do this?   please help how to do ...


BODY
{
"supplyType":"O",
"subSupplyType":"1",
"subSupplyDesc":" ",
"docType":"INV",
"docNo":"111-1",
"docDate":"15/12/2017",
"fromGstin":"05AAACG1539P1ZH",
"fromTrdName":"welton",
"fromAddr1":"2ND CROSS NO 59  19  A",
"fromAddr2":"GROUND FLOOR OSBORNE ROAD",
"fromPlace":"FRAZER TOWN",
"fromPincode":263652,
"actFromStateCode":05,
"fromStateCode":05,
"toGstin":"02EHFPS5910D2Z0",
"toTrdName":"sthuthya",
"toAddr1":"Shree Nilaya",
"toAddr2":"Dasarahosahalli",
"toPlace":"Beml Nagar",
"toPincode":176036,
"actToStateCode":02,
"toStateCode":02,
"transactionType":4,
"dispatchFromGSTIN":"29AAAAA1303P1ZV",
"dispatchFromTradeName":"ABC Traders",
"shipToGSTIN":"29ALSPR1722R1Z3",
"shipToTradeName":"XYZ Traders",
"otherValue": -100,
"totalValue":56099,
"cgstValue":0,
"sgstValue":0,
"igstValue":300.67,
"cessValue":400.56,
"cessNonAdvolValue":400,
"totInvValue":68358,
"transporterId":"05AAACG1539P1ZH",
"transporterName":"",
"transDocNo":"",
"transMode":"1",
"transDistance":"656",
"transDocDate":"",
"vehicleNo":"PVC1234",
"vehicleType":"R",
"itemList":[{
"productName":"Wheat",
"productDesc":"Wheat",
"hsnCode":1001,
"quantity":4,
"qtyUnit":"BOX",
"cgstRate":0,
"sgstRate":0,
"igstRate":3,
"cessRate":0,
"cessNonAdvol":0,
"taxableAmount":56099
}]
}


Thank You 
Vikram

Diego Fazio

unread,
Nov 8, 2019, 9:10:31 AM11/8/19
to Harbour Users
cJASON = {"1231231", "seccion", "raz_empl","cel_empl", "ema_empl", "dom_empl"}
url := "xxxxxx"
oHTTP := CREATEOBJECT('Msxml2.ServerXMLHTTP.6.0')
oHTTP:OPEN("POST",  url " , .F.)
oHTTP:setRequestHeader("Content-Type", "application/json")
oHTTP:SEND(cJSON)


Diego.

Vikram Chhajer

unread,
Nov 8, 2019, 9:23:09 AM11/8/19
to Harbour Users
Thank You for your response 
But couldnt understand how to start prg can u please help  ...
oHTTP := CREATEOBJECT('Msxml2.ServerXMLHTTP.6.0')  --------------     why xml as been mentioned 

Thanks 
Vikram


On Friday, 8 November 2019 19:40:31 UTC+5:30, Diego Fazio wrote:
cJASON = {"1231231", "seccion", "raz_empl","cel_empl", "ema_empl", "dom_empl"}
url := "xxxxxx"
oHTTP := CREATEOBJECT('Msxml2.ServerXMLHTTP.6.0')  --------------     why xml as been mentioned 

Diego Fazio

unread,
Nov 8, 2019, 9:39:10 AM11/8/19
to Harbour Users
"Msxml2.ServerXMLHTTP.6.0" that is the name of the object. It has multiple functions. One of then, do what you want.

Diego.

Vikram Chhajer

unread,
Nov 8, 2019, 10:02:18 AM11/8/19
to harbou...@googlegroups.com
Thank  you
But how to start prg have to include something  else   . 



On 08-Nov-2019, at 8:09 PM, Diego Fazio <diego...@gmail.com> wrote:


--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/D49cy8tDMjk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/4c305b9c-e20a-459d-8029-107ec60c22c1%40googlegroups.com.

Diego Fazio

unread,
Nov 8, 2019, 10:57:57 AM11/8/19
to Harbour Users

//prg.prg 
function main()
local oHTTP,cJSON,url
setmode(25,80)
cJSON = '{"1231231", "seccion", "raz_empl","cel_empl", "ema_empl", "dom_empl"}'
oHTTP := CREATEOBJECT('Msxml2.ServerXMLHTTP.6.0')
oHTTP:OPEN("POST",  url , .F.)
oHTTP:setRequestHeader("Content-Type", "application/json")
oHTTP:SEND(cJSON)
IF oHTTP:status != 200
? "Error"
ELSE
? oHTTP:responseText
ENDIF
return
//end prg.prg

to compile...
hbmk2 prg.prg xhb.hbc

Diego.
Thank  you

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/D49cy8tDMjk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbou...@googlegroups.com.

Vikram Chhajer

unread,
Nov 8, 2019, 11:02:02 AM11/8/19
to harbou...@googlegroups.com
Thank you sir 
Will this work with HTTPS

Thank you
Vikram

On 08-Nov-2019, at 9:28 PM, Diego Fazio <diego...@gmail.com> wrote:



Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/D49cy8tDMjk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/9ec5c645-82bd-4bc8-9398-d580935ae9fc%40googlegroups.com.

Diego Fazio

unread,
Nov 8, 2019, 11:05:40 AM11/8/19
to Harbour Users
Yes. The example is in https.

Diego.
Thank you sir 

Vikram Chhajer

unread,
Nov 8, 2019, 12:09:57 PM11/8/19
to Harbour Users
Hi Diego 
 when i complie the prg it genrate exe but exe wont run ,whats wrong with this prg pls check .

Thanks 
Vkram
ewayjson.prg

Diego Fazio

unread,
Nov 8, 2019, 12:24:03 PM11/8/19
to Harbour Users
To test your code I need the id to use the api. 

"http://testapi.taxprogsp.co.in/ewaybillapi/dec/v1.03/ewayapi?action=GENEWAYBILL&aspid=*******&password=123456&gstin=05AAACG0904A1ZL&username=05AAACG0904A1ZL&ewbpwd=abc123@@&authtoken=4nzFjsHfRLtIWAqBUobsOIzwR"

error:
{"status_cd":"0","error":{"error_cd":"GSP001A","message":"Error: Invalid Length of 'aspid' in Request Header or Query Param."}}

Diego.

Vikram Chhajer

unread,
Nov 8, 2019, 12:31:53 PM11/8/19
to Harbour Users
Diego 
Pls Find the attchment 

Thanks
VIkram
ewayjson.prg

Diego Fazio

unread,
Nov 8, 2019, 12:38:28 PM11/8/19
to Harbour Users
It works....but there is a problem with the data you send....

Error
{"status_cd":"0","error":{"error_cd":"604,","message":"604: E-way bill(s) are al
ready generated for the same document number, you cannot generate again on same
document number\r\n"}}

Please add this to the prg.prg

IF oHTTP:status != 200
? "Error"
? oHTTP:responseText       <-----
ELSE

So you will see the errors that the api send you.

Diego.

Vikram Chhajer

unread,
Nov 8, 2019, 12:47:46 PM11/8/19
to Harbour Users
Thank You Sir , Done !!!! 

Vikram Chhajer

unread,
Nov 8, 2019, 12:58:20 PM11/8/19
to Harbour Users
SIr One More Thing 
While Importing the response getting  error

Vikram
ewayjson.prg
ERRor.PNG

Diego Fazio

unread,
Nov 8, 2019, 1:06:48 PM11/8/19
to Harbour Users
The response return in oHTTP:responseText

if you want to save that to a file

hb_memowrit("response.txt,oHTTP:responseText)

Diego.

Diego Fazio

unread,
Nov 8, 2019, 1:07:46 PM11/8/19
to Harbour Users
hb_memowrit("response.txt",oHTTP:responseText)

Vikram Chhajer

unread,
Nov 8, 2019, 1:11:58 PM11/8/19
to Harbour Users
Thank You Once Again 

Done 

Vikram

Cristian Francolino

unread,
Nov 8, 2019, 3:27:59 PM11/8/19
to harbou...@googlegroups.com

Hi Diego.

How can I check if the connection was established correctly?

Program crashs at SEND if there is no internet connection and the OPEN method returns NIL.

Thanks

Cristian

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/84e849e6-523d-4fe8-ab8a-b2b701eb44ee%40googlegroups.com.

Diego Fazio

unread,
Nov 8, 2019, 4:36:09 PM11/8/19
to Harbour Users
Hi, maybe with a "BEGIN SEQUENCE"(try, catch) 
And you could check internet connection too, with...

   nFlags := -1
   ? CallDll32( "InternetGetConnectedState", "wininet.dll", @nFlags, 0 )
   ? nFlags

Diego.



Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbou...@googlegroups.com.

Anupam

unread,
Nov 9, 2019, 1:46:44 AM11/9/19
to Harbour Users
Dear Vikram ji

I am also interested to integrated ewaybill generation please share your experience step by step and send me your mail id at anupamgaurav22 at gmail.com

Thanks & Regards,
Anupam


Bharat Shah

unread,
Nov 9, 2019, 4:05:52 AM11/9/19
to harbou...@googlegroups.com
Hi Vikram,

Please share your latest code.

Thanks and regards

Bharat

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/0d1f5e09-d2a0-48a4-aec9-d805f266f5dc%40googlegroups.com.

Vikram Chhajer

unread,
Nov 9, 2019, 4:16:00 AM11/9/19
to Harbour Users
Hi Bharat 
 Prg Already in in this group under topic how to send json with url  you can check and any futher things how to get api  can help . please share your mobile no  and i will guide you .

Thanks 
Vikram 





On Saturday, 9 November 2019 14:35:52 UTC+5:30, Bharat Shah wrote:
Hi Vikram,

Please share your latest code.

Thanks and regards

Bharat

On Sat, Nov 9, 2019 at 12:16 PM Anupam <anupamg...@gmail.com> wrote:
Dear Vikram ji

I am also interested to integrated ewaybill generation please share your experience step by step and send me your mail id at anupamgaurav22 at gmail.com

Thanks & Regards,
Anupam


--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbou...@googlegroups.com.

Koshal Agarwal

unread,
Nov 11, 2019, 8:49:42 AM11/11/19
to Harbour Users
nine seven six double zero 20575 koshal u r from which city

Vikram Chhajer

unread,
Nov 12, 2019, 6:49:08 AM11/12/19
to Harbour Users
Hello Diego 

Sir Not able to genrate json  , getting error : MESSAGE  "THE requested resource does not support hhtp method "post" 
pls help to solve the error

proc sewaybill
LOCAL h
LOCAL a1:={}
LOCAL a2:={}
LOCAL a3:={}
*
sele pm
set order to 1
seek m_p_cd
sele state
set order to 1
seek pm->state
m_pstate    = alltrim(subs(desc,4))
m_dispstate = alltrim(subs(desc,4))
m_shipstate = alltrim(subs(desc,4))
m_pstate = val(state)
*
sele stn
set order to 1
seek pm->st_cd
*
a1 = {}
sele sal
fr = .f.
sele state
set order to 1
seek co->state
m_costate   = alltrim(subs(desc,4))
m_dispstate = alltrim(subs(desc,4))

if !empty(m_con_cd)
   sele con
   set order to 1
   seek m_con_cd
   m_pstate = val(state)
   sele state
   set order to 1
   seek con->state
   m_shipstate = desc
endif
sele trsp
set order to 1
seek m_tr_cd
*
sele sal
m_cent_tp = ent_tp
m_cent_no = ent_no
if m_ent_tp  = _trn_fs
   m_cent_tp = _trn_chl
   m_cent_no = cno
endif
m_invval   = net
m_btxblamt = txblamt
m_bsgst    = sgstamt
m_bcgst    = cgstamt
m_bigst    = igstamt
m_cess     = 0
*
m_supply = "O" && "Outward"
*
m_subtype = 1
m_doctype = "INV"
*
m_fadr1  = alltrim(co->adr1) + ' ' + alltrim(co->adr2)
m_fadr2  = alltrim(co->adr3)  && + ' ' + alltrim(co->adr4)
m_city   = alltrim(co->city)
m_state  = val(co->state)
m_pin    = val(alltrim(co->pin))
m_station= val(co->state)
m_pmadr1 = alltrim(pm->adr1) + ' ' + alltrim(pm->adr2)
m_pmadr2 = alltrim(pm->adr3) && + ' ' + alltrim(pm->city)
m_cogstin= alltrim(co->gstin)
//
//alerT(sal->ent_no+"  A")
sele st
set order to 1
seek m_cent_tp + m_cent_no
sele qm
set order to 1
seek st->q_cd
m_mainhsn = val(alltrim(qm->chapter))
*
sele st
store 0 to tot_txbl,tot_cgst,tot_sgst,tot_igst,m_sr
do whil ent_tp = m_cent_tp .and. ent_no = m_cent_no
   sele qm
   set order to 1
   seek st->q_cd
   **
   sele st
   lrecno = recno()
   sele st
   set order to 1
   seek m_cent_tp + m_cent_no
   tot_mtr = 0
   do whil ent_tp = m_cent_tp .and. ent_no = m_cent_no
      tot_mtr = tot_mtr + mtr
      skip
   enddo
   *
   sele st
   set order to 1
   go lrecno
   *
   sele sal
   m_gross = gross
   m_adl = 0
   m_tper = 5
   m_adl = addless - (less+cdamt + bamt)
   m_tper = tper
   *
   m_alper = (m_adl/m_gross)*100
   *m_tper  = tper
   *
   sele st
   m_alamt   = (amt*m_alper)/100
   m_txblamt = amt + m_alamt
   m_txblamt = val(str(m_txblamt,13,2))
   *
   m_totval  = amt
   *
   store 0 to m_sgst,m_cgst,m_igst,m_cess
   store 0 to m_cgstper,m_sgstper,m_igstper
   if co->state # pm->state
      *m_igst  = (m_txblamt*sal->igstper)/100
      m_igst  = (m_txblamt*m_tper)/100
      m_igstper = m_tper
   else
      *m_tamt  = (m_txblamt*sal->tper)/100
      m_tamt  = (m_txblamt*m_tper)/100
      m_inta  = str(int(m_tamt))
      m_tamt  = str(m_tamt,11,2)
      m_dec   = right(m_tamt,2)
      m_sgstper = (m_tper/2)
      m_cgstper = (m_tper/2)
      *
      l_dec   = m_dec
      *
      if right(m_dec,1) = '1' .or. right(m_dec,1) = '3'  .or. right(m_dec,1) = '5'  .or. right(m_dec,1) = '7'  .or. right(m_dec,1) = '9'
         m_dec = val(subs(m_dec,2,1)) + 1
         m_dec = str(int(m_dec))
         m_dec = subs(l_dec,1,1) + alltrim(m_dec)
         m_dec = val(m_dec)
         m_dec = alltrim(str(int(m_dec)))
      endif
      m_tamt = m_inta + '.' + m_dec
      m_tamt = val(m_tamt)
      m_cgst = m_tamt/2
      m_sgst = m_tamt/2
   endif
   m_tper = str(m_sgstper,5,2) + '+' + str(m_cgstper,5,2) + '+' + str(m_igstper,5,2) + '+' + str(m_cess,5,2)
   *
   m_taxamt = m_cgst+m_sgst+m_igst+m_cess
   m_txblamt = val(str(m_txblamt,11,2))
   m_cgst    = val(str(m_cgst,11,2))
   m_sgst    = val(str(m_sgst,11,2))
   m_igst    = val(str(m_igst,11,2))
   m_taxamt  = val(str(m_taxamt,11,2))
   *
   tot_txbl  = tot_txbl + m_txblamt
   tot_cgst  = tot_cgst + m_cgst
   tot_sgst  = tot_sgst + m_sgst
   tot_igst  = tot_igst + m_igst
   *
   sele st
   skip
   if ent_tp # m_cent_tp .or. ent_no # m_cent_no
      m_txbld = m_btxblamt - tot_txbl
      m_cgstd = m_bcgst    - tot_cgst
      m_sgstd = m_bsgst    - tot_sgst
      m_igstd = m_bigst    - tot_igst
      *
      m_txblamt = m_txblamt + m_txbld
      m_cgst    = m_cgst    + m_cgstd
      m_sgst    = m_sgst    + m_sgstd
      m_igst    = m_igst    + m_igstd
      m_taxamt  = m_cgst + m_sgst + m_igst
   endif
   m_cess = 0.00
   *
   sele st
   skip - 1
   *
   sele st
   m_sr = m_sr + 1
   **
   sele st
   m_unit = 'MTR'
   if rp = 'M'
      m_unit = 'MTR'
   endif
   if rp = 'K'
      m_unit = 'KGS'
   endif
   if rp = 'Y'
      m_unit = 'YDS'
   endif
   **
   a3:= {"itemNo"=>m_sr,"productName"=>"Fabric","productDesc"=>"Fabric","hsnCode"=>val(alltrim(qm->chapter)),;
         "quantity"=>st->mtr,"qtyUnit" =>m_unit,"taxableAmount"=>m_txblamt,;
         "sgstRate"=>sal->sgstper,"cgstRate"=>sal->cgstper,"igstRate"=>sal->igstper,"cessRate"=>m_cess}
           aadd(a1,a3)
   skip
enddo
//
m_lrdt = ''
set date brit
m_docdt= dtoc(sal->dt)
if !empty(sal->lrdt)
   m_lrdt = dtoc(sal->lrdt)
endif
set date ansi
a3 := {"supplyType"=>m_supply,"subSupplyType"=>m_subtype,;
       "docType"=>m_doctype, "docNo"=>alltrim(sal->ent_no), "docDate"=>m_docdt,;
       "fromGstin"=>alltrim(co->gstin), "fromTrdName"=>alltrim(co->desc),"fromAddr1"=>m_fadr1,;
       "fromAdd2"=>m_fadr2, "fromPlace"=>m_city, "fromPincode"=>m_pin, "fromStateCode"=>val(co->state),;
       "actualFromStateCode"=>m_state, "toGstin"=>alltrim(pm->gstin),"toTrdName"=>alltrim(pm->desc),;
       "toAddr1"=>m_pmadr1,"toAddr2"=>m_pmadr2,"toPlace"=>alltrim(pm->adr3), "toPincode"=>val(alltrim(pm->pin)),;
       "toStateCode"=>val(pm->state), "actualToStateCode"=>m_pstate,"totalValue"=>m_btxblamt,;
       "cgstValue"=>m_bcgst, "sgstValue"=>m_bsgst, "igstValue"=>m_bigst,"cessValue"=>m_cess,;
       "totInvValue"=>sal->net,"transMode"=>1, "transDistance"=>pm->distance,"transporterName"=>alltrim(trsp->desc),;
       "transporterId"=>alltrim(trsp->gstin), "transDocNo"=>alltrim(sal->lrno),"transDocDate"=>m_lrdt,;
       "vehicleNo"=>alltrim(sal->vehno), "vehicleType"=>"R", "mainHsnCode"=>m_mainhsn,"ItemList"=>a1}
 //alerT(sal->ent_no+"  B")
 aadd(a2,a3)
 set date ansi
sele sal
h := { => }
h ["version"]   := "1.0.0618"
h ["billLists"] := a2
//memowrit("E-WayBill_JSON.json",hb_jsonEncode( h, .t.))
if .not. writestream("ewaybill.json", hb_jsonEncode(h, .t.))
   alert("Error writing file "+str(FError()) )
endif
copy file "ewaybill.json" to "ewaybill.txt"
sele rsp
fillock()
dele all
appe from ewaybill sdf
unlock
go bott
skip -2
fillock()
dele
unlock
skip
fillock()
dele
unlock

Diego Fazio

unread,
Nov 12, 2019, 6:58:34 AM11/12/19
to Harbour Users
Hi, I can not help you if you do not resume your code(only importants parts) and show me exactly where exactly you get that message(error). 

Diego.
Message has been deleted

Juan Francolino

unread,
Nov 12, 2019, 7:41:11 AM11/12/19
to harbou...@googlegroups.com

Hi

we have had that problem in some servers and we use the PUT method.


Regards,

Juan Francolino


Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/30bef7f7-713a-4573-9427-623c595bf297%40googlegroups.com.

Vikram Chhajer

unread,
Nov 12, 2019, 8:02:41 AM11/12/19
to Harbour Users
Sorry For That 

VIKRAM

Bharat Shah

unread,
Nov 12, 2019, 11:13:30 AM11/12/19
to harbou...@googlegroups.com
Hi

my mobile no is 9408484113

regards


Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/d167bd88-6308-4191-9f1f-2407d6e63ff6%40googlegroups.com.

Vikram Chhajer

unread,
Nov 17, 2019, 1:18:32 AM11/17/19
to Harbour Users
Diego Are U Online Now
Can u please connect thru team veiwer need  a help cannot identify the error all json are creating proper but get post error

Thanks 
Vikram 

Diego

unread,
Nov 17, 2019, 8:04:33 AM11/17/19
to harbou...@googlegroups.com

Hi, Vikram, send me a simple example(just the json and the url) with the error and I'll help you.

Diego

El 17 nov. 2019, a la(s) 03:18, Vikram Chhajer <vikram...@gmail.com> escribió:


Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/D49cy8tDMjk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/6e39feb8-c118-48a4-aeb5-121a63fd9916%40googlegroups.com.

Vikram Chhajer

unread,
Nov 17, 2019, 9:32:03 AM11/17/19
to Harbour Users
Deigo 

Thanks For your moral Suport  , Mostly Problem Is solved . 

Thanks 
Vikram
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/D49cy8tDMjk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/6e39feb8-c118-48a4-aeb5-121a63fd9916%40googlegroups.com.

Vikram Chhajer

unread,
Nov 18, 2019, 12:45:51 PM11/18/19
to Harbour Users
Hello Deigo 

Pls Help Me to solve the problem , check the prg .
My Problem is that i want to add bot json in one cjson , want on screen what json and url are posting .

Thanks 
Vikram


On Sunday, 17 November 2019 18:34:33 UTC+5:30, Diego wrote:
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/D49cy8tDMjk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/6e39feb8-c118-48a4-aeb5-121a63fd9916%40googlegroups.com.
eway.prg

Vikram Chhajer

unread,
Nov 19, 2019, 6:39:12 AM11/19/19
to Harbour Users
Hello Deigo 

Prg File is Attached in last message . Actully problem is that when i m posting the url and json the error comes  . and when i asked the service provider whats the error is , he told me that while posting the data on url their must be some error in data . so i want to check  whats the data is genratd in json  . so iwant to see on screen while genrating the json and put json in some text file so can compare json whith the service providers json .and one more thing i have define some   AArey but could not add 2aarey in one , ithink their some mistake . pls help me to solve the errror
  

Thanks 
Vikram

On Sunday, 17 November 2019 18:34:33 UTC+5:30, Diego wrote:
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/D49cy8tDMjk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/6e39feb8-c118-48a4-aeb5-121a63fd9916%40googlegroups.com.

Diego Fazio

unread,
Nov 19, 2019, 7:00:58 AM11/19/19
to Harbour Users
Vikram, You need to send a Json, so the string you prepare must be like this...
      
               
cJSON = '{"1231231", "seccion", "raz_empl","cel_empl", "ema_empl", "dom_empl"}'
not like you do...

cJSON = {"1231231", "seccion", "raz_empl","cel_empl", "ema_empl", "dom_empl"}

closure between ' ' 

Diego.

Fausto Trautwein

unread,
Nov 19, 2019, 7:11:17 AM11/19/19
to Harbour Users
Hello.

Please try the attached prg.

The response is:

{
  "status_cd": "0",
  "error": {
    "error_cd": "GSP102",
    "message": "Error: EWB AuthToken not found or expired. Please call Authenticate API"
  }
}

You need another token,

Regards,

Fausto Di Creddo Trautwein
eway.prg

Vikram Chhajer

unread,
Nov 19, 2019, 7:12:24 AM11/19/19
to Harbour Users


On Tuesday, 19 November 2019 17:30:58 UTC+5:30, Diego Fazio wrote:
Vikram, You need to send a Json, so the string you prepare must be like this...

Diego 
      

But How to add arrey in One .     i want to check  whats the data is genratd in json  . so iwant to see on screen while genrating the json and put json in some text file so can compare json whith the service providers json .and one more thing i have define some   AArey but could not add 2aarey in one 

Thanks 
Vikram

Diego Fazio

unread,
Nov 19, 2019, 7:28:46 AM11/19/19
to Harbour Users
Fausto, posted an option. A Really good one. 

Diego.

Vikram Chhajer

unread,
Nov 19, 2019, 7:38:11 AM11/19/19
to Harbour Users
Thank You Sir 
But Getting this error {"status_cd":"0","error":{"error_cd":"233,","message":"233: Eway bill does not contains any items\r\n"}}

vikram

Vikram Chhajer

unread,
Nov 19, 2019, 7:41:45 AM11/19/19
to Harbour Users
eway.prg

Vikram Chhajer

unread,
Nov 19, 2019, 7:43:37 AM11/19/19
to Harbour Users
Thank you 
getting this error {"status_cd":"0","error":{"error_cd":"233,","message":"233: Eway bill does not contains any items\r\n"}}

vikram

On Tuesday, 19 November 2019 17:41:17 UTC+5:30, Fausto Trautwein wrote:
eway.prg

Fausto Trautwein

unread,
Nov 19, 2019, 7:52:29 AM11/19/19
to Harbour Users
Sorry, itemList must be an array.

Try again the attached file.

Fausto
eway.prg

Vikram Chhajer

unread,
Nov 19, 2019, 8:04:12 AM11/19/19
to Harbour Users
Thank you sir 
hope got done and will try in my application and will update.

Once Again Thank You to all Harbour Experts 

Vikram

Vikram Chhajer

unread,
Nov 25, 2019, 1:30:06 AM11/25/19
to Harbour Users
Thank You  Fausto & All Habour Experts 

Have Done Sucessfully . 

One More Thing when ruuning the prg with production url  and error comes   

  Subsystem Call ....: BASE
System Code .......: 1081
Default Status ....: .F.
Description .......: Operation not supported
Operation .........: TIPCLIENTHTTP:new()
Arguments .........:  [ 1] = Type: O Val: { TIPCLIENTHTTP Object } [ 2] = Type: C Val: 
Involved File .....: 
Dos Error Code ....: 0
 Trace Through:



As Asked My Service Provider the error occurs then he gave me   some code and said to insert in prg   now my question is where to inseart htis codes and will this code support with harbour 


  InitializeComponent();
            //To avoid TLS 1.2 Connection error, write provided below code As per .Net version

            //for .Net framework 4.6 and above TLS1.2 is already supported 

            //for .Net framework 4.5
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

//for .Net framework 4.0
//ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;


Thanks 

Vikram 

Vikram Chhajer

unread,
Nov 25, 2019, 7:37:19 AM11/25/19
to Harbour Users
HELLO  Fausto
Thanks for the soloution your prg run in sandbox perfectly now am running the prg in production and now getting some issue while running the prg 
getting error  : 

Operation not Supported :
TIPCLIENTHTTP:new()

Please help me to solve this error

Thanks
Vikram
Http.prg

Fausto Trautwein

unread,
Nov 25, 2019, 9:30:09 AM11/25/19
to Harbour Users
Hello.

Please try this prg.

Fausto
Http.prg

Vikram Chhajer

unread,
Nov 25, 2019, 9:40:53 AM11/25/19
to Harbour Users
Thank you sir

After Compling getting error 

The Code Execution cannot proceed because Libeay32.dll was not found . Reinstalling the program may fix this problem


ThankS
Vikram

Guillermo Varona Silupú

unread,
Nov 25, 2019, 10:02:39 AM11/25/19
to harbou...@googlegroups.com

Try this:

In my case i have hb32 Nighty with MinGW installed on drive C. You have set the path to the folder BIN of you compiler C

D:\tests>set path=c:\hb32\comp\mingw\bin;%PATH%
D:\tests>http

response.txt:

{"status_cd":"0","error":{"error_cd":"GSP019E","message":"Error: Insufficient EWB API Credit. Please contact Provider."}}

BR

GVARONAS


Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/07c102c9-13b1-4a7a-8ffc-b2930159dbe0%40googlegroups.com.

Vikram Chhajer

unread,
Nov 25, 2019, 10:13:41 AM11/25/19
to Harbour Users
Thank You Sir
Can't change complier , using hb 3.2

Thanks 
Vikram

Diego Fazio

unread,
Nov 25, 2019, 10:23:54 AM11/25/19
to Harbour Users
You have an old harbour hbssl version. 
Give an email to send you the .dll file

Diego.

Vikram Chhajer

unread,
Nov 25, 2019, 10:26:23 AM11/25/19
to Harbour Users
Thanks  Diego
Vikram

Guillermo Varona Silupú

unread,
Nov 25, 2019, 10:34:56 AM11/25/19
to harbou...@googlegroups.com

Dear Vikram:

I only reference the C compiler, the folder \hb32\comp\mingw\bin have the files DLL required for the http.exe.
So, or copy the DLLs to the folder that has the EXE or configure the PATH to point to the folder that contains those DLLs

BR

GVARONAS

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.

Vikram Chhajer

unread,
Nov 25, 2019, 12:27:27 PM11/25/19
to Harbour Users
Sorry Sir 

Vikram Chhajer

unread,
Nov 25, 2019, 1:00:19 PM11/25/19
to Harbour Users
Hello 
When Tring to sting Url then error occurs 

Subsystem Call ....: BASE
System Code .......: 1081
Default Status ....: .F.
Description .......: Operation not supported
Operation .........: TIPCLIENTHTTP:new()
Arguments .........:  [ 1] = Type: O Val: { TIPCLIENTHTTP Object } [ 2] = Type: C Val: https
Involved File .....: 
Dos Error Code ....: 0
 Trace Through:
----------------
(b)MAIN               :       8 in Module: fa.prg
TIPCLIENT:NEW         :       0 in Module: hbtip\client.prg
TIPCLIENTHTTP:NEW     :       0 in Module: hbtip\httpcli.prg
FA162                 :      11 in Module: fa162.prg
FA16                  :      19 in Module: fa16.prg
FA1                   :      59 in Module: fa1.prg
MENU                  :     396 in Module: faproc.prg
FA                    :     631 in Module: fa.prg
MAIN                  :      57 in Module: fa.prg




While I am Using This Prg 


proc fa162

//LOCAL oHttp, cHtml, hQuery, aLink, oNode, oDoc
Local oHttp, cHtml 
sele 0
use ewayapi index ewayapi alias apm
m_api = alltrim(balapi) + '&aspid=' + alltrim(aspuid) + '&password=' + alltrim(asppsw)
? m_api
wt = inkey() 
*
oHttp := TIPClientHTTP():new("&m_api")
If oHttp:open()
cHtml := oHttp:readAll()
EndIf
oHttp:close()
if file("response.txt")
          ferase("response.txt")
       endif
? oHTTP:lastErrorMessage
   hb_memowrit("response.txt",cHtml)
   *
   RETURN
**************
Without String the prg runs perfect and with string it give error

Thanks 
Vikram,

Diego Fazio

unread,
Nov 25, 2019, 1:12:05 PM11/25/19
to Harbour Users
Try...

oHttp := TIPClientHTTP():new(m_api)

Diego.

      m_dec   = right(m_tamt,2)</div

Vikram Chhajer

unread,
Nov 25, 2019, 1:15:10 PM11/25/19
to Harbour Users
Same Error Display on Screen

Diego Fazio

unread,
Nov 25, 2019, 1:18:17 PM11/25/19
to Harbour Users
Check it...


m_api = alltrim(balapi) + '&aspid=' + alltrim(aspuid) + '&password=' + alltrim(asppsw)

https://api.taxprogsp.co.in/v1.03/dec/authenticate?aspid=1605181118&password=vikram@123&gstin=05AAACG0904A1ZL&username=05AAACG0904A1ZL&ewbpwd=abc123@@

Diego.

Vikram Chhajer

unread,
Nov 25, 2019, 1:24:45 PM11/25/19
to Harbour Users

Diego Fazio

unread,
Nov 25, 2019, 1:48:56 PM11/25/19
to Harbour Users
Pass the & simbol as a chr code. CHR(38)


Diego.

Vikram Chhajer

unread,
Nov 25, 2019, 1:51:48 PM11/25/19
to Harbour Users
Same Error

Diego Fazio

unread,
Nov 25, 2019, 2:02:35 PM11/25/19
to Harbour Users
I did not see the url. 
I think TIPClientHTTP does not support HTTPS.

Try change the url with HTTP instead HTTPS

Diego.

Vikram Chhajer

unread,
Nov 25, 2019, 2:06:39 PM11/25/19
to Harbour Users
The Url Wont Work Without HTTPS  


Vikram

Vikram Chhajer

unread,
Nov 25, 2019, 2:15:14 PM11/25/19
to Harbour Users
Sir  Done  A one Mistake was done by me  , i didn't use
  REQUEST __HBEXTERN__HBSSL__
in my prg 


proc fa162
REQUEST __HBEXTERN__HBSSL__

//LOCAL oHttp, cHtml, hQuery, aLink, oNode, oDoc
Local oHttp, cHtml 
sele 0
use ewayapi index ewayapi alias apm
m_api = alltrim(balapi) + 'aspid=' + alltrim(aspuid) + CHR(38)+'password=' + alltrim(asppsw)
? m_api
wt = inkey() 
*
// oHttp := TIPClientHTTP():new(m_api)
oHttp := TIPClientHTTP():new("&m_api")
If oHttp:open()
cHtml := oHttp:readAll()
EndIf
oHttp:close()
if file("response.txt")
          ferase("response.txt")
       endif

Thanks Sir Diego

Vikram Chhajer

unread,
Dec 13, 2019, 10:00:39 AM12/13/19
to Harbour Users
Hello Sir 
trying to decode json but not able to decode , exe  creates but no action .What is wrong with this prg Sir please check and help me

Thanks
Vikram
json.prg
gst.json

Vikram Chhajer

unread,
Dec 13, 2019, 10:08:11 AM12/13/19
to Harbour Users
Hello Sir 
trying to decode json but not able to decode , exe  creates but no action .What is wrong with this prg Sir please check and help me

Thanks
Vikram
 


On Tuesday, 26 November 2019 00:32:35 UTC+5:30, Diego F wrote:
gst.json
json.prg
MAIN.HBP

Diego F

unread,
Dec 13, 2019, 11:27:01 AM12/13/19
to Harbour Users
RETURN ( hb_HGetDef( hJson[ "streams" ][ 2 ], "bit_rate" , "" ) )   <- here is the error.

I do not understand what you are trying to do.

Diego.

Diego F

unread,
Dec 13, 2019, 12:07:43 PM12/13/19
to Harbour Users
For example

RETURN ( hb_HGetDef( hJson, "gstin" , "" ) )

Diego.

Vikram Chhajer

unread,
Dec 13, 2019, 12:12:49 PM12/13/19
to Harbour Users
Sir 
Actually I want to Export json to excel or dbf file  . what ever Json Is In Current Directory just read the json and export to excel  or dbf 
Some Thing Like Attached Excel . This Is done From third Party Utlility .

Thanks 
gst.csv

Klas Engwall

unread,
Dec 13, 2019, 2:58:53 PM12/13/19
to harbou...@googlegroups.com
Hi Diego, Vikram,

> RETURN ( hb_HGetDef( hJson[ "streams" ][ 2 ], "bit_rate" , "" ) )   <-
> here is the error.

Diego: Maybe you should clarify that the keywords Vikram is looking for
do not exist at all in the json file :-)

Vikram: Install a json formatter in your web browser and investigate the
structure of the file using it. There is nothing like what you are
looking for in the gst.json file. Instead, the main keywords are:

gstin - a string
fp - a string
bsb - an array of elements called 0, 1, 2 etc

And those elements have a structure in four of five levels, so you need
to dig deeper into the file - and use the correct keywords.

Regards,
Klas

Anupam

unread,
Dec 14, 2019, 12:47:55 PM12/14/19
to Harbour Users
Hello Vikram Ji

Try blow code 

PROCEDURE main(cPathFileAndName)
   Local h, hB2b
   LOCAL hJson := {=>}

   setmode( 300,140)
   hb_Default( @cPathFileAndName , "gst.json" )
  //above set is just to comply with the .json file you have posted. change (or remove) it as needed..

   IF ! hb_FileExists( (cPathFileAndName) )

     RETURN ""

   ENDIF

   
   hb_jsonDecode( MemoRead( cPathFileAndName ), @hJson )
   
   ?"GSTIN    : "+hJson["gstin"]
   ?"Month    : "+hJson["fp"   ]
   ?
   for each hB2b in hJson["b2b"]
      ?"GSTIN  : "+hB2b["ctin"]+space(10)
      ??"No. of Invoice : "+str(len(hB2b["inv"]),2)

      
      ?  padr("Bill No.",16)+ padc("bill_date",12)+ padl("bill_amt",15)+" "
      ?
      for each h in hB2b["inv"] //["itms"][1]["item"
         ?? padr( h["inum"] ,16  )
         ?? padc( h["idt" ] ,12  )
         ?? str(  h["val" ] ,15,2)+" "
         ?
      next
      ?
   next
   
   inkey(0)
RETURN 

 
With Regards,
Anupam


Vikram Chhajer

unread,
Dec 14, 2019, 1:22:05 PM12/14/19
to Harbour Users
Thank You 
Anupam Ji

Vikram Chhajer

unread,
Dec 14, 2019, 1:30:44 PM12/14/19
to Harbour Users
Anupam Ji 
One Thing More i need If i put any json in folder , programm reads the json and output whatever is in json to excel . 

Thanks
Vikram


On Saturday, 14 December 2019 23:17:55 UTC+5:30, Anupam wrote:
EwayDetail.json

Vikram Chhajer

unread,
Dec 16, 2019, 12:37:58 AM12/16/19
to Harbour Users
Hello 
while trying to run this prg getting error  "The Data necessary to complete this operation is not yet avilable "
what is error in this prg  

Thanks 
Vikram
bill.PRG
Reply all
Reply to author
Forward
0 new messages