ozraksy adlı üyeden alıntı: mesajı görüntüle
Çok teşekkürler. Son bir şey daha sorsam eğer sıkmamış olursam;
<xs:complexType name="ereceteDVO">
<xs:sequence>
<xs:element name="protokolNo" type="xs:string"/>
<xs:element name="provizyonTipi" type="xs:int"/>
<xs:element name="receteAltTuru" type="xs:int"/>
<xs:element name="receteTarihi" type="xs:string"/>
<xs:element name="receteTuru" nillable="true" type="xs:int"/>
<xs:element name="takipNo" type="xs:string"/>
<xs:element name="tcKimlikNo" type="xs:long"/>
<xs:element name="tesisKodu" type="xs:int"/>
<xs:element minOccurs="0" name="seriNo" nillable="true" type="xs:string"/>
<xs:element name="doktorBransKodu" type="xs:int"/>
<xs:element name="doktorSertifikaKodu" type="xs:int"/>
<xs:element minOccurs="0" name="kisiDVO" nillable="true" type="tns:kisiDVO"/>
<xs:element minOccurs="0" name="ereceteNo" nillable="true" type="xs:string"/>
<xs:element maxOccurs="unbounded" name="ereceteIlacListesi" type="tns:ereceteIlacDVO"/>
<xs:element maxOccurs="unbounded" name="ereceteTaniListesi" type="tns:ereceteTaniDVO"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="ereceteAciklamaListesi" nillable="true" type="tns:ereceteAciklamaDVO"/>
<xs:element minOccurs="0" name="doktorAdi" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="doktorSoyadi" nillable="true" type="xs:string"/>
<xs:element name="doktorTcKimlikNo" type="xs:long"/>
</xs:sequence>
</xs:complexType>
Bu veriyi göndereceğim, o kısım tamam ama,
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>' . $user_medula_username . '</wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/ws ms/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">' . $user_medula_password . '</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); $parameters = []; $parameters[] = new SoapVar($MEDULAtesisKodu, XSD_INT, null, "", 'tesisKodu', ''); $parameters[] = new SoapVar($MEDULAtcKimlikNo, XSD_STRING, null, "", 'tcKimlikNo'); $parameters[] = new SoapVar($MEDULAprovizyonTipi, XSD_INT, null, "", 'provizyonTipi', ''); $parameters[] = new SoapVar($MEDULAreceteTarihi, XSD_STRING, null, "", 'receteTarihi'); $parameters[] = new SoapVar($MEDULAreceteAltTuru, XSD_INT, null, "", 'receteAltTuru', ''); $parameters[] = new SoapVar($MEDULAprotokolNo, XSD_STRING, null, "", 'protokolNo'); $parameters[] = new SoapVar($MEDULAdoktorTcKimlikNo, XSD_STRING, null, "", 'doktorTcKimlikNo'); $parameters[] = new SoapVar($MEDULAdoktorBransKodu, XSD_INT, null, "", 'doktorBransKodu', ''); $parameters[] = new SoapVar($MEDULAdoktorSertifikaKodu, XSD_INT, null, "", 'doktorSertifikaKodu', ''); $ereceteDVO = [ 'arg0' => new SoapVar($parameters, SOAP_ENC_OBJECT) ]; $results = $client->ereceteGiris($ereceteDVO); print_r($results); } catch (SoapFault $e) { die('ERR: ' . $e->getMessage()); }
Bu kodun içerisinde kisiDVO yu örneğin, nasıl gönderebilirim?
Biliyorum çok zahmet verdim size ama içinden çıkamadım bir türlü, çok teşekkürler şimdiden.




