nedir bu hata?

Delphi'de kod yazma ile ilgili sorularınızı bu foruma yazabilirsiniz.
Cevapla
Kullanıcı avatarı
nitro
Üye
Mesajlar: 1112
Kayıt: 23 Ağu 2004 01:18
Konum: Çanakkale
İletişim:

nedir bu hata?

Mesaj gönderen nitro »

s.a.
programımın bir kısmında bağkurdan provizyon almaya çalışıyorum.
WSDL importer ile
http://hop.bagkur.gov.tr/HOPYeni/wsdl/c ... izyon.wsdl
adresinden import ettiğim zaman. aşağıcadki uniti elde ettim.

Kod: Tümünü seç

// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL     : http://hop.bagkur.gov.tr/HOPYeni/wsdl/com/elba/hop/servlets/GetProvizyon.wsdl
// Encoding : UTF-8
// Version  : 1.0
// (01.08.2005 12:40:01 - 1.33.2.5)
// ************************************************************************ //

unit GetProvizyon1;

interface

uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;

type

  // ************************************************************************ //
  // The following types, referred to in the WSDL document are not being represented
  // in this file. They are either aliases[@] of other types represented or were referred
  // to but never[!] declared in the document. The types from the latter category
  // typically map to predefined/known XML or Borland types; however, they could also 
  // indicate incorrect WSDL documents that failed to declare or import a schema type.
  // ************************************************************************ //
  // !:integer         - "http://www.w3.org/2001/XMLSchema"
  // !:string          - "http://www.w3.org/2001/XMLSchema"
  // !:int             - "http://www.w3.org/2001/XMLSchema"
  // !:boolean         - "http://www.w3.org/2001/XMLSchema"

  ProvizyonIstek       = class;                 { "http://objects.hop.elba.com" }
  ProvizyonSonuc       = class;                 { "http://objects.hop.elba.com" }



  // ************************************************************************ //
  // Namespace : http://objects.hop.elba.com
  // ************************************************************************ //
  ProvizyonIstek = class(TRemotable)
  private
    Fbagno: integer;
    FkarneNo: WideString;
    Fkullanici: WideString;
    Fsifre: WideString;
    FyakKod: Integer;
    FistekCommArea: WideString;
  published
    property bagno: integer read Fbagno write Fbagno;
    property karneNo: WideString read FkarneNo write FkarneNo;
    property kullanici: WideString read Fkullanici write Fkullanici;
    property sifre: WideString read Fsifre write Fsifre;
    property yakKod: Integer read FyakKod write FyakKod;
    property istekCommArea: WideString read FistekCommArea write FistekCommArea;
  end;



  // ************************************************************************ //
  // Namespace : http://objects.hop.elba.com
  // ************************************************************************ //
  ProvizyonSonuc = class(TRemotable)
  private
    Fhepsi: WideString;
    FresultCode: Boolean;
    FerrorStr: WideString;
    FprovizyonNo: WideString;
    FsigortaliIli: Integer;
    FhataKodu: Integer;
  published
    property hepsi: WideString read Fhepsi write Fhepsi;
    property resultCode: Boolean read FresultCode write FresultCode;
    property errorStr: WideString read FerrorStr write FerrorStr;
    property provizyonNo: WideString read FprovizyonNo write FprovizyonNo;
    property sigortaliIli: Integer read FsigortaliIli write FsigortaliIli;
    property hataKodu: Integer read FhataKodu write FhataKodu;
  end;


  // ************************************************************************ //
  // Namespace : http://servlets.hop.elba.com
  // transport : http://schemas.xmlsoap.org/soap/http
  // style     : document
  // binding   : GetProvizyonSoapBinding
  // service   : GetProvizyonService
  // port      : GetProvizyon
  // URL       : http://hop.bagkur.gov.tr/HOPYeni/services/GetProvizyon
  // ************************************************************************ //
  getprovizyonbg = interface(IInvokable)
  ['{C05EEB21-9E17-4047-EE49-4B056066459E}']
    function  sistemeGonder(const istek: ProvizyonIstek): ProvizyonSonuc; stdcall;
  end;

function Getgetprovizyonbg(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): getprovizyonbg;


implementation

function Getgetprovizyonbg(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): getprovizyonbg;
const
  defWSDL = 'http://hop.bagkur.gov.tr/HOPYeni/wsdl/com/elba/hop/servlets/GetProvizyon.wsdl';
  defURL  = 'http://hop.bagkur.gov.tr/HOPYeni/services/GetProvizyon';
  defSvc  = 'GetProvizyonService';
  defPrt  = 'GetProvizyon';
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 getprovizyonbg);
    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
  InvRegistry.RegisterInterface(TypeInfo(getprovizyonbg), 'http://servlets.hop.elba.com', 'UTF-8');
  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(getprovizyonbg), '');
  InvRegistry.RegisterInvokeOptions(TypeInfo(getprovizyonbg), ioDocument);
  RemClassRegistry.RegisterXSClass(ProvizyonIstek, 'http://objects.hop.elba.com', 'ProvizyonIstek');
  RemClassRegistry.RegisterXSClass(ProvizyonSonuc, 'http://objects.hop.elba.com', 'ProvizyonSonuc');

end. 
ben daha sonra programımda şu kodları yazdım.

Kod: Tümünü seç


procedure TForm1.Button1Click(Sender: TObject);
var 

  bagkuristek: provizyonistek;
  bagkursonuc: provizyonsonuc;
  BProvizyon: getProvizyonbg;
begin
//BAĞKUR SORGU

if suiradiogroup1.ItemIndex=1 then
  begin
  bprovizyon:= getGETprovizyonbg;
  bagkuristek:= provizyonistek.Create;
  try
    bagkuristek.kullanici:= edit1.Text;
    bagkuristek.sifre:= edit2.Text;
    bagkuristek.bagno:=strtoint(edit3.Text);
    bagkuristek.karneNo:=edit4.Text;
    bagkuristek.yakKod:=strtoint(edit6.text);
    SHOWmessage('1');
     bProvizyon:= GetGETProvizyonbg;
     SHOWmessage('2');
  bagkursonuc:= bProvizyon.sistemeGonder(bagkuristek);
  SHOWmessage('3');
  //  bagkursonuc geriye ad Soyad gibi bilgileri döndürüyor sanırım.
  ad.Caption:=(bagkursonuc.hepsi);
  protokolno.Caption:=(bagkursonuc.provizyonNo);
  durum.Caption:= inttostr(bagkursonuc.hataKodu);
programın hata verdiği yeni tam görebilmek için showmessagelar ekledim. program 2 diye mesaj gösterdikten sonra şu hatayı veriyor.

Geçersiz unicode karakteri

line: 2
<soapenv: Envelope xmlns:soapenv="http://,

neden bu hatayı veriyor acaba.
bağkurun sayfasında test için şu parametreler verilmiş. ben de denemeyi bu parametrelerle yaptım.
2345678 şifreli TESTHASTANESI kullanıcısı 1234567890 numaralı 2000 yakınlık kodlu AB1234567 karne numarasına sahip Bağ-kur sigortalısı için istekte bulunacak ise.
fduman
Moderator
Mesajlar: 2749
Kayıt: 17 Ara 2004 12:02
Konum: Ankara

Mesaj gönderen fduman »

Bu mesajını daha önceki sorunun altında devam edebilirdin.
Cevapla