【问题标题】:how to access .net webservice classes with php?如何使用 php 访问 .net webservice 类?
【发布时间】:2014-06-08 06:05:54
【问题描述】:

我有一个 .net web service,它提供多个 methodspublic classes。 我想在 php 中使用这些类。 我该怎么做?

这是我的网络服务:http://10.2.3.74/AdaptorRepeater/BillPatientService.asmx?WSDL

例如,我想访问 AdmissionVO 类及其属性

$client = new soapclient('http://10.2.3.74/AdaptorRepeater/BillPatientService.asmx?WSDL');
    $header = new SoapHeader('http://sepas.behdasht.gov.ir/','HeaderMessageVO',$HeaderMessageVO,false);
    $client->__setSoapHeaders($header);
$send = $client->SavePatientBillSecure($params);

我想要例如这个:

$client->AdmissionVO->MedicalRecordNumber = '1234';

【问题讨论】:

    标签: php .net web-services


    【解决方案1】:

    使用 SOAP 调用您可以访问任何 Dot.Net Web 服务 您需要有 Dot net Web 服务 WSDL 路径 现在

    <?php
    
     //turn off WSDP caching if not in a production environment
     $ini = ini_set("soap.wsdl_cache_enabled","0");
    
     //instantiate the SOAP client
      $client = new SoapClient("http://example.com/dotnet.asmx?WSDL");
      echo $client->GetAllContactNames()->GetAllContactNamesResult;
       //...optional additional code goes here...
       ?>
    

    【讨论】:

      猜你喜欢
      • 2015-07-06
      • 1970-01-01
      • 1970-01-01
      • 2016-10-11
      • 2011-03-19
      • 2011-01-16
      • 1970-01-01
      • 2010-12-04
      • 1970-01-01
      相关资源
      最近更新 更多