Good Morning everyone, I need to understand something...
I have to send data to an external webservice , which wsdl file is
https://snfl.qdecalidad.com/snfl/webserviceAgroxSNFL/ws.apps
I've created a webservice proxy and I can see everything without a problem.
I have to use the function loadtableagreements, which needs a wsagroxagreement datatype. I think this object is like an structure of strings.
I declare a variable called ls_cuerpo_contratos of the wsagroxagreements datatype. Then, from a datastore, i begin to fill the object strings, but crashes with null object reference. Do I have to initialize the structure, or the strings inside?
I paste here my code, I need to understand what i am doing wrong.
Thanks in advance, as always
decimal lc_filas_royal, i , contador
string resultado_contrato, resultado_valor, resultado_royal
long ll_filas_contratos
SoapConnection conn // Definimos conexión SOAP
webserviceagroxsnflcontrollerservice proxy_obj // Declaramos proxy
long rVal
conn = create SoapConnection //Creamos instancia de la conexión
rVal = Conn.CreateInstance(proxy_obj, &
"webserviceagroxsnflcontrollerservice")
try
//DECLARACION DE LA DW Y DE LAS VARIABLES DE CONTRATOS
ids_agreements = create u_ds
ids_agreements.DataObject = "d_snfl_listado_var"
ids_agreements.SetTransObject(sqlca)
ids_agreements.Retrieve( )
string ls_cempr_agree, ls_dempr_agree, ls_agree_agree, ls_ctn_agree, ls_datesig_agree, ls_cpropie_agree, ls_dpropie_agree,ls_cpais_agree, ls_linea_agree, ls_dpais_agree
string ls_cvaried_agree, ls_pbr_agree, ls_working_agree, ls_breeder_agree, ls_buds_agree, ls_plants_agree, ls_hectareas_agree, ls_year_plant_agree, ls_codmov_agree, ls_year_usa_agree, ls_year_act_agree, ls_movingday_agree
wsagroxagreements ls_cuerpo_contratos[]
ll_filas_contratos = ids_agreements.Rowcount( )
sle_lineas_contratos.text = string(ll_filas_contratos)
for i = 1 to ll_filas_contratos
ls_cempr_agree= trim(ids_agreements.Object.snflemplic_cempr[i])
ls_dempr_agree = trim(ids_agreements.Object.snflemplic_dempr[i])
ls_agree_agree = trim(ids_agreements.Object.snflagreement_agree[i])
ls_ctn_agree = trim(ids_agreements.Object.snflagreement_ctn[i])
ls_datesig_agree = trim(string(ids_agreements.Object.snflagreement_datesig[i]))
ls_cpropie_agree = trim(string(ids_agreements.Object.snflagreement_cpropie[i]))
ls_dpropie_agree = trim(ids_agreements.Object.snflgrower_dpropie[i])
ls_cpais_agree = trim(string(ids_agreements.Object.snflgrower_cpais[i]))
ls_dpais_agree = trim(string(ids_agreements.Object.gpaises_dpais[i]))
ls_linea_agree = trim(string(ids_agreements.Object.snfldata_linea[i]))
ls_cvaried_agree = trim(string (ids_agreements.Object.snfldata_cvaried[i]))
ls_pbr_agree = trim(string(ids_agreements.Object.snflvariety_breeder[i]))
ls_working_agree = trim(string(ids_agreements.Object.snflvariety_working[i]))
ls_breeder_agree = trim(string(ids_agreements.Object.snflvariety_pbr[i]))
ls_buds_agree = trim(string(ids_agreements.Object.snfldata_buds[i]))
ls_plants_agree = trim(string(ids_agreements.Object.snfldata_plants[i]))
ls_hectareas_agree = trim(string(ids_agreements.Object.snfldata_hectareas[i]))
ls_year_plant_agree = trim(string(ids_agreements.Object.snfldata_year_plant[i]))
ls_codmov_agree = trim(string(ids_agreements.Object.snfldata_codmov[i]))
ls_year_usa_agree =trim(string(ids_agreements.Object.snfldata_year_usa[i]))
ls_year_act_agree =trim(string(ids_agreements.Object.snfldata_year_act[i]))
ls_movingday_agree =trim(string(ids_agreements.Object.snfldata_moving_day[i]))
ls_cuerpo_contratos[i].cempr = ls_cempr_agree THIS IS THE FIRST ERROR
ls_cuerpo_contratos[i].dempr = ls_dempr_agree
ls_cuerpo_contratos[i].agree = ls_agree_agree
ls_cuerpo_contratos[i].ctn = ls_ctn_agree
ls_cuerpo_contratos[i].datesig = ls_datesig_agree
ls_cuerpo_contratos[i].cpropie = ls_cpropie_agree
ls_cuerpo_contratos[i].dpropie = ls_dpropie_agree
ls_cuerpo_contratos[i].cpais = ls_cpais_agree
ls_cuerpo_contratos[i].dpais = ls_dpais_agree
ls_cuerpo_contratos[i].linea = ls_linea_agree
ls_cuerpo_contratos[i].cvaried = ls_cvaried_agree
ls_cuerpo_contratos[i].pbr = ls_pbr_agree
ls_cuerpo_contratos[i].working = ls_working_agree
ls_cuerpo_contratos[i].breeder = ls_breeder_agree
ls_cuerpo_contratos[i].buds = ls_buds_agree
ls_cuerpo_contratos[i].plants = ls_plants_agree
ls_cuerpo_contratos[i].hectareas = ls_hectareas_agree
ls_cuerpo_contratos[i].year_plant = ls_year_plant_agree
ls_cuerpo_contratos[i].codmov = ls_codmov_agree
ls_cuerpo_contratos[i].year_usa = ls_year_usa_agree
ls_cuerpo_contratos[i].year_act= ls_year_act_agree
ls_cuerpo_contratos[i].movingday = ls_movingday_agree
sle_generados.text = string(i)
next