Error when consuming backend without basepath

Not applicable

Hi,

We are trying to hit a SOAP service on a backend. We see the below error in Apigee :

Properties

error Request path cannot be empty

type ErrorPoint

state TARGET_REQ_FLOW

error.class com.apigee.errors.http.server.InternalServerError

error.cause Request path cannot be empty

Identifier fault

The target.url that we have configured is as below :

target.url = https://somebackend.com:8888

It is very much valid to consume a service that is hosted on just a host:port right ?

However, if we do add a "/" and make it https://somebackend.com:8888/ the calls continue further and reach the backend.

Why is this so? Is there any workaround ?

Thanks in advance.

Rangan

0 4 1,538
4 REPLIES 4

Sorry, I don't know why it is so.

I think the workaround is what you described: add the slash. As you noted, it allows the calls to continue.

Is that not acceptable to you?

That is still a workaround. What is the backend deos a check and filters out calls ?

More importantly, i am wondering as to why there is such a check in place. Isnt hosting a service on just a host:port a valid case ?

I faced this issue today..is there any solution possible for this instead of adding a slash at the end?

My target is dynamic (sent by the client) and we are using Apigee to validate it and deliver webhook payloads to them.

They may have configured server:port but not server:port/ which will fail validation.

Not applicable

It is valid to have only dns and port number as backend. Normally this is the landing page of any web service and not a good practice to access any service url.

When you are trying to have loadbalancer configuration Path needs to be set. For target.url it automatically takes after the end of domain name.

You can try using URL tag and it works without any Path.

But there is another option of using message template with service callout and it works as expected.

Step 1: using assign message policy or javascript policy set your target to a variable.

Ex: var abc = "xyz.com"

Step 2: using a service callout set the target url as below

<URL>https://{abc}</URL>

This works as per the dynamic target set without path.