-2

I am currently working on requirement to migrate our 3g code to 4g, How can we attach TargetEndpointOperationRef to service callout in 4G. Can you please explain with an example?

< sci:ServiceCallout name="sample" continueOnError="false">
< sci:EndpointRef inheritAllFlowVariables="true" inheritAllHeaders="true" inheritQueryParams="true">
< sci:TargetEndpointRef> InterceptTarget < /sci:TargetEndpointRef>
< sci:TargetEndpointOperationRef> my_info < /sci:TargetEndpointOperationRef>
< /sci:EndpointRef>
< sci:Request>
< sci:Payload ref="tmpMessage"/>
< sci:Assign sourceval="GET" type="verb"/>
< sci:Assign sourceval="application/vnd.vmware.admin.vdc+xml" targetval="Accept"type="header"/>
< /sci:Request>
< /sci:ServiceCallout>

Thanks

1 Answers1

0

As of now there is no direct way to call the Target Endpoint directly from a service callout

On an additional note. When you have a situation like this which requires a Target Url to be referred from ServiceCallout and otherwise. It will be better to use the Concept of Target Servers. This way you don't have to maintain the backend url at multiple places in Service Callout Policies/Target.xml files but can be created as Environment level resource and used across.

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
randomness
  • 1,377
  • 1
  • 14
  • 21