SOAP Providr登录信息?

时间:2018-06-15 10:53:33

标签: php soap

我用providr.io做了一些测试。 我可以从网站上获取信息但是当我在本地使用providr生成的数据包时出现“999”错误

请求中不存在登录信息(凭据),我应该在哪个文件中输入登录名和密码?

我的代码(使用tutorial.php文件):

  StructType\GetParcelShopByIdResponseType Object ( [ExitCode] => StructType\GLSExitCode Object ( [ErrorCode] => 999 [ErrorDscr] => ) [ParcelShop] => StructType\GLSParcelShop Object ( [ParcelShopId] => [Address] => StructType\GLSAddress Object ( [Name1] => [Street1] => [ZipCode] => [City] => [Country] => [Name2] => [Name3] => [ContactName] => [BlockNo1] => [Street2] => [BlockNo2] => [Province] => ) [Phone] => StructType\GLSPhonenumber Object ( [Country] => [Region] => [Contact] => [Extension] => ) [Mobile] => StructType\GLSPhonenumber Object ( [Country] => [Region] => [Contact] => [Extension] => ) [Fax] => StructType\GLSPhonenumber Object ( [Country] => [Region] => [Contact] => [Extension] => ) [Email] => [URL] => [GLSCoordinates] => StructType\GLSCoordinates Object ( [Latitude] => 0 [Longitude] => 0 ) [GLSWorkingDay] => ) ) 

我从浏览器获得的内容:

issueTeam

我忘记了什么吗?

2 个答案:

答案 0 :(得分:0)

您应该使用WSDL生成PHP SDK以生成PHP SDK,以便轻松使用SOAP WS。

查看PackageGenerator项目。它生成用于构造请求的结构类和发送请求的服务类。

由于您只处理生成器生成的已知对象类,因此响应处理更容易, 祝你好运,

答案 1 :(得分:0)

我找到了解决方法:

/**
 * Sample call for GetParcelShopById operation/method
 */
if ($get->GetParcelShopById(new \StructType\GetParcelShopByIdRequestType("*ID*", new \StructType\GLSUserCredentials($userName = "*MyUserName*", $password = '*MyPassword*'))) !== false) {
    print_r($get->getResult());    
} else {
    print_r($get->getLastError());

}

我们需要替换为您的个人信息