我从JSON文件中读取了一些参数,对于每个参数,我都应该发送请求。当我真的将输出移动到任何元素时,我会得到错误:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
statusCode cannot be resolved or is not a field
string cannot be resolved or is not a field
body cannot be resolved or is not a field
The method getHeaders() is undefined for the type Response
at pricing.pricing_0_1.Pricing.tFileInputJSON_1Process(Pricing.java:3334)
at pricing.pricing_0_1.Pricing.tREST_1Process(Pricing.java:1783)
at pricing.pricing_0_1.Pricing.runJobInTOS(Pricing.java:4634)
at pricing.pricing_0_1.Pricing.main(Pricing.java:4366)

发布于 2015-07-15 21:28:29
我有相同的错误消息(也有JSON文件作为输入和输出),我发现解决方案是将输入、响应和错误模式保留为它们最初在tRESTClient中具有的结构。输入架构包含正文和字符串。在这里,您可以使用tXMLMap定义主体结构(这对我不起作用),也可以使用tMap将JSON文件作为字符串直接发送到tRESTClient中。响应具有模式statusCode、正文和字符串。同样,只要检索带有tMap和tLogRow的字符串,就会得到tRestClient的输出。我希望这能帮到你。
发布于 2015-10-27 04:09:42
在JSON中包含statusCode变量
发布于 2015-10-20 17:38:02
我也遇到了同样的错误,因为trestclient需要stausCode、body和String形式的模式输入。而输入是作为模式的键和值对提供的。因此,作为enter image description here,我们会收到错误
因此,我使用了tconvertType并将输出行从tconverttype转换为stausCode、body和String,然后它就开始工作了。enter image description here
所有的错误都消失了。
谢谢,
https://stackoverflow.com/questions/29032523
复制相似问题