Problem with WEBUTIL_C_API [message #519696] |
Tue, 16 August 2011 06:27 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/b47c752f218a022b59d1319045c3c0dd?s=64&d=mm&r=g) |
asgard
Messages: 3 Registered: August 2011
|
Junior Member |
|
|
Good morning.
Sorry for my bad English.
I'm using WEBUTIL_C_API, to perform functions of a DLL coupon issuer and I try to tax problems.
problems:
1) performs the function and the application closes. The code that does this is below:
FUNCTION FUN_REDUCAO_Z (impressora varchar2) RETURN pls_integer IS
DLL_FUNCAO webutil_c_api.FunctionHandle;
lv_plist webutil_c_api.ParameterList;
param1 webutil_c_api.ParameterHandle;
ret PLS_INTEGER:=0;
BEGIN
IF IMPRESSORA ='BEMATECH' THEN
BEGIN
DLL_FUNCAO := WEBUTIL_C_API.register_function(RTRIM(LTRIM(:PARAMETER.P_CF_DIRETORIO))||'\BemaFI32.dll','Bematech_FI_ReducaoZ');
IF NOT WEBUTIL_C_API.ID_NULL(lv_plist) THEN
WEBUTIL_C_API.Destroy_Parameter_List(lv_plist);
END IF;
lv_plist := webutil_c_api.create_parameter_list;
ret := WEBUTIL_C_API.INVOKE_INT(DLL_FUNCAO, lv_plist);
WEBUTIL_C_API.Destroy_Parameter_List(lv_plist);
---SYNCHRONIZE;
RETURN ret;
EXCEPTION
WHEN OTHERS THEN
MESSAGE('ERRO REDUCAO Z:'||SQLERRM);
MESSAGE('ERRO REDUCAO Z:'||SQLERRM);
CLEAR_MESSAGE;
END;
end if;
END;
2) I am unable to receive the return of a variable that in addition to performing the function, the application also closes. The code is below:
FUNCTION fun_NumeroSerie_web ( NumeroSerie IN out VARCHAR2 , impressora in varchar2) RETURN PLS_INTEGER IS
DLL_FUNCAO webutil_c_api.FunctionHandle;
lv_plist webutil_c_api.ParameterList;
param1 webutil_c_api.ParameterHandle;
ret PLS_INTEGER:=0;
BEGIN
NumeroSerie:='';
/*FOR I IN 1..15 LOOP
NumeroSerie := NumeroSerie||' ';
END LOOP;*/
IF IMPRESSORA ='BEMATECH' THEN
BEGIN
DLL_FUNCAO := WEBUTIL_C_API.register_function(RTRIM(LTRIM(:PARAMETER.P_CF_DIRETORIO))||'\BemaFI32.dll','Bematech_FI_NumeroSerie');
IF NOT WEBUTIL_C_API.ID_NULL(lv_plist) THEN
WEBUTIL_C_API.Destroy_Parameter_List(lv_plist);
END IF;
lv_plist := webutil_c_api.create_parameter_list;
param1 := webutil_c_api.add_parameter(lv_plist,webutil_c_api.c_char_ptr,webutil_c_api.param_out,NumeroSerie,length(NumeroSerie));
ret := WEBUTIL_C_API.INVOKE_INT(DLL_FUNCAO, lv_plist);
WEBUTIL_C_API.Destroy_Parameter_List(lv_plist);
WEBUTIL_C_API.Deregister_Function(DLL_FUNCAO);
RETURN ret;
EXCEPTION
WHEN OTHERS THEN
MESSAGE('ERRO :'||SQLERRM);
MESSAGE('ERRO :'||SQLERRM);
CLEAR_MESSAGE;
END;
end if;
END;
The codes have something wrong.
I am running these functions in the web client.
|
|
|
|
Re: Problem with WEBUTIL_C_API [message #519758 is a reply to message #519713] |
Tue, 16 August 2011 13:03 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/b47c752f218a022b59d1319045c3c0dd?s=64&d=mm&r=g) |
asgard
Messages: 3 Registered: August 2011
|
Junior Member |
|
|
Michel,
Good afternoon
I am sending the formatted data.
Oracle DB version : 10.2.0.5
Operating System (OS) : Linux
Operating System Client : Microsoft Windows Server 2003 Enterprise Edition - Service Pack 2
problems:
1) performs the function and the application closes. The code that does this is below:
FUNCTION FUN_REDUCAO_Z (impressora varchar2) RETURN pls_integer IS
DLL_FUNCAO webutil_c_api.FunctionHandle;
lv_plist webutil_c_api.ParameterList;
param1 webutil_c_api.ParameterHandle;
ret PLS_INTEGER:=0;
BEGIN
IF IMPRESSORA ='BEMATECH' THEN
BEGIN
DLL_FUNCAO := WEBUTIL_C_API.register_function(RTRIM(LTRIM(:PARAMETER.P_CF_DIRETORIO))
||'\BemaFI32.dll','Bematech_FI_ReducaoZ');
IF NOT WEBUTIL_C_API.ID_NULL(lv_plist) THEN
WEBUTIL_C_API.Destroy_Parameter_List(lv_plist);
END IF;
lv_plist := webutil_c_api.create_parameter_list;
ret := WEBUTIL_C_API.INVOKE_INT(DLL_FUNCAO, lv_pl ist);
WEBUTIL_C_API.Destroy_Parameter_List(lv_plist);
SYNCHRONIZE;
RETURN ret;
EXCEPTION
WHEN OTHERS THEN
MESSAGE('ERRO REDUCAO Z:'||SQLERRM);
MESSAGE('ERRO REDUCAO Z:'||SQLERRM);
CLEAR_MESSAGE;
END;
end if;
END;
2) I am unable to receive the return of a variable that in addition to performing the function, the application also closes. The code is below:
FUNCTION fun_NumeroSerie_web ( NumeroSerie IN out VARCHAR2 ,
impressora in varchar2) RETURN PLS_INTEGER IS
DLL_FUNCAO webutil_c_api.FunctionHandle;
lv_plist webutil_c_api.ParameterList;
param1 webutil_c_api.ParameterHandle;
ret PLS_INTEGER:=0;
BEGIN
NumeroSerie:='';
FOR I IN 1..15 LOOP
NumeroSerie := NumeroSerie||' ';
END LOOP;
IF IMPRESSORA ='BEMATECH' THEN
BEGIN
DLL_FUNCAO := WEBUTIL_C_API.register_function(RTRIM(LTRIM(:PARAMETER.P_CF_DIRETORIO))
||'\BemaFI32.dll','Bematech_FI_NumeroSerie');
IF NOT WEBUTIL_C_API.ID_NULL(lv_plist) THEN
WEBUTIL_C_API.Destroy_Parameter_List(lv_plist);
END IF;
lv_plist := webutil_c_api.create_parameter_list;
param1 := webutil_c_api.add_parameter(lv_plist,webutil_c_api.c_char_ptr,webutil_c_api.param_out,NumeroSerie,length(NumeroSerie));
ret := WEBUTIL_C_API.INVOKE_INT(DLL_FUNCAO, lv_plist);
WEBUTIL_C_API.Destroy_Parameter_List(lv_plist);
WEBUTIL_C_API.Deregister_Function(DLL_FUNCAO);
RETURN ret;
EXCEPTION
WHEN OTHERS THEN
MESSAGE('ERRO :'||SQLERRM);
MESSAGE('ERRO :'||SQLERRM);
CLEAR_MESSAGE;
END;
end if;
END;
The codes have something wrong?
|
|
|
|
Re: Problem with WEBUTIL_C_API [message #519772 is a reply to message #519767] |
Tue, 16 August 2011 15:54 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](http://www.gravatar.com/avatar/b47c752f218a022b59d1319045c3c0dd?s=64&d=mm&r=g) |
asgard
Messages: 3 Registered: August 2011
|
Junior Member |
|
|
Good afternoon
Littlefoot, thanks for the tip, but the problem appears not to be, because there is another function like fun_reducao_z, which is only changed the function call this DLL and running. What I realized was that when the line is driven code ret: = WEBUTIL_C_API.INVOKE_INT (DLL_FUNCAO, lv_pl ist) runs showing the result in fiscal printer and closes the application.
|
|
|