我目前正在努力将我们的3g代码迁移到4g,我们如何将TargetEndpointOperationRef附加到4G中的服务标注。你能用一个例子解释一下吗?
< sci:ServiceCallout name =" sample" continueOnError ="假">
< sci:EndpointRef inheritAllFlowVariables =" true" inheritAllHeaders ="真" inheritQueryParams ="真">
< SCI:TargetEndpointRef> InterceptTarget< / SCI:TargetEndpointRef>
< SCI:TargetEndpointOperationRef> my_info< / SCI:TargetEndpointOperationRef>
< / SCI:EndpointRef>
< SCI:请求>
< sci:Payload ref =" tmpMessage" />
< sci:分配sourceval =" GET"类型="动词" />
< sci:分配sourceval =" application / vnd.vmware.admin.vdc + xml" targetval ="接受"类型="头" />
< / SCI:请求>
< / SCI:ServiceCallout>
由于
答案 0 :(得分:0)
截至目前,没有直接从服务标注
直接调用目标端点的方法另请注意。当您遇到类似这样的情况时,需要从ServiceCallout引用Target Url。最好使用目标服务器的概念。这样,您就不必在Service Callout Policies / Target.xml文件中的多个位置维护后端URL,但可以将其创建为环境级资源并在其中使用。
Eg
1. Create a Target server using management APIs
http://apigee.com/docs/api/api_methods/232-create-a-targetserver
2. Refer it in Service callout
<ServiceCallout name="service_callout_backend">
<HTTPTargetConnection>
<Properties/>
<HealthMonitor>
<IsEnabled>true</IsEnabled>
<IntervalInSec>30</IntervalInSec>
<TCPMonitor>
<ConnectTimeoutInSec>60</ConnectTimeoutInSec>
<Port>443</Port>
</TCPMonitor>
</HealthMonitor>
<LoadBalancer>
<Algorithm>RoundRobin</Algorithm>
<RetryEnabled>true</RetryEnabled>
<MaxFailures>10</MaxFailures>
<Server name="server1">
<IsEnabled>true</IsEnabled>
</Server>
<Server name="server2">
<IsEnabled>true</IsEnabled>
</Server>
</LoadBalancer>
<Path>/v1/backend1?token={access_token}</Path>
</HTTPTargetConnection>
<Request clearPayload="false" variable="request"/>
<Response>response</Response>
</ServiceCallout>
3. Refer in Proxy target server xml also similarly