ozraksy çok güzel sorular. çok teşekkür ederim. aynı hataları ben de almaktayım. bir türlü php tarafında geçemedik bu kısmı. c# da bi yere kadar getirdi arkadaş olayı ama orda da doktor belirtilen tarihte tesiste çalışmamaktadır hatası alıyoruz imzalı e-reçete kısmında.
eczane@sgk.gov.tr mail attım gönderdikleri cevap:
Aşağıdaki formata uygun veri göndermelisiniz
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://servisler.ws.eczane.gss.sgk.gov.tr">
<soapenv:Header/>
<soapenv:Body>
<ser:ereceteGiris>
<!--Optional:-->
<arg0>
<ereceteDVO>
<protokolNo>?</protokolNo>
<provizyonTipi>?</provizyonTipi>
<receteAltTuru>?</receteAltTuru>
<receteTarihi>?</receteTarihi>
<receteTuru>?</receteTuru>
<takipNo>?</takipNo>
<tcKimlikNo>?</tcKimlikNo>
<tesisKodu>?</tesisKodu>
<!--Optional:-->
<seriNo>?</seriNo>
<doktorBransKodu>?</doktorBransKodu>
<doktorSertifikaKodu>?</doktorSertifikaKodu>
<!--Optional:-->
<kisiDVO>
<!--Optional:-->
<adi>?</adi>
<!--Optional:-->
<cinsiyeti>?</cinsiyeti>
<!--Optional:-->
<dogumTarihi>?</dogumTarihi>
<!--Optional:-->
<soyadi>?</soyadi>
<tcKimlikNo>?</tcKimlikNo>
</kisiDVO>
<!--Optional:-->
<ereceteNo>?</ereceteNo>
<!--1 or more repetitions:-->
<ereceteIlacListesi>
<adet>?</adet>
<barkod>?</barkod>
<!--Optional:-->
<ilacAdi>?</ilacAdi>
<kullanimDoz1>?</kullanimDoz1>
<kullanimPeriyotBirimi>?</kullanimPeriyotBirimi>
<kullanimSekli>?</kullanimSekli>
<!--Zero or more repetitions:-->
<ereceteIlacAciklamaListesi>
<!--Optional:-->
<aciklama>?</aciklama>
<aciklamaTuru>?</aciklamaTuru>
</ereceteIlacAciklamaListesi>
<kullanimDoz2>?</kullanimDoz2>
<kullanimPeriyot>?</kullanimPeriyot>
<!--Optional:-->
<geriOdemeKapsaminda>?</geriOdemeKapsaminda>
</ereceteIlacListesi>
<!--1 or more repetitions:-->
<ereceteTaniListesi>
<!--Optional:-->
<taniAdi>?</taniAdi>
<taniKodu>?</taniKodu>
</ereceteTaniListesi>
<!--Zero or more repetitions:-->
<ereceteAciklamaListesi>
<!--Optional:-->
<aciklama>?</aciklama>
<aciklamaTuru>?</aciklamaTuru>
</ereceteAciklamaListesi>
<!--Optional:-->
<doktorAdi>?</doktorAdi>
<!--Optional:-->
<doktorSoyadi>?</doktorSoyadi>
<doktorTcKimlikNo>?</doktorTcKimlikNo>
</ereceteDVO>
<tesisKodu>?</tesisKodu>
<doktorTcKimlikNo>?</doktorTcKimlikNo>
</arg0>
</ser:ereceteGiris>
</soapenv:Body>
</soapenv:Envelope>
<?php
try{
$client = new SoapClient("https://sgkt.sgk.gov.tr/medula/eczane/saglikTesisiReceteIslemleriWS?wsdl");
$wsse = '<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsse:Username>99999999990</wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/ws ms/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">99999999990</wsse:Password> </wsse:UsernameToken> </wsse:Security>';
$header_data = new SoapVar($wsse, XSD_ANYXML);
$header = new SoapHeader('http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd', 'Security', $header_data);
$client->__setSoapHeaders($header);
$adi='';
$cinsiyeti='';
$dogumTarihi='';
$soyadi='';
$tcKimlikNo='99999999990';
$kisidvo = [];
$kisidvo[] = new SoapVar($adi,XSD_STRING,null,"",'adi');
$kisidvo[] = new SoapVar($cinsiyeti,XSD_STRING,null,"",'cinsiyeti');
$kisidvo[] = new SoapVar($dogumTarihi,XSD_STRING,null,"",'dogumTarihi');
$kisidvo[] = new SoapVar($soyadi,XSD_STRING,null,"",'soyadi');
$kisidvo[] = new SoapVar($tcKimlikNo,XSD_LONG,null,"",'tcKimlikNo');
$aciklama='Hipertansiyon';
$aciklamaTuru='1';
$ereceteIlacAciklamaDVO = [];
$ereceteIlacAciklamaDVO[] = new SoapVar($aciklama,XSD_STRING,null,"",'aciklama');
$ereceteIlacAciklamaDVO[] = new SoapVar($aciklamaTuru,XSD_INT,null,"",'aciklamaTuru');
$adet=1;
$barkod='8699786010055';
$ilacAdi='ATACAND PLUS 16 12.5 MG.28 TABLET';
$kullanimDoz1='1';
$kullanimPeriyotBirimi='1';
$kullanimSekli='1';
$kullanimDoz2='1';
$kullanimPeriyot='1';
$geriOdemeKapsaminda='E';
$ereceteIlacDVO = [];
$ereceteIlacDVO[] = new SoapVar($adet,XSD_INT,null,"",'adet');
$ereceteIlacDVO[] = new SoapVar($barkod,XSD_LONG,null,"",'barkod');
$ereceteIlacDVO[] = new SoapVar($ilacAdi,XSD_STRING,null,"",'ilacAdi');
$ereceteIlacDVO[] = new SoapVar($kullanimDoz1,XSD_INT,null,"",'kullanimDoz1');
$ereceteIlacDVO[] = new SoapVar($kullanimPeriyotBirimi,XSD_INT,null,"",'kullanimPeriyotBirimi');
$ereceteIlacDVO[] = new SoapVar($kullanimSekli,XSD_INT,null,"",'kullanimSekli');
$ereceteIlacDVO[] = new SoapVar($ereceteIlacAciklamaDVO,XSD_ANYXML,null,"",'ereceteIlacAciklamaListesi');
$ereceteIlacDVO[] = new SoapVar($kullanimDoz2,XSD_DOUBLE,null,"",'kullanimDoz2');
$ereceteIlacDVO[] = new SoapVar($kullanimPeriyot,XSD_INT,null,"",'kullanimPeriyot');
$ereceteIlacDVO[] = new SoapVar($geriOdemeKapsaminda,XSD_STRING,null,"",'geriOdemeKapsaminda');
$taniAdi='Hipertansiyon';
$taniKodu='I15';
$ereceteTaniDVO = [];
$ereceteTaniDVO[] = new SoapVar($taniAdi,XSD_STRING,null,"",'taniAdi');
$ereceteTaniDVO[] = new SoapVar($taniKodu,XSD_STRING,null,"",'taniKodu');
$ereceteAciklamaDVO=[];
$ereceteAciklamaDVO[] = new SoapVar($aciklama,XSD_STRING,null,"",'aciklama');
$ereceteAciklamaDVO[] = new SoapVar($aciklamaTuru,XSD_INT,null,"",'aciklamaTuru');
$protokolNo='2';
$provizyonTipi='1';
$receteAltTuru='1';
$receteTarihi=date('m.d.Y');
$receteTuru='1';
$takipNo='0';
$tcKimlikNo='99999999990';
$tesisKodu='11069903';
$seriNo='';
$doktorBransKodu='9999';
$doktorSertifikaKodu='0';
$ereceteNo='0';
$doktorAdi='Ferhat';
$doktorSoyadi='Gölge';
$doktorTcKimlikNo='99999999990';
$erecetedvo = [];
$erecetedvo[]= new SoapVar($protokolNo,XSD_STRING,null,"",'protokolNo');
$erecetedvo[]= new SoapVar($provizyonTipi,XSD_INT,null,"",'provizyonTipi');
$erecetedvo[]= new SoapVar($receteAltTuru,XSD_INT,null,"",'receteAltTuru');
$erecetedvo[]= new SoapVar($receteTarihi,XSD_STRING,null,"",'receteTarihi');
$erecetedvo[]= new SoapVar($receteTuru,XSD_INT,null,"",'receteTuru');
$erecetedvo[]= new SoapVar($takipNo,XSD_STRING,null,"",'takipNo');
$erecetedvo[]= new SoapVar($tcKimlikNo,XSD_LONG,null,"",'tcKimlikNo');
$erecetedvo[]= new SoapVar($tesisKodu,XSD_STRING,null,"",'tesisKodu');
$erecetedvo[]= new SoapVar($seriNo,XSD_STRING,null,"",'seriNo');
$erecetedvo[]= new SoapVar($doktorBransKodu,XSD_INT,null,"",'doktorBransKodu');
$erecetedvo[]= new SoapVar($doktorSertifikaKodu,XSD_INT,null,"",'doktorSertifikaKodu');
$erecetedvo[]= new SoapVar($kisidvo,XSD_ANYXML,null,"",'kisiDVO');
$erecetedvo[]= new SoapVar($ereceteNo,XSD_STRING,null,"",'ereceteNo');
$erecetedvo[]= new SoapVar($ereceteIlacDVO,XSD_ANYXML,null,"",'ereceteIlacListesi');
$erecetedvo[]= new SoapVar($ereceteTaniDVO,XSD_ANYXML,null,"",'ereceteTaniListesi');
$erecetedvo[]= new SoapVar($ereceteAciklamaDVO,XSD_ANYXML,null,"",'ereceteAciklamaListesi');
$erecetedvo[]= new SoapVar($doktorAdi,XSD_STRING,null,"",'doktorAdi');
$erecetedvo[]= new SoapVar($doktorSoyadi,XSD_STRING,null,"",'doktorSoyadi');
$erecetedvo[]= new SoapVar($doktorTcKimlikNo,XSD_LONG,null,"",'doktorTcKimlikNo');
$parameters = [];
$parameters[] = new SoapVar($erecetedvo, XSD_ANYXML, null, "", 'ereceteDVO');
$parameters[] = new SoapVar('11069903', XSD_INT, null, "", 'tesisKodu', '');
$parameters[] = new SoapVar('99999999990', XSD_STRING, null, "", 'doktorTcKimlikNo');
$parameter = [
'arg0' => new SoapVar($parameters, SOAP_ENC_OBJECT)
];
echo json_encode($parameter);
echo '<br>';
$results = $client->ereceteGiris($parameter);
print_r($results);
}
catch (SoapFault $e){
die('ERR: ' . $e->getMessage());
} ?>
aldığım hata :
stdClass Object ( [ereceteGirisReturn] => stdClass Object ( [sonucKodu] => 9109 [sonucMesaji] => Gonderdiginiz mesaj beklenen mesaj formatina uymamaktadir. Detay: cvc-complex-type.2.4.a: Invalid content was found starting with element 'protokolNo'. One of '{ereceteDVO}' is expected. ) )