English 中文(简体)
公共卫生和社会福利部
原标题:GUID in PHP and SOAP
  • 时间:2011-11-09 13:44:51
  •  标签:
  • php
  • soap

我正在PHP的网络服务客户中工作。 每项申请都必须提供许可证钥匙,如17a18c4d-63ab-4eab-778f-20a67e1fe83a。

The problem is that according to the specification, the license is not a string but a Guid and the examples are in C, eg.

ListAllBookSubjects(Guid licenseKey, LanguageCodeTypeEnum language)

如果我尝试使用PHP的这个刀子(log和许可证不是实际的):

$url= "http://service.qa.pubhub.dk/MediaService1_4.asmx?WSDL";
$config = array( "login" => "[email protected]", "password" => "1234", "trace" => 1,"exceptions" => 0);
$objSoapClient = new SoapClient($url,$config);
print_r($objSoapClient->ListAllBookSubjects( {17a18c4d-63ab-4eab-778f-20a67e1fe83a} ,  DAN ));

我收到以下错误答复:

[message:protected] => System.Web.Services.Protocols.SoapException: Invalid LicenseKey {00000000-0000-0000-0000-000000000000}

我也尝试了。 很显然,指导原则是错误的,但我如何在项目组合中代表C Guid?

I 找到答案,见

问题回答

According to the WSDL at http://service.qa.pubhub.dk/MediaService.asmx?WSDL , it would seem as though a GUID is defined with a pattern value of:

[0-9a-fA-F]-1

否则,如果你无所作为,它肯定是好的。 许可证钥匙是否许可在服务器上发放? 它可以向服务提供者提出询问,并向他们提供正在提出的SOAP要求的副本或两项。

我试图利用风暴发出这一请求,并认识到这一请求需要参数名称:

print_r($objSoapClient->ListAllBookSubjects(array("licenseKey" => "17a18c4d-63ab-4eab-778f-20a67e1fe83a", "language"=>"DAN")));

以上版本完美地运作!

我不知道风暴,但服务提供者对此表示支持。 这似乎是一种非常有用的工具:





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签