triple_des(des3) 算法 - php,python 实现
wos2 WSF/PHP soap header 认证实现

PHP: Soap 通过 soap header 认证(non-wsdl 模式)

TLHL28 posted @ Mon, 30 May 2011 17:08:07 +0800 in 随笔 with tags php soap , 10965 readers

 

soap service 是 java的 axis2

soap client 是 php. = =

                 $url = "http://localhost:8000/PortalService";
                // 对应wsdl 文件定义中的targetNamespace
		$uri = "http://localhost/partalService";

		$key = "xxx";
		$pwd = "xxx";

		$options=array(
			//'soap_version'=>SOAP_1_2,
			'trace'=>1,
			//"exceptions"=>1,
			'location'=>$url,
			'uri'=>$uri,
		);

		$auth_header = array(
			'user'=>$key,
			'password'=>$pwd,
		);
                // 下面的RequestSOAPHeader 对应 wsdl 定义里面的 <xsd:element name="RequestSOAPHeader">.....
		$authvalues = new SoapVar($auth_header, SOAP_ENC_OBJECT,"RequestSOAPHeader",$uri);  
		$header = new SoapHeader($uri, 'RequestSOAPHeader', $authvalues);

		$api = new SoapClient(null,$options);
		$api->__setSoapHeaders(array($header));
		
                // 在调用 java axis2 soap 的使用要这么定义, 不然会变成 <param0><item>xxx</item><value>xxx</value></param0>
                // 所以会报错. 用一下定义生成的就是这样的格式: <user>asdf</user>
		$p = array(
			new SoapParam("asdf",'user'),
			new SoapParam(1,'password'),
		);
		try {
			$call="Login";
			$result = $api->__soapCall($call,$p);
			print_r($result);
		} catch(SoapFault $e) {
			if(1) {
				var_dump($api->__getLastRequestHeaders());
				var_dump($api->__getLastRequest());
				var_dump($api->__getLastResponseHeaders());
				var_dump($api->__getLastResponse());
				echo $e->getMessage();
			}
		}

 

51aijianakng said:
Fri, 24 May 2013 10:23:20 +0800

刚学这个不是很懂,要是写详细点就好了,不知道能不能在实例话客户端的时候就传一个值,就想构造函数一样

Rylan Landon said:
Wed, 02 Jan 2019 16:25:20 +0800

This is the wonderful content, Cheers pertaining to supplying us this info. Preserve putting up. Tax Advisors

remove password said:
Sun, 09 Jun 2019 13:22:21 +0800

the main question is how to remove password in window 10 but this can be done by the use of this free site.

Benjamin Ford said:
Mon, 09 Sep 2019 02:16:17 +0800

   Frequently while I search the internet I try to find websites that supply reliable information so I found this site. I want to mention that I found the info in your web page has been particularly interesting and that I learned something new. We're certain to look for the next article.. Thank you for the good write-up I will revisit in the future. international phone forwarding

Benjamin Ford said:
Thu, 12 Sep 2019 13:41:38 +0800

Once I thought about things like: why such information is for free here? Because when you write a book then at least on selling a book you get a percentage. Thank you and good luck on informing people more about it…havalı yatak

Benjamin Ford said:
Fri, 13 Sep 2019 08:16:28 +0800

On this page, you'll see my profile, please read this information.  Svg Logo

Benjamin Ford said:
Thu, 19 Sep 2019 00:00:00 +0800

I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post. Hero Instinct

Benjamin Ford said:
Sat, 21 Sep 2019 19:51:19 +0800

I finally found great post here.I will get back here. I just added your blog to my bookmark sites. thanks.Quality posts is the crucial to invite the visitors to visit the web page, that's what this web page is providing.  детски стаи

Benjamin Ford said:
Sat, 21 Sep 2019 20:36:04 +0800

This is very interesting, but it is necessary to click on this link:  Монтесори варна

Benjamin Ford said:
Sun, 22 Sep 2019 03:11:09 +0800

Actually I read it yesterday but I had some thoughts about it and today I wanted to read it again because it is very well written. contact lens cases

Benjamin Ford said:
Sun, 22 Sep 2019 04:18:07 +0800

Initial You got a awesome blog .I determination be involved in plus uniform minutes. i view you got truly very functional matters , i determination be always checking your blog blesss. Селфи рамка

Benjamin Ford said:
Sun, 22 Sep 2019 19:03:26 +0800

I like viewing web sites which comprehend the price of delivering the excellent useful resource free of charge. I truly adored reading your posting. Thank you!  hasta yatağı

Benjamin Ford said:
Mon, 23 Sep 2019 20:24:07 +0800

These you will then see the most important thing, the application provides you a website a powerful important internet page: part time maid services dubai

Benjamin Ford said:
Wed, 25 Sep 2019 02:15:55 +0800

I wrote about a similar issue, I give you the link to my site.  Auto Likes Free

Benjamin Ford said:
Fri, 04 Oct 2019 19:41:16 +0800

Nice information, valuable and excellent design, as share good stuff with good ideas and concepts, lots of great information and inspiration, both of which I need, thanks to offer such a helpful information here. Variant 31 London

Benjamin Ford said:
Tue, 08 Oct 2019 00:39:21 +0800

I am looking for and I love to post a comment that "The content of your post is awesome" Great work!  apartment atlanta

Benjamin Ford said:
Tue, 15 Oct 2019 13:54:49 +0800

Your texts on this subject are correct, see how I wrote        this site is really very good. 바카라사이트

Kevin Richardson said:
Thu, 07 Nov 2019 02:11:39 +0800

   Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! Web design

Kevin Richardson said:
Thu, 07 Nov 2019 02:14:19 +0800

   This is helpful, nonetheless it can be crucial so that you can check out the following website: crystal employee recognition awards

Kevin Richardson said:
Tue, 19 Nov 2019 02:28:16 +0800

I am a new user of this site so here i saw multiple articles and posts posted by this site,I curious more interest in some of them hope you will give more information on this topics in your next articles.  enyotube

Kevin Richardson said:
Tue, 19 Nov 2019 02:32:11 +0800

So it is interesting and very good written and see what they think about other people.  cover graphic

Kevin Richardson said:
Sat, 23 Nov 2019 14:45:04 +0800

On this page you can read       my interests, write something special. make your videos look like film

Kevin Richardson said:
Mon, 02 Dec 2019 16:10:13 +0800

Profit primarily prime quality items -- you can understand them all within: Receitas para secar

Kevin Richardson said:
Fri, 20 Dec 2019 14:44:00 +0800

This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck.  Stylez

Kevin Richardson said:
Fri, 20 Dec 2019 14:52:37 +0800

Nice information, valuable and excellent design, as share good stuff with good ideas and concepts, lots of great information and inspiration, both of which I need, thanks to offer such a helpful information here. Assisted Living Facility Pasadena California


Login *


loading captcha image...
(type the code from the image)
or Ctrl+Enter