ServiceReferenceまたはWebReferenceを使用してC#でそれを行うにはどうすればよいですか
class SoapAuthentificationHeader {
/** @var string sPassword */
public $Password;
/** @var string sLogin */
public $sLogin;
/** @var string anotherCustomParam*/
public $sVod;
public function __construct($sLogin, $sPassword, $sVod) {
$this->sPassword=$sPassword;
$this->sLogin=$sLogin;
$this->sVod=$sVod;
}
}
$oSoap=new SoapClient('http://.[ my path ]...wsdl', array(
'trace' => 1,
'encoding' => 'UTF-8'
));
try {
$oSoap->__setSoapHeaders(array(new SoapHeader('urn:vod_soap', 'AuthenticationHeader', new SoapAuthentificationHeader('login', 'password', 'anotherCustomParam'))));
$iCountVideo = $oSoap->countVideo();
} catch (Exception $oException) {
var_dump($oException);
}
呼び出しの間に共有 CookieContainer をインスタンス化しようとしました。しかし、それはうまくいきませんでした:今のところ私は持っています:
vod_soapService s = new vod_soapService();
s.CookieContainer = new CookieContainer();
s.ConnectionGroupName = "test";
// this webmethod works it return me true
s.AuthenticationHeader("foo", "bar", "test");
string test = s.countVideo();