使用用户名身份验证从PHP调用wcf
我正在开发WCF项目。当自定义(用户名)身份验证关闭时,从PHP调用WCF服务可以正常工作,但当我打开身份验证时,似乎无法访问WCF服务。但我可以从.NET项目中访问WCF服务,并启用自定义身份验证。它只是PHP。我正在使用SSL。 下面是我在web.config中的绑定设置使用用户名身份验证从PHP调用wcf,php,wcf,web-services,web,Php,Wcf,Web Services,Web,我正在开发WCF项目。当自定义(用户名)身份验证关闭时,从PHP调用WCF服务可以正常工作,但当我打开身份验证时,似乎无法访问WCF服务。但我可以从.NET项目中访问WCF服务,并启用自定义身份验证。它只是PHP。我正在使用SSL。 下面是我在web.config中的绑定设置 <basicHttpBinding> <binding name="MypBinding" allowCookies="true"> &l
<basicHttpBinding>
<binding name="MypBinding" allowCookies="true">
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None"/>
</security>
</binding>
</basicHttpBinding>
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="ApiService.UAuth, ApiService"/>
</serviceCredentials>
下面是我的php代码示例:
<?php
header('Content-Type: text/plain');
echo "start -> ";
echo " set wsdl var11111 -> ";
$soapclient = new SoapClient('https://api.address.com/Apii.svc?wsdl', array('login' => "username",'password' => "pwd",'default_socket_timeout' => 120, 'trace' => true));
echo " created soapclient ->";
echo $soapclient->GetData()->GetDataResult;
echo " end ";
print ' caught exception:'. $e->getMessage(). "\n";
return;
?>
任何建议都将不胜感激 嗨,斯普林特,你完成了吗,我面临着同样的问题。你能在这里提供一些帮助吗?嗨,斯普林特,你完成了吗,我面临着同样的问题。你能在这里提供一些帮助吗??