Target Servers Failing

Not applicable

I am trying to configure a my API Proxy to use a Target Server but when i swap from URL to Target Server the service stops working.

I have setup the target server in the correct environment using the below XML:

<TargetServer name="AxiAPIs">

<IsEnabled>true</IsEnabled>

<Host>https://url</Host>

<Port>443</Port>

</TargetServer >

I then add the following to the default Target Endpoint:

<HTTPTargetConnection>

<LoadBalancer>

<Server name="AxiAPIs"/>

</LoadBalancer>

<Path>/salesforce</Path>

</HTTPTargetConnection>

When I hit the API URL i get the following:

{"fault":{"faultstring":"The Service is temporarily unavailable","detail":{"errorcode":"messaging.adaptors.http.flow.ServiceUnavailable"}}}

If i change the endpoint to the below then it works.

<HTTPTargetConnection>

<URL>https://url/salesforce</URL>

</HTTPTargetConnection>

Solved Solved
0 11 1,576
1 ACCEPTED SOLUTION

Not applicable

I think with SSL you need the following (SSLInfo tag).

  <TargetServer name="AxiAPIs">
    <Host>url</Host>
    <Port>443</Port>
    <IsEnabled>true</IsEnabled>
    <SSLInfo><Enabled>true</Enabled> </SSLInfo>
</TargetServer>

View solution in original post

11 REPLIES 11

Not applicable

Are you able to explicitly verify that your target is available with the specified protocol (https) on the configured port (443) with the path (/salesforce) you provide? I have seen instances where https is running on a different port (say 8443), or the specified path is munged (extra slash perhaps), including the port on the host (so the computed URL looks like https://foo.com:443:443/), including the protocol in the host definition (so the computed URL looks like https://https://foo.com), etc.

Take a look at trace and see what you are seeing for your target URL there.

Not applicable

Yes i can confirm the backend service is running on https://url/salesforce.

I had a look at the trace but i can't see anywhere that shows the URL for the backend service. The only thing i can see is targetURL = "-NA-"

Typically you would see something like the following:

947-ss.png

Notice the method and URL at the top of the details frame? The value you are seeing for targetURL may be indicative of an issue in the target definition. Can you double check via an API call that the values are correct.

Not applicable

Sorry i can't see the screenshot.

API for the target server:

{
  "host": "https://url",
  "isEnabled": true,
  "name": "AxiAPIs",
  "port": 443
}

I am unsure of the API call to make to query the proxy config, but here is the XML from the portal for the endpoint:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<TargetEndpoint name="default"> 
    <Description/> 
    <PreFlow name="PreFlow"> 
        <Request/> 
        <Response/> 
    </PreFlow>
    <Flows/> 
    <PostFlow name="PostFlow"/> 
    <HTTPTargetConnection> 
        <LoadBalancer> 
            <Server name="AxiAPIs"/> 
        </LoadBalancer> 
        <Path>/salesforce</Path> 
    </HTTPTargetConnection> 
</TargetEndpoint>

You have the protocol specified as part of the host name - remove https:// from the host field and things should work.

Hi @scott.edwards @it1 - While creating the target server, don't use http or https as part of the host attribute.

i.e. in your example change

<TargetServer name="AxiAPIs">
	<IsEnabled>true</IsEnabled>
	<Host>https://url</Host>
	<Port>443</Port>
</TargetServer>

to

<TargetServer name="AxiAPIs">
	<IsEnabled>true</IsEnabled>
	<Host>url</Host>
	<Port>443</Port>
</TargetServer>

It should work!

Not applicable

I have tried that and it doesn't work unfortunately. I have tried many variations including:

<TargetServer name="AxiAPIs">
<IsEnabled>true</IsEnabled>
<Host>url</Host>
<Port>443</Port>
</TargetServer>

and (as shown in the docs)

<TargetServer name="AxiAPIs">
<IsEnabled>true</IsEnabled>
<Host>https://url</Host>
<Port>80</Port>
</TargetServer>

@Floyd Jones - reference above to a potential docs issue...

Thanks, @David Allen. I searched and found a topic where https was used in host and fixed it. @scott.edwards, apologies if this hosed you!

Not applicable

I think with SSL you need the following (SSLInfo tag).

  <TargetServer name="AxiAPIs">
    <Host>url</Host>
    <Port>443</Port>
    <IsEnabled>true</IsEnabled>
    <SSLInfo><Enabled>true</Enabled> </SSLInfo>
</TargetServer>

Not applicable

I managed to work it out myself by working backwards, i went straight to working on the mutual auth and got that working which fixed my issue. As i had to add the SSLInfo to do the mutual auth it meant that i effectively did what you suggested above. Thanks for everyone's help.