以下内容为程序代码: 0) { data = fread(fp, dataLength); } fclose(fp); if(strlen(data) != dataLength || dataLength <= 0) { return FALSE; } return data; } } function ConstructData(namespace, action, data) { soapData = "\r\n"; soapData .= "\r\n"; soapData .= " \r\n"; soapData .= " \r\n"; foreach(data as name => value) { name = iconv("GBK","UTF-8",name); value= iconv("GBK","UTF-8",value); soapData .= " value\r\n"; } soapData .= " \r\n"; soapData .= " \r\n"; soapData .= ""; return soapData; } ?> 调用示例:以下内容为程序代码: '测试', //如果需要输入二进制数据请采用BASE64编码 'pass'=>'test' ); echo HttpSoap('sample.anyhost.com', 80, '/sampleSoap.asmx', 'http://tempuri.org/', 'logIn', data); ?>