Layer7 API Management

Expand all | Collapse all

How to send payload as Endpoint

Jump to Best Answer
  • 1.  How to send payload as Endpoint

    Posted 06-12-2017 05:00 AM

    Hello everyone,

     

    We are using API Gateway 9.2. 
    There is a service in which the API Gateway will receive a payload as request and the API Gateway needs to send it as an Endpoint and not as a resource or uri.

    What i have done in the policy is i have saved payload in a context variable and in the routing assertion i have added the backend IP with the variable referring to the payload such as http://IP OF BACKEND:9558/${paylaod}

    Still i am getting an error from backend.

    Please help !!

     

    Thanks & Regards,

    Irfan Mugale



  • 2.  Re: How to send payload as Endpoint

    Posted 06-12-2017 08:11 AM

    Hi Irfan,

     

    How have you saved the payload as? If its a message format then please use ${payload.mainpart} . What error are you receiving from backend?

     

    Regards,

    Ruchi



  • 3.  Re: How to send payload as Endpoint

    Posted 06-12-2017 08:21 AM

    Hello sir, 

     

    yes i am using the payload as ${payload.mainpart} . 

    The backend has a customized error if the payload is not in the endpoint  then we get a customized error from the backend  which says invalid request.

     

     

    Thanks 



  • 4.  Re: How to send payload as Endpoint

    Posted 06-12-2017 10:25 AM

    Hi Irfan,

     

    In simple test case in my lab I can use the route as

    http://<hostname>:8080/${payload.mainpart} 

    If this doesn't work then please specify what does payload variable contain we can verify if that works in lab.

     

    Regards



  • 5.  Re: How to send payload as Endpoint

    Posted 06-12-2017 10:42 AM

    hello sir, 

     

    I am using the same routing url as you shown. But the backend only excepts the payload if its in the endpoint and not in the resource.

     

    The policy made on gateway for which i am getting successful response:-

    1.I have made a policy with /*

    2.In the policy in the routing assertion i have used http:/hostname:port/${request.http.uri}

    3.while testing using soap ui in the endpoint section i am entering the gateway IP with the payload and i am getting successfull response.

    But i guess policy shouldnt be made in this format.



  • 6.  Re: How to send payload as Endpoint

    Posted 06-19-2017 01:19 AM

    what's the data format of ${paylaod}? as you use it in uri, it needs to be the format of query parameters and parameter values should be url encoded.



  • 7.  Re: How to send payload as Endpoint
    Best Answer

    Posted 06-19-2017 03:53 AM

    Hello,

     

    The Payload is in xml.

    The request which will come to gateway will be in body and from gateway we need to put it in the endpoint with URL of the backend. 

    We cant do any encode because the backend will not be able to accept it and throw us a error.



  • 8.  Re: How to send payload as Endpoint

    Posted 06-26-2017 01:01 AM

    Hello irfan.mugale ,

    It would be a surprise if "the backend" doesn't support url encoding, as it should be the http standard, RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1 , RFC 2396 - Uniform Resource Identifiers (URI): Generic Syntax .

     

    Just FYI.

     

    Regards,

    Mark