PHP 비누 클라이언트에서 "문자열 참조가 문자열의 인스턴스로 설정되지 않았습니다"나는 유형 (_getTypes)를 조회 http://link-products.chiangcn.com/APIService.asmx http://link-products.chiangcn.com/APIService.asmx?WSDL예외 내가의 서비스를위한 비누 클라이언트를 작성하기 위해 노력하고있어
그 서비스가 제공합니다.
<?php
$soap = new SoapClient('http://link-products.chiangcn.com/APIService.asmx?WSDL');
$arg = new stdClass;
$arg -> ClientId = 'ccd839ad-aef4-4748-a1c5-5235ef24f8ad';
$arg -> AccessToken = "155a0d0c2fea4e8a8c6da4bf5366241d";
$arguments = array('Request' => $arg);
$obj = $soap -> __soapCall('GetAuthorizedCategories', $arguments);
echo '<pre>';
var_dump($obj);
echo '</pre>';
?>
이 : 아래
Types:
struct GetAuthorizedCategories {
string Request;
}
웹 서비스의 'GetAuthorizedCategories'작업을 사용하려고 내 PHP 코드입니다 : 아래는 내가 수행하기 위해 노력하고있어 'GetAuthorizedCategories'작업의 유형 구조는 웹 서비스에서 예외가 발생했습니다.
object(stdClass)[3]
public 'GetAuthorizedCategoriesResult' => string '<?xml version="1.0"?>
<Errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Code>0</Code>
<Message>System.ArgumentNullException: String reference not set to an instance of a String.
Parameter name: s
at System.Text.Encoding.GetBytes(String s)
at PushData.Service.Utility.DeserializeXML[T](String xml)
at PushData.Service.APIService.GetAuthorizedCategories(String Request)</Message>
</Errors>' (length=459)
내가 작성한 첫 번째 SOAP 클라이언트입니다. 이 문제를 해결하는 데 도움이 될 것입니다.
PS :이
SoapClient는 매개 변수하지 XML로 배열을 받아 추가 정보를 원하시면 여기를 볼 수 있습니다. – GiGi
수정 응답을 확인하십시오. – SinisterGlitch
작동하지 않습니다. – GiGi