Service Callout 政策部署错误问题排查

您正在查看的是 Apigee Edge 文档。
转到 Apigee X 文档
信息

URLMissing

错误消息

通过 Edge 界面或 Edge Management API 部署 API 代理失败,并显示以下错误消息:

Error Saving Revision [revision_number]
URL is missing in Step [policy_name]

错误消息示例

Error Saving Revision 2
URL is missing in Step ExecuteGeocodingRequest.

示例屏幕截图

原因

如果 Service Callout 政策中的 <URL> 元素缺失或留空,则 API 代理的部署将失败。

诊断

检查错误消息中指定的 Service Callout 政策中的 <URL> 元素。如果没有在元素内声明网址,则会导致错误。例如,以下 Service Callout 政策包含空的 <URL> 元素:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ServiceCallout name="ExecuteGeocodingRequest">
    <Request variable="GeocodingRequest"/>
    <Response>GeocodingResponse</Response>
    <HTTPTargetConnection>
        <URL></URL>
    </HTTPTargetConnection>
</ServiceCallout>

由于 <URL> 元素为空,因此 API 代理的部署将失败。

分辨率

确保 服Service Callout 政策中的 <URL> 元素具有有效网址。例如:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ServiceCallout name="ExecuteGeocodingRequest">
    <Request variable="GeocodingRequest"/>
    <Response>GeocodingResponse</Response>
    <HTTPTargetConnection>
        <URL>http://maps.googleapis.com/maps/api/geocode/json</URL>
    </HTTPTargetConnection>
</ServiceCallout>

ConnectionInfoMissing

错误消息

通过 Edge 界面或 Edge Management API 部署 API 代理失败,并显示以下错误消息:

Error Saving Revision [revision_number]
Connection information is missing in Step [policy_name]

错误消息示例

Error Saving Revision 1
Connection information is missing in Step ExecuteGeocodingRequest.

示例屏幕截图

原因

如果 Service Callout 政策没有 <HTTPTargetConnection><LocalTargetConnection> 元素,则 API 代理的部署将失败。

诊断

确定 Service Callout 政策是否定义了 <HTTPTargetConnection><LocalTargetConnection> 元素。例如:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ServiceCallout name="ExecuteGeocodingRequest">
    <Request variable="GeocodingRequest"/>
    <Response>GeocodingResponse</Response>
</ServiceCallout>

请注意,政策中未定义 <HTTPTargetConnection><LocalTargetConnection> 元素。

分辨率

确保 Service Callout 政策具有 <HTTPTargetConnection><LocalTargetConnection> 元素。例如:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ServiceCallout name="ExecuteGeocodingRequest">
    <Request variable="GeocodingRequest"/>
    <Response>GeocodingResponse</Response>
    <HTTPTargetConnection>
        <URL>http://maps.googleapis.com/maps/api/geocode/json</URL>
    </HTTPTargetConnection>
</ServiceCallout>

InvalidTimeoutValue

错误消息

通过 Edge 界面或 Edge Management API 部署 API 代理失败,并显示以下错误消息:

Error Saving Revision [revision_number]
Invalid Timeout value [0 or negative_number].

错误消息示例

Error Saving Revision 1
Invalid Timeout value -1.

示例屏幕截图

原因

如果 Service Callout 政策中的 <Timeout> 元素指定了零或负值,则 API 代理的部署将失败。

诊断

检查 Service Callout 政策中的 <Timeout> 元素。如果值为零或负数,则会导致错误。例如:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ServiceCallout name="ExecuteGeocodingRequest">
    <Request variable="GeocodingRequest"/>
    <Response>GeocodingResponse</Response>
    <Timeout>0</Timeout>
    <HTTPTargetConnection>
        <URL>http://maps.googleapis.com/maps/api/geocode/json</URL>
    </HTTPTargetConnection>
</ServiceCallout>

由于 <Timeout> 元素的值为零,因此代理无法部署。

分辨率

确保为 <Timeout> 元素指定的值为非零或非负数。例如:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ServiceCallout name="ExecuteGeocodingRequest">
    <Request variable="GeocodingRequest"/>
    <Response>GeocodingResponse</Response>
    <Timeout>10</Timeout>
    <HTTPTargetConnection>
        <URL>http://maps.googleapis.com/maps/api/geocode/json</URL>
    </HTTPTargetConnection>
</ServiceCallout>