关于 php webservice 的问题 - PHP / 基础编程
对php不是很了解 写了个简单的例子
现用c#调用php写的 webservice(soap WSDL)iis6.0+php5.2.8
webservice如下
<?php
class WebService
{
public function Logout()
{
//header('Content-type: text/xml;');
return array("LogoutResult"=>array("1"));
}
}
$server = new SoapServer("WebService.wsdl");
$server->setClass("WebService");
$server->handle();
?>
c#如下
WebService ws = new WebService();
return dws.Logout();
错误
客户端发现响应内容类型为“text/html”,但应为“text/xml”。
请求失败,错误信息为:
--
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://sunity.org/"><SOAP-ENV:Body><ns1:LogoutResponse><ns1:LogoutResult><ns1:anyType>1</ns1:anyType></ns1:LogoutResult></ns1:LogoutResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
这种情况有见过的吗?
改写成这样
public function Logout()
{
header('Content-type: text/xml;');
return array("LogoutResult"=>array("1"));
}
也没用
不是该如何修改响应头
iis中自定义HTTP头也不对
错误:客户端发现响应
相关问答:
<?php
if($_SERVER['HTTP_REFERER']!=''){
@header("Content-type:image/jpeg");
echo file_get_contents("xlight.jpg");
}
else{
@header("location:ht ......
我们隶属中科院计算所网络重点实验室(http://www.ict.ac.cn/survey/channel/detail443.asp)基础设施课题组.
现因项目和业务拓展的需要,特需要招聘与项目相关的网络应用工程师1-2名。
具体要求如下。有意者 ......
刚接触这个东西,想问一下各位高手实践这个需要哪些工具(我用的linux,dreamweaver)?具体怎么实现?求一个简单完整的例子
网上搜索nusoap
去“w3学校”学下xml
不过网上比较难找那种完整的例子,只有简 ......
有asp基础 感觉vbs用着蛮别扭的 转php算了
php100网站看看里面的视频教程,书推荐php和mysql web开发第四版
php语法手册!!
在网上下载一些电子书就行了 好容易入门的
php和mysql web开发第五版
......
this->$name=$nam;
这句代码是什么意思啊?
其中->又是什么意思呢、
谢谢高手指点!
对象->属性=变量
不过你好像写错了....
$this->num=$num; 这样的吧
$this->num=$num; ......