En son bu şekilde denedim ama bu sefer de kullanıcı adı doktor tckn eşleşmedi diyor. Sanırım kotaramıyorum bu işi, en iyisi bir bilene yaptırtmak gibi duruyor, siz ne dersiniz?
<?php if ($_POST) { $user_medula_username = trim(strip_tags($_POST['user_medula_username'])); $user_medula_password = trim(strip_tags($_POST['user_medula_password'])); $MEDULAtesisKodu = "11069903"; // ereçetenin yazıldığı tesis kodu - isg için sabit $MEDULAtcKimlikNo = ""; // hastanın tckn $MEDULAprovizyonTipi = "1"; // tablo 9e $MEDULAreceteTarihi = date('d.m.Y'); // 01.01.2018 gibi $MEDULAreceteTuru = "1"; // tablo 9a $MEDULAreceteAltTuru = "1"; // tablo 9b $MEDULAprotokolNo = ""; $MEDULAseriNo = "0"; $MEDULAdoktorTcKimlikNo = "99999999990"; $MEDULAdoktorBransKodu = ""; $MEDULAdoktorSertifikaKodu = "0"; // tablo 9d $MEDULAdoktorAdi = ""; $MEDULAdoktorSoyadi = ""; $MEDULAadi = ""; // hastanın adı $MEDULAsoyadi = ""; // hastanın soyadı $MEDULAdogumTarihi = "01.01.1980"; // hastanın doğum tarihi - 01.01.1980 gibi $MEDULAcinsiyeti = "E"; // hastanın cinsiyeti - E veya K $MEDULAaciklamaTuru = "1"; // tablo 9h $MEDULAaciklama = ""; // ereçete açıklaması $MEDULAtaniKodu = ""; // ereçete tanı kodu $MEDULAtaniAdi = ""; // ereçete tanı açıklaması $MEDULAbarkod = ""; $MEDULAadet = ""; $MEDULAkullanimSekli = "1"; // tablo 9f $MEDULAkullanimDoz1 = "1"; $MEDULAkullanimDoz2 = "1"; $MEDULAkullanimPeriyot = "2"; $MEDULAkullanimPeriyotBirimi = "3"; // tablo 9g $MEDULAgeriOdemeKapsaminda = "E"; // E veya H olacak $MEDULAilacAciklamaTuru = "1"; // tablo 9h $MEDULAilacAciklama = ""; // ereçete açıklaması if (empty($user_medula_username) || empty($user_medula_password)) { $errormsg = "Boş Alan Bırakmayın!"; } else { 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>' . $user_medula_username . '</wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/ws ms/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">' . $user_medula_password . '</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); $gonderilecekXML = ' <xs:complexType name="ereceteDVO"> <xs:sequence> <xs:element name="protokolNo" value="' . $MEDULAprotokolNo . '" type="xs:string"/> <xs:element name="provizyonTipi" value="' . $MEDULAprovizyonTipi . '" type="xs:int"/> <xs:element name="receteAltTuru" value="' . $MEDULAreceteAltTuru . '" type="xs:int"/> <xs:element name="receteTarihi" value="' . $MEDULAreceteTarihi . '" type="xs:string"/> <xs:element name="tcKimlikNo" value="' . $MEDULAtcKimlikNo . '" type="xs:string"/> <xs:element name="tesisKodu" value="' . $MEDULAtesisKodu . '" type="xs:int"/> <xs:element name="doktorBransKodu" value="' . $MEDULAdoktorBransKodu . '" type="xs:int"/> <xs:element name="doktorSertifikaKodu" value="' . $MEDULAdoktorSertifikaKodu . '" type="xs:int"/> <xs:element maxOccurs="unbounded" name="ereceteIlacListesi" type="tns:ereceteIlacDVO"/> <xs:element maxOccurs="unbounded" name="ereceteTaniListesi" type="tns:ereceteTaniDVO"/> <xs:element name="doktorTcKimlikNo" value="' . $MEDULAdoktorTcKimlikNo . '" type="xs:string"/> </xs:sequence> </xs:complexType> <xs:complexType name="ereceteIlacDVO"> <xs:sequence> <xs:element name="adet" value="' . $MEDULAadet . '" type="xs:int"/> <xs:element name="barkod" value="' . $MEDULAbarkod . '" type="xs:long"/> <xs:element name="kullanimDoz1" value="' . $MEDULAkullanimDoz1 . '" type="xs:int"/> <xs:element name="kullanimPeriyotBirimi" value="' . $MEDULAkullanimPeriyotBirimi . '" type="xs:int"/> <xs:element name="kullanimSekli" value="' . $MEDULAkullanimSekli . '" nillable="true" type="xs:int"/> <xs:element maxOccurs="unbounded" minOccurs="0" name="ereceteIlacAciklamaListesi" nillable="true" type="tns:ereceteIlacAciklamaDVO"/> <xs:element name="kullanimDoz2" value="' . $MEDULAkullanimDoz2 . '" type="xs:double"/> <xs:element name="kullanimPeriyot" value="' . $MEDULAkullanimPeriyot . '" type="xs:int"/> <xs:element minOccurs="0" name="geriOdemeKapsaminda" value="' . $MEDULAgeriOdemeKapsaminda . '" nillable="true" type="xs:string"/> </xs:sequence> </xs:complexType> <xs:complexType name="ereceteIlacAciklamaDVO"> <xs:sequence> <xs:element minOccurs="0" name="aciklama" value="' . $MEDULAaciklama . '" nillable="true" type="xs:string"/> <xs:element name="aciklamaTuru" value="' . $MEDULAaciklamaTuru . '" type="xs:int"/> </xs:sequence> </xs:complexType> <xs:complexType name="ereceteTaniDVO"> <xs:sequence> <xs:element minOccurs="0" name="taniAdi" value="' . $MEDULAtaniAdi . '" nillable="true" type="xs:string"/> <xs:element name="taniKodu" value="' . $MEDULAtaniKodu . '" type="xs:string"/> </xs:sequence> </xs:complexType> '; $results = $client->ereceteGiris($gonderilecekXML); print_r($results); } catch (SoapFault $e) { die('ERR: ' . $e->getMessage()); } } }
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. ) )