Soap .Net server & Php client Problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



i have a problem in nusoap, but there is no problem with the same code in php soap extension but my hosting provider is not allowing the php soap extension so i must use nusoap..

here is my .net soap service

   [WebMethod]
public string Siparis(double FisTutar, double FisKdvTutari, double FisTopTutar, string CariKodu,
string[] StokKodu, int[] Miktar, double[] BirimFiyat)
       {
       try
       {
           //string[] StokKodu=new string[1];
           //  StokKodu[0]="MB.236";
           //  int[] Miktar=new int[1];
           //  Miktar[0]=1;
           //  double[] BirimFiyat=new double[1];
           //  BirimFiyat[0]=100;
           SqlConnection CLogo = new SqlConnection(conString);
SqlCommand SonSifNoBul = new SqlCommand("SELECT LASTASGND,SEGMENTS1_SEGLEN FROM dbo.L_LDOCNUM WHERE FIRMID='1' AND DOCIDEN='1' AND APPMODULE='5'",
               CLogo);
           if (CLogo.State == ConnectionState.Closed)
           {
               CLogo.Open();
           }
SqlCommand SonLogicalNoFis = new SqlCommand("Select max(LOGICALREF) FROM LG_" + SK + "_" + DK + "_ORFICHE", CLogo); int LastLogical = Convert.ToInt32(SonLogicalNoFis.ExecuteScalar()); SqlCommand SonFisSatirNo = new SqlCommand("Select max(LOGICALREF) FROM LG_" + SK + "_" + DK + "_ORFLINE", CLogo); int SonSatirNofis = Convert.ToInt32(SonFisSatirNo.ExecuteScalar()); SqlDataReader DRFisNo = SonSifNoBul.ExecuteReader(CommandBehavior.CloseConnection);
           DRFisNo.Read();
           int FisNo = Convert.ToInt32(DRFisNo[0]) + 1;
           int BasamakSayisi = Convert.ToInt32(DRFisNo[1]);
           string SonFisNo = FisNo.ToString().PadLeft(BasamakSayisi, '0');
           DataSet ds = new DataSet();
           ds.ReadXml(XmlPath + "Ornek_Siparis.xml");
           DataRow DR = ds.Tables["ORDER_SLIP"].NewRow();
           DR["NUMBER"] = SonFisNo;
           DR["DATE"] = DateTime.Now.ToShortDateString();
           DR["TIME"] = DateTime.Now.ToShortTimeString();
           DR["ARP_CODE"] = CariKodu;
           DR["TOTAL_DISCOUNTED"] = FisTutar;
           DR["TOTAL_VAT"] = FisKdvTutari;
           DR["TOTAL_GROSS"] = FisTutar;
           DR["TOTAL_NET"] = FisTopTutar;
           DR["ORDER_STATUS"] = 4;
           DR["CREATED_BY"] = 1;
           DR["DATE_CREATED"] = DateTime.Now.ToShortDateString();
           DR["HOUR_CREATED"] = DateTime.Now.Hour;
           DR["MIN_CREATED"] = DateTime.Now.Minute;
           DR["SEC_CREATED"] = DateTime.Now.Second;
           DR["MODIFIED_BY"] = 1;
           DR["DATE_MODIFIED"] = DateTime.Now.ToShortDateString();
           DR["HOUR_MODIFIED"] = DateTime.Now.Hour;
           DR["MIN_MODIFIED"] = DateTime.Now.Minute;
           DR["SEC_MODIFIED"] = DateTime.Now.Second;
           DR["CURRSEL_TOTAL"] = 1;   //DOVIZ TURU
           DR["DATA_REFERENCE"] = LastLogical + 1;
           DR["ORDER_SLIP_ID"] = ds.Tables["ORDER_SLIP"].Rows.Count + 100;


           DataRow DRTransss = ds.Tables["TRANSACTIONS"].NewRow();
DRTransss["TRANSACTIONS_Id"] = ds.Tables["TRANSACTIONS"].Rows.Count + 100; DRTransss["ORDER_SLIP_Id"] = ds.Tables["ORDER_SLIP"].Rows.Count + 100;
           int sayi = ds.Tables["TRANSACTIONS"].Rows.Count + 100;
           ds.Tables["ORDER_SLIP"].Rows.Add(DR);
           ds.Tables["TRANSACTIONS"].Rows.Add(DRTransss);

           for (int i = 0; i < StokKodu.Length; i++)
           {
               DataRow DRTrans = ds.Tables["TRANSACTION"].NewRow();
               DRTrans["TYPE"] = 0;
               DRTrans["MASTER_CODE"] = StokKodu[i];
               DRTrans["QUANTITY"] = Miktar[i];
               DRTrans["PRICE"] = BirimFiyat[i];
               DRTrans["TOTAL"] = Miktar[i] * BirimFiyat[i];
               DRTrans["VAT_RATE"] = 18;
               DRTrans["VAT_AMOUNT"] = Miktar[i] * BirimFiyat[i] * 1.18f;
               DRTrans["VAT_BASE"] = Miktar[i] * BirimFiyat[i];
               DRTrans["UNIT_CODE"] = "ADET";
               DRTrans["UNIT_CONV1"] = 1;
               DRTrans["UNIT_CONV2"] = 1;
               DRTrans["DUE_DATE"] = DateTime.Now.ToShortDateString();
               DRTrans["TOTAL_NET"] = Miktar[i] * BirimFiyat[i];
               DRTrans["DATA_REFERENCE"] = SonSatirNofis + 1;
               DRTrans["TRANSACTIONS_Id"] = sayi;
               ds.Tables["TRANSACTION"].Rows.Add(DRTrans);

           }

//SELECT LASTASGND,SEGMENTS1_SEGLEN FROM dbo.L_LDOCNUM WHERE FIRMID='1' AND DOCIDEN='1' AND APPMODULE='5' SqlCommand FisNokaydet = new SqlCommand("Update L_LDOCNUM SET LASTASGND='" + SonFisNo + "' WHERE FIRMID='1' AND DOCIDEN='1' AND APPMODULE='5'", CLogo);
           DRFisNo.Close();
           if (CLogo.State == ConnectionState.Closed)
           {
               CLogo.Open();
           }


           FisNokaydet.ExecuteNonQuery();
           ds.WriteXml(XmlPath + "Ornek_Siparis.xml");
           return "TAMAM";
       }
       catch(Exception e)
       {
           return e.Message;
       }
   }



and here is the nusoap function

 $client = new SoapClient(WEB_SERVICE);

$fisTutar = "56.55";
$fisKdvTutari = "12.65";
$fisTopTutar = "69.20";
$cariKodu = "hs.001";

$stokKod[0] = "hx101-221";
$miktar[0] = "5";
$bFiyat[0] = "15";

$stokKod[1] = "hx101-222";
$miktar[1] = "3";
$bFiyat[1] = "12";

 $params = array(
 "FisTutar" => $fisTutar,
      "FisKdvTutari" => $fisKdvTutari,
      "FisTopTutar" => $fisTopTutar,
      "CariKodu" => $cariKodu,
      "StokKodu" => $stokKod,
      "Miktar" => $miktar,
      "BirimFiyat" => $bFiyat);

 $objectresult = $client->call("Siparis", array("parameters"=>$params));
 $t = $objectresult;

 return $t;



this is the returning error:
Index was outside the bounds of the array

when i use this

$objectresult = $client->call("Siparis", $params);


it returns this error:
Object reference not set to an instance of an object.

but when i use php soap extension it is working and this the php soap extension code

$client = new SoapClient(WEB_SERVICE);
$fisTutar = "56.55";
$fisKdvTutari = "12.65";
$fisTopTutar = "69.20";
$cariKodu = "hs.001";

$stokKod[0] = "hx101-221";
$miktar[0] = "5";
$bFiyat[0] = "15";

$stokKod[1] = "hx101-222";
$miktar[1] = "3";
$bFiyat[1] = "12";
 $params = array(
 "FisTutar" => $fisTutar,
      "FisKdvTutari" => $fisKdvTutari,
      "FisTopTutar" => $fisTopTutar,
      "CariKodu" => $cariKodu,
      "StokKodu" => $this->stokKodu,
      "Miktar" => $this->stokMiktar,
      "BirimFiyat" => $this->stokBFiyat);

 $objectresult = $client->Siparis($params);
 $t = $objectresult->SiparisResult;
 return $t;



--
Regards, Himmet YELEKİN
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux