关于 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头也不对
错误:客户端发现响应
相关问答:
$a = $_FILES['userfile']['name'] ;
$test = $a;
$p = split('/',$test);
$p[count($p)-1];
$content = file_get_contents("$p");
$con ......
刚接触这个东西,想问一下各位高手实践这个需要哪些工具(我用的linux,dreamweaver)?具体怎么实现?求一个简单完整的例子
网上搜索nusoap
去“w3学校”学下xml
不过网上比较难找那种完整的例子,只有简 ......
webclient.php文件:
<?php
$arrOptions = array( 'uri'=>'http://10.10.19.111/','location'=>'http://10.10.19.111/webservice/webservice.php','trace' ......
招聘
公司名称 胜行软件(深圳)有限公司
职位名称 PHP程序员
招聘人数 3-5
工作地点 深圳市龙岗区横岗四联新亚洲广场新秀苑B2-201
薪水待遇 4k-10k
职位描述 主要负责对日外包项目的设计,编码和 ......
this->$name=$nam;
这句代码是什么意思啊?
其中->又是什么意思呢、
谢谢高手指点!
对象->属性=变量
不过你好像写错了....
$this->num=$num; 这样的吧
$this->num=$num; ......