How do we configure and call target server from service callout.

Not applicable

Hi ,

I am trying to call a Target server from the Service callout policy . but it is not working

I have used the below code to call target server from the default target flow and it worked .same way I have tried in the service callout and it is not working .

<HTTPTargetConnection>

<LoadBalancer>

<Server name="Target server Name "/>

</LoadBalancer>

</HTTPTargetConnection>

Thanks and Regards,

Ambili

1 7 1,300
7 REPLIES 7

Please can you provide the error you are seeing?

Your snippet looks good to me, please see below for a complete example:

<ServiceCallout async="false" continueOnError="false" enabled="true" name="service-callout">
    <DisplayName>service-callout</DisplayName>
    <Properties/>
    <Request clearPayload="true" variable="myRequest">
        <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
    </Request>
    <Response>myResponse</Response>
    <HTTPTargetConnection>
        <LoadBalancer>
            <Server name="yahoo"/>
        </LoadBalancer>
        <Path>/get</Path>
    </HTTPTargetConnection>
</ServiceCallout>

Hi,

Please see the error message below :

{ "fault": { "faultstring": "Execution of ServiceCallout Service-Callout-1 failed. Reason: eof unexpected", "detail": { "errorcode": "steps.servicecallout.ExecutionFailed" } } }

Thanks

Please see this answer here

Post back if this doesn't help!

Not applicable

you should do the configuration before you use the LoadBalance feature. are you sure you have done it yet?

I ran into the same issue. The answer mentioned by davissean did point me in the right direction.

The direct answer to this specific question is that you would need to include SSLInfo element in your ServiceCallout's HTTPTargetConnection configuration if your TargetServer is working on https.

<HTTPTargetConnection>
	<SSLInfo>
	  <Enabled>true</Enabled>
	</SSLInfo>
	<LoadBalancer>
		<Server name="Target server Name "/>
	</LoadBalancer>
</HTTPTargetConnection>

Hope this helps.

In addition to the above I had to add below snippet under <HttpTargetConnection> to get it working.

<Properties>

<Property name="use.proxy">false</Property>

<Property name="use.proxy.tunneling">false</Property>

</Properties>

I guess the above properties could be specific to one's proxy and not necessarily need to be included in all cases.

you are correct. These configurations are not required in the case of all targets, in some cases, this is used. This is based on the requirement of the target.

I have used the use.proxy in a scenario where the organization had the restriction to access endpoints from the internet, and we used forward proxy configuration to access that endpoint. This happens through a NAT IP. Organizations use NAT IPs through which they access external internet apis.