Home >Backend Development >PHP Tutorial >求大神帮忙,php怎么从WCF服务取数据

求大神帮忙,php怎么从WCF服务取数据

WBOY
WBOYOriginal
2016-06-23 14:00:55783browse

Serivce接口:MemberService 方法login(int teamId,string username,string password)
Php代码:

$teamId=1;$username="aa";$pasword="123456";$soap=new SoapClient("http://localhost/TeamLoggingWebHost/MemberService.svc?wsdl");$result=$soap->login($teamId,$username,$password);

我是新手最近学php要从WCF服务上去数据,我在网上找资料说是按上面的取,我试过了结果报错。最好能有例子。


回复讨论(解决方案)

WCF 不是 SOAP,虽然 WCF 也可以使用SOAP做通信格式
假定你的  WCF 支持 SOAP,那么参数格式需根据 WSDL 的指示去写

$result=$soap->login($teamId,$username,$password);
这样的参数传递,在 SOAP 中也是很少见的

可以给个从WCF取数据的例子吗

php 访问restful ,json格式的例子也可以。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn