我尝试使用的 Web 服务有这样一个 WSDL 文件: http:// dgpysws.teias.gov.tr/dgpys/services/EVDServis?wsdl
但是,我正在尝试使用“setIkiliAnlasma”服务访问该服务需要身份验证。我有我的凭据,当我对登录服务进行 SOAP 调用时,它会验证我的凭据。
正如预期的那样,当我调用“setIkiliAnlasma”服务时,我收到授权错误。将登录调用提供的授权与我需要使用的主要服务相结合的方法是什么?
顺便说一句,我使用的编程语言是 PHP 和本机 SoapClient 函数:http://www.php.net/manual/en/class.soapclient.php
The web service I'm trying to consume has such a WSDL file: http://dgpysws.teias.gov.tr/dgpys/services/EVDServis?wsdl
I'm trying to consume "setIkiliAnlasma" service, however accessing that service requires authentication. I have my credentials and when I make a SOAP call to login service it authenticates my credentials.
And as expected, when I call "setIkiliAnlasma" service I get an Authorization error. What is the method to combine authorization supplied by login call with the main service I need to consume?
By the way the programming language I'm usign is PHP and the native SoapClient functions: http://www.php.net/manual/en/class.soapclient.php
发布评论
评论(2)
下面是在 PHP 中使用 SOAPClient 进行身份验证的示例 - 您只需将其调整为您正在使用的 WSDL ->
然后,您将需要使用登录响应中发送给您的 sessionid/会话代码(可能在标头中),它特定于每个 WSDL。
Here is an example of using the SOAPClient in PHP with authentication - you just need to adapt it to the WSDL you are using ->
You will then need to use the sessionid / session code that is sent to you in the login response - maybe in a header - its specific to each WSDL.
尝试在调用soap客户端url时使用这种方式进行身份验证:
http://username:[电子邮件受保护]/
try to use this way to authenticate when calling the soap client url :
http://username:[email protected]/