在使用www.httpbin.org/get进行API测试时,折腾了几天,现在使用SAP API Portal 中遇到的一些问题汇总一下。
一、创建API提供者端口问题,
在创建API提供者时,在PORT一项中,提示的说明是:“Enter 443 as the port number for SSL and 8080 for all other ports.”,从这意思,应该是指HTTPS使用443端口,其它使用8080商品,一开始时我填入8080,报错如下:
{"fault":{"faultstring":"The Service is temporarily unavailable","detail":{"errorcode":"messaging.adaptors.http.flow.NoActiveTargets"}}}
经验证,发现,这里还是要按实际的端口填入,一般HTTP的地址还是要填入80,才正确。
二、在创建API时,要正确选择“
”,对于一般的如“www.httpbin.org/get”的地址,类型应该要选择"REST",一定不能选择错误,选择ODATA后,错误如下:
{
"fault":{
"faultstring":"Unable to identify proxy for host: default and url: \/p561598trial\/get_stock_history",
"detail":{
"errorcode":"messaging.adaptors.http.flow.ApplicationNotFound"
}
}
}
三、Route Rules错误,
当API创建时,默认会自动创建一个Route Rules名"Default",如图,此内容不能删除,也不能修改值的内容,细节如何使用还待研究,但此默认项目不能修改,报错如下:
{
"fault":{
"faultstring":"Unable to route the message to a Target Endpoint",
"detail":{
"errorcode":"messaging.runtime.RouteFailed"
}
}
}