2
I created a COM DLL in c# VS2010 to be distributed with another application in Delphi.
This DLL only consumes on WEB Services.
On the machine where the DLL was built there is no error. But in the distribution when the DLL methods are executed the message is returned:
System cannot find specified file.
This is some configuration that should be run in the DLL configuration?
DLL code
public string RecepcionarLoteRps(string AEnderecoWebService, string AXmlEntrada)
{
string Retorno = string.Empty;
try
{
ServiceReferenceAbrasfV201.nfseClient wsClient = new ServiceReferenceAbrasfV201.nfseClient("nfseSOAP1", AXmlEntrada);
Retorno = wsClient.RecepcionarLoteRps(Cabecalho(), AXmlEntrada);
}
catch (Exception e)
{
Retorno = e.Message;
}
return Retorno;
}
Delphi code to send the parameters to dll.
var
LClientWBAws: IAbrasfV201_Interface;
LRetorno: string;
begin
LClientWBAws := CoAbrasfV201.Create;
if (Pos('ConsultarLoteRpsEnvio', LEnviaArqXml) > 0) then
begin
LRetorno := LClientWBAws.Getnfse(ALayout.Parametros['EnderecoWebService'], LEnviaArqXml);
end
else if (Pos('CancelarNfseEnvio', LEnviaArqXml) > 0) then
begin
LRetorno := LClientWBAws.CancelarNfse(ALayout.Parametros['EnderecoWebService'], LEnviaArqXml);
end
else
begin
LRetorno := LClientWBAws.RecepcionarLoteRps(ALayout.Parametros['EnderecoWebService'], LEnviaArqXml);
end;
end;
You probably have to put inside the DLL the webservice configuration file.
– Makah
But that’s already there the settings of Wsdls
– Ricardo
Put more information about your error. Is there an exception? For whom the error occurs?
– lsalamon
The DLL is Activex?
– Leonel Sanches da Silva
Gee can be so many things, some things I thought here: - Check that the dll has actually been distributed and this in the folder that the application expects it to be in. - Another thing that might happen eh if your dll has some reference and that reference is not marked to be distributed together, then your dll is going, but some dependency on it is not. has an option in the reference that says "Copy Local"
– Eduardo Bottcher
Error: Process completed with error - Technical error: System cannot find specified file.
– Ricardo
public string Recepcionarloterps(string Aenderecowebservice, string Axmlinput) { string Return = string. Empty; Try { Servicereferenceabrasfv201.nfseClient wsClient = new Servicereferenceabrasfv201.nfseClient("nfseSOAP1", Axmlinput); Return = wsClient.Recepcionarloterps(Cabecalho(), Axmlentrada); } catch (Exception e) { Return = e.Message; } Return Return; }
– Ricardo
Was imported as Activex in Delphi.
– Ricardo
I had a last minute question. The files . svcinfo and Wsdls should be distributed together with the DLL?
– Ricardo
If the only purpose of the DLL is to call this service, why not call it directly in Delphi? Delphi can also consume web services.
– Eduardo Bottcher
Usually when I find a mistake of this kind I use the Processmonitor to find out which file is trying to be accessed. 99% of the time it works.
– EMBarbosa
Take a look at the answer I posted here: http://answall.com/questions/8107/dll-c-no-delphi-7/8341#8341
– bernardbr