php调用asp.net的webservice

<?php
 $client = new SoapClient('http://127.0.0.1/ActivityWebService/OnsiteActivity.asmx?WSDL');//这里必须加上?WSDL
 $result=$client->__soapCall("Get_SignInfo",array(array('p_intActID'=>$actid)));

 if (is_soap_fault($result)) {
  trigger_error("SOAP Fault: (faultcode: {$result->faultcode}, faultstring: {$result->faultstring})", E_USER_ERROR);
 }else{
  $data=$result->Get_SignInfoResult->any;//这里返回的是类,必须使用->得到元素的值
  //print_r($data);
 }
 $doc = new DOMDocument();
 $doc->loadXML( $data );
 $books = $doc->getElementsByTagName( "ActivityInfo" );
 foreach( $books as $book )
 {
  $actid = $book->getElementsByTagName( "actid" );
  $actid = $actid->item(0)->nodeValue;
  $mobile = $book->getElementsByTagName( "mobile" );
  $mobile = $mobile->item(0)->nodeValue;
  $signtime=$book->getElementsByTagName( "signtime" );
  $signtime = $signtime->item(0)->nodeValue;
  $signtime=strtotime($signtime);
}

    A+
发布日期:2017年01月12日  所属分类:未分类

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: