php调用webapi出错问题
金蝶云社区-132xxxx4215
132xxxx4215
0人赞赏了该文章 2,178次浏览 未经作者许可,禁止转载编辑于2016年02月16日 16:37:40

结算币别 客户名称参数已经在Php传过去了为什么还是报错说 这些参数必填
客户请求数据:
{"format":1,"useragent":"ApiClient","rid":"{7F4A8004-1665-81D1-4529-3380E6FFFC4E}","parameters":["BD_Customer","{\"Creator\":\"String\",\"NeedUpDateFields\":[\"String\"],\"Model\":{ \"FCUSTID\":0, \"FNumber\":\"CUST100001\", \"FName\":\"CUST100001\", \"FCreateOrgId\":{\"FOrgID\":100001,\"FNumber\":\"101\",\"FName\":\"\"}, \"FUseOrgId\":{\"FOrgID\":100001,\"FNumber\":\"101\",\"FName\":\"\"}, \"FTRADINGCURRID\":{\"FCURRENCYID\":1,\"FNumber\":\"PRE001\"} }}"],"timestamp":"2016-02-16","v":"1.0"}
保存返回结果:
{"Result":{"ResponseStatus":{"ErrorCode":500,"IsSuccess":false,"Errors":[{"FieldName":"FTRADINGCURRID","Message":"字段“结算币别”是必填项"},{"FieldName":"FName","Message":"字段“客户名称”是必填项"},{"FieldName":"FCreateOrgId","Message":"字段“创建组织”是必填项"}],"SuccessEntitys":[]},"Id":""}}

php代码
$data_model = "{\"Creator\":\"String\","
."\"NeedUpDateFields\":[\"String\"],"
."\"Model\":{"
." \"FCUSTID\":0,"
." \"FNumber\":\"CUST100001\"," //编码
." \"FName\":\"CUST100001\"," //名称
." \"FCreateOrgId\":{\"FOrgID\":100001,\"FNumber\":\"101\",\"FName\":\"\"}," //创建组织
." \"FUseOrgId\":{\"FOrgID\":100001,\"FNumber\":\"101\",\"FName\":\"\"}," //使用组织
." \"FTRADINGCURRID\":{\"FCURRENCYID\":1,\"FNumber\":\"PRE001\"}" //结算币别
." }"
."}";

$data = array(
'BD_Customer',//业务对象标识FormId
$data_model//具体Json字串
);

$post_content = create_postdata($data);

$result = invoke_save($cloudUrl,$post_content,$cookie_jar);

//$array = json_decode($result,true);
echo '

';print_r('客户请求数据:');
echo '
';print_r($post_content);

echo '

';print_r('保存返回结果:');
echo '
';print_r($result);

请大神解决