当我卷曲此 url 时,它会起作用:
# dat <- as.factor(dat); dat
# 2011-11-11 2011-06-01 1974 1970 2003-09-16
# Levels: 1970 1974 2003-09-16 2011-06-01 2011-11-11
as.Date(sub("(^[0-9]{4}$)", "\\1-01-01", dat))
# "2011-11-11" "2011-06-01" "1974-01-01" "1970-01-01" "2003-09-16"
但是,当我这样在我的肥皂地址中调用它时,它不起作用:
curl http://OLM:OLM794%24@X.XXX.XXX.XXX:10080
它向我显示:<soap:address location="http://OLM:OLM794%24@X.XXX.XXX.XXX:10080/"/>
您知道为什么吗?
(SoapFault): Authorization Required
sw.xml
然后在我的文件中调用该肥皂:
....
<wsdl:service name="Toto">
<wsdl:port name="GazListeImpayesHttpSoap11Endpoint" binding="tns:TotoSoap11Binding">
<soap:address location="http://OLM:OLM794%24@X.XXX.XXX.XXX:10080/web/services/Toto.TotoHttpSoap11Endpoint/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
file.php
结果:
<?php
$soap = new SoapClient('http://domaine.com/sw.xml');
var_dump($soap->__getFunctions()); //OK
var_dump($soap->__getTypes()); //OK
$result = $soap->__soapCall("method", array("parameters"=>array("args0"=>array("NUM"=> "123"))));
var_dump($result);
?>
答案 0 :(得分:1)
我找到了解决方案,用户和密码应该添加在SoapClient方法中,而不是直接在wsdl soap:address location
像这样:
$user = "your user here";
$password = "your password here";
$url = "path of wsdl location here";
$credentials = array(
'login' => $user,
'password' => $password,
);
$soap = new SoapClient($url, $credentials);