14-01-2025, Saat: 21:19
Merhaba.
wsdl xml web servisten veri çekmeye çalışıyorum ne yaparsam yapayım delphi tarafında verileri çekemedim.
Verdiği hata Project Project1.exe raised exception class ENetHTTPClientException with message 'Error sending data: (12007) Sunucu adı veya adresi çözümlenemedi'.
Sunucu adresinde hiçbir problem yok.
SOAPUI aracı ile sorunsuz olarak verileri alabiliyorum.
Delphi 12.2 versiyonu kullanıyorum.
metodum bu şekilde.
aşağıda da wsdl importer ile indirdiğim kısım var.
wsdl importer ile oluşan dosya (ip adresini ** yaptım normalde doğru adres var orada)
wsdl xml web servisten veri çekmeye çalışıyorum ne yaparsam yapayım delphi tarafında verileri çekemedim.
Verdiği hata Project Project1.exe raised exception class ENetHTTPClientException with message 'Error sending data: (12007) Sunucu adı veya adresi çözümlenemedi'.
Sunucu adresinde hiçbir problem yok.
SOAPUI aracı ile sorunsuz olarak verileri alabiliyorum.
Delphi 12.2 versiyonu kullanıyorum.
metodum bu şekilde.
aşağıda da wsdl importer ile indirdiğim kısım var.
uses InvoicesService;
procedure TForm2.Button1Click(Sender: TObject);
var
servis:IInvoicesService;
fatura:getInvoicesWithDetailsResult;
begin
servis:=GetIInvoicesService(true);
fatura:=servis.getInvoicesWithDetails('kullancıadı','sifre');
end;
wsdl importer ile oluşan dosya (ip adresini ** yaptım normalde doğru adres var orada)
unit InvoicesService;
interface
uses Soap.InvokeRegistry, Soap.SOAPHTTPClient, System.Types, Soap.XSBuiltIns;
const
IS_OPTN = $0001;
IS_REF = $0080;
type
getInvoicesWithDetailsResult = TXMLData; { "http://tempuri.org/"[CplxMxd] }
getInvoiceResult = TXMLData; { "http://tempuri.org/"[CplxMxd] }
getInvoiceWithDetailResult = TXMLData; { "http://tempuri.org/"[CplxMxd] }
getInvoicesResult = TXMLData; { "http://tempuri.org/"[CplxMxd] }
// ************************************************************************ //
// ************************************************************************ //
IInvoicesService = interface(IInvokable)
['{086E0D8F-2BC0-9B64-6E7F-811659574CDC}']
function getInvoices(const username: string; const password: string): getInvoicesResult; stdcall;
function getInvoicesWithDetails(const username: string; const password: string): getInvoicesWithDetailsResult; stdcall;
function setAsReceived(const username: string; const password: string; const invoiceId: Integer): Boolean; stdcall;
function getInvoice(const username: string; const password: string; const invoiceId: Integer): getInvoiceResult; stdcall;
function getInvoiceWithDetail(const username: string; const password: string; const invoiceId: Integer): getInvoiceWithDetailResult; stdcall;
end;
function GetIInvoicesService(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): IInvoicesService;
implementation
uses System.SysUtils;
function GetIInvoicesService(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): IInvoicesService;
const
defWSDL = 'http://100.**.**.12/InvoicesService.svc?singleWsdl';
defURL = 'http://100.**.**.12/InvoicesService.svc';
defSvc = 'InvoicesService';
defPrt = 'WSHttpBinding_IInvoicesService';
var
RIO: THTTPRIO;
begin
Result := nil;
if (Addr = '') then
begin
if UseWSDL then
Addr := defWSDL
else
Addr := defURL;
end;
if HTTPRIO = nil then
RIO := THTTPRIO.Create(nil)
else
RIO := HTTPRIO;
try
Result := (RIO as IInvoicesService);
if UseWSDL then
begin
RIO.WSDLLocation := Addr;
RIO.Service := defSvc;
RIO.Port := defPrt;
end else
RIO.URL := Addr;
finally
if (Result = nil) and (HTTPRIO = nil) then
RIO.Free;
end;
end;
initialization
{ IInvoicesService }
InvRegistry.RegisterInterface(TypeInfo(IInvoicesService), 'http://tempuri.org/', 'utf-8');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(IInvoicesService), 'http://tempuri.org/IInvoicesService/%operationName%');
InvRegistry.RegisterInvokeOptions(TypeInfo(IInvoicesService), ioDocument);
InvRegistry.RegisterInvokeOptions(TypeInfo(IInvoicesService), ioSOAP12);
{ IInvoicesService.getInvoices }
InvRegistry.RegisterMethodInfo(TypeInfo(IInvoicesService), 'getInvoices', '',
'[ReturnName="getInvoicesResult"]', IS_OPTN);
{ IInvoicesService.getInvoicesWithDetails }
InvRegistry.RegisterMethodInfo(TypeInfo(IInvoicesService), 'getInvoicesWithDetails', '',
'[ReturnName="getInvoicesWithDetailsResult"]', IS_OPTN);
{ IInvoicesService.setAsReceived }
InvRegistry.RegisterMethodInfo(TypeInfo(IInvoicesService), 'setAsReceived', '',
'[ReturnName="setAsReceivedResult"]');
{ IInvoicesService.getInvoice }
InvRegistry.RegisterMethodInfo(TypeInfo(IInvoicesService), 'getInvoice', '',
'[ReturnName="getInvoiceResult"]', IS_OPTN);
{ IInvoicesService.getInvoiceWithDetail }
InvRegistry.RegisterMethodInfo(TypeInfo(IInvoicesService), 'getInvoiceWithDetail', '',
'[ReturnName="getInvoiceWithDetailResult"]', IS_OPTN);
RemClassRegistry.RegisterXSInfo(TypeInfo(getInvoicesWithDetailsResult), 'http://tempuri.org/', 'getInvoicesWithDetailsResult');
RemClassRegistry.RegisterXSInfo(TypeInfo(getInvoiceResult), 'http://tempuri.org/', 'getInvoiceResult');
RemClassRegistry.RegisterXSInfo(TypeInfo(getInvoiceWithDetailResult), 'http://tempuri.org/', 'getInvoiceWithDetailResult');
RemClassRegistry.RegisterXSInfo(TypeInfo(getInvoicesResult), 'http://tempuri.org/', 'getInvoicesResult');
end.
assword>'+HSIFRE.Text+'</web