"); $xml=substr($xml,$startStr,$endStr-$startStr); $xml = str_replace("","",$xml); $xml = str_replace("","",$xml); $xml = str_replace("]]>","",$xml); $xml = str_replace("","",$xml); return $xml; } //==============获得前台请求============== $callback = isset($_GET['callback']) ? trim($_GET['callback']) : ''; $req['HospitalId'] = $_GET['hospitalId']; $req['startDate'] = $_GET['startDate']; $req['endDate'] = $_GET['endDate']; $req['deptId'] = $_GET['deptId']; if(isset($_GET['doctorId'])) { $req['doctorId'] = $_GET['doctorId']; } //$req = simplexml_load_string($req); //提取POST数据为simplexml对象 $TradeCode = "1004"; $ExtOrgCode = "南方医务通"; $ExtUserID = "NFYWT"; $ClientType =""; $HospitalId =$req['HospitalId']; $DeptType = ""; $DoctorCode = ""; $SessType = ""; $StartDate = $req['startDate']; $EndDate = $req['endDate']; $RBASSessionCode = ""; $ServiceCode = ""; $StopScheduleFlag = ""; $DepartmentCode = $req['deptId']; $DoctorCode= empty($req['doctorId'])?'':$req['doctorId']; $SearchCode = ""; ini_set('user_agent', 'Mozilla/5.0'); $postData = "$HospitalId$ExtOrgCode$ExtUserID$ClientType$TradeCode$DeptType$DoctorCode$SessType$StartDate$EndDate$RBASSessionCode$ServiceCode$StopScheduleFlag$DepartmentCode$SearchCode"; //$postData = str_replace(' ','%20',$postData); //$wsdl = "http://yygh1.dept.nfyy.com/csp/oep/DHC.OEP.BS.OEPSTANWebService.cls?soap_method=QuerySchedule&Input="; //$result = file_get_contents($wsdl.$postData); $postData = str_replace(' ','%20',$postData); libxml_disable_entity_loader(false); $wsdl = "yygh1.wsdl"; try{ $client = new SoapClient($wsdl); $param = array(array("Input" => $postData)); $result = $client->__soapCall('QuerySchedule',$param); $res = reset($result); } catch (SoapFault $e) { var_dump($e);exit; } //$res = SoapToXml($result); $res = simplexml_load_string($res); echo $callback.'('.json_encode($res).')';exit;