Php soap数据发送错误

时间:2017-08-03 18:47:18

标签: php soap webservice-client

将数据发送到SomeMethod()方法时,1多余参数将返回错误。

我的代码:

$client = new SoapClient('site_url/?wsdl');
$client->soap_defencoding = 'UTF-8';
$loginparam = array('userName'=>'name','password'=>'pass','trace' => 1, 'exceptions' => 0);   


$session = $client->OturumAc($loginparam);
$SoapIcHeader = new SoapHeader("http://sanayi.gov.tr","TokenId",$session->OturumAcResult);
$client->__setSoapHeaders($SoapIcHeader);
$OturumUzat = $client->OturumDogrulaVeUzat($session ->OturumAcResult);

$param["BosAgirligi"] = "20";
$param["CalismaBasinci"] = "5";
$param["DoluAgirligi"] = "1";
$param["SonMuayeneTarihi"] = "2017-08-01 10:19:04";
$param["SonMuayeneYapanFirmaMersisNo"] = "123456789";
$param["SuKapasitesi"] = "1";
$param["TestBasinci"] = "10";
$param["DolumBasinci"] = "15";
$param["EtKalinligi"] = "3";
$param["ImalatTarihi"] = "2017-08-01 10:19:04";
$param["SeriNo"] = "123";
$param["TescilEdenTesisId"] = "31fd684c-f97d-48c1-a7fb-60f30f536d8d";
$param["UreticiId"] = "31fd684c-f97d-48c1-a7fb-60f30f536d8d";
// $param["UygunlukIsareti"] = "1";

$date   = date('d/m/Y');
$id     ="2ad9a9a9-adb9-4fb8-8fae-01e84aa72343";

try
{ 


  $sonuc = $client->TupTescil($id,$date,$param);
  print_r($sonuc);

}
catch (Exception $e)
{
   echo "Error ! ";
   echo $e -> getMessage ();
} 

返回错误 错误!格式化程序在尝试反序列化消息时抛出异常:反序列化操作请求消息正文时出错' TupTescil'。结束元素'身体'来自命名空间' http://schemas.xmlsoap.org/soap/envelope/'预期。找到元素' param1'来自命名空间''。第2行,第281位。

此示例适用于C#

                Guid tupKimligi = new Guid("07FAF194-4E80-4359-95D9-011CA1F5A1D4"); 

            DateTime islemSaati = DateTime.Today;

            TupTescilBilgisi tescilBilgileri = new TupTescilBilgisi()  
            {
                BosAgirligi = 1,
                CalismaBasinci = 1,
                DoluAgirligi = 1,
                SonMuayeneTarihi = DateTime.Today,
                SonMuayeneYapanFirmaMersisNo = "123456789",
                SuKapasitesi = 1,
                TestBasinci = 1,
                DolumBasinci = 1,
                EtKalinligi = 1,
                ImalatTarihi = DateTime.Today,
                SeriNo = "123",
                TescilEdenTesisId = tesisId,
                UreticiId = ureticiId,
                UygunlukIsareti = TupUygunlukIsareti.Pi

            };


            Tup tescilSonuc = tsc.TupTescil(tupKimligi, DateTime.Today, tescilBilgileri);

您还可以在此处查看wsdl结构

enter link description here

感谢您的帮助

0 个答案:

没有答案