[英]How to configure soap service and call it from PHP application
我有使用此命令生成服务的 ac# 项目
C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe EnqueteEnLigneSch.exe
然后在 PHP 应用程序中,我像这样调用服务:
define('url_wsdl',"http://localhost:8734/serviceSVC?singleWsdl");
但它不起作用,我对如何设置端点配置感到困惑,这就是我现在的做法:
<services>
<service behaviorConfiguration="simplecalculmexcomport" name="WcfsaveRepES.service">
<endpoint address="http://localhost:8734/serviceSVC" binding="basicHttpBinding" bindingConfiguration=""
name="simplecalculhttpservice" contract="WcfsaveRepES.Iservice" />
<endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
name="simplecalculmexpservice" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8734/serviceSVC" />
</baseAddresses>
</host>
</service>
嗯,是通话问题吗? 还是配置问题? 有什么帮助吗? 谢谢
我没有足够的声誉发表评论,所以我将发布作为答案。
这是一个关于stackoverflow的类似问题的链接: How to use soap class in php (with example)?
通常,您的典型请求和响应如下:
$requestParams = array(
'Number1' => '14',
'Number2' => '31'
);
$client = new SoapClient('http://localhost:8734/serviceSVC?singleWsdl');
$result = $client->GetSum($requestParams);
print_r($result);
其中服务是一个基本的计算器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.