What is the reason for getting "502" error +garbage value in Apigee .

Not applicable

Hi.

when SAP system is calling a back end service using apigee proxy URL Apigee on premise is getting 502 error +garbage value in response content.but same URL+request when we try from other rest clients like SOAPUI ,postman etc Apigee is getting 200 ok +valid response.

Can anybody know why this is happening ?

Thanks,

0 17 1,128
17 REPLIES 17

Not applicable

Can you paste the value you get ? in both the cases.

@sriki77 , FYI, Please use comments to ask questions. So that we keep answers list clean.

@Ambili v nair

Can you use Api Proxy Trace Option in Apigee Edge and see whether backend is returning 502 or Apigee Proxy is returning 502 error ? Most probably i believe it's a backend issue since it works from other clients.

yes am using it,but my oncloud environment is giving 200 OK response +garbage value all the time only on premise is giving the 502 error when sap is requesting (API is internal to external call)

@Ambili v nair When you use trace options do you see 502 from target server or one of the policies ? What is target server for your API ?

Its

server SAP NetWeaver Application Server 7.21 / AS Java 7.30

Not applicable

@sriki77

garbage value

Sn0];2AHIchvHJRV/4z_lpaBܙ]U%Yښ1�4Uu2'ONwsHbm۴}Z7>c=rRb%3.ï>aoeN[;wD){R|j7To}G96Cc pDƚeeaj?-B@mVtH [u=Ev 6ʂ`)tiʇ,;f^Y6H KX2bSάZ n|?#>>G; &E1޹B_8]U$գ~h$2HrU6?B˧aa96^hQaó87 _IIPl --------------------------------------------................................................................................................................................................

Valid response

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Header><To xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing" ............................................... .....................................................................................................

It looks like a encoding issue,

can you inspect the headers, what sap is sending and what other clients are sending?

you could get this information from Apigee trace tool,

We tried to remove al sap header and add our headers but still it doesnt work.It works from POSTMAN but.

Not applicable

Are you specifying content be sent in gzip format? That might be one of the causes.

We are using gzip,deflate

<Header name="Accept-Encoding">gzip,deflate</Header> but still the problem persist.

Not applicable

Ambil,

Which consumer is making the call: ABAP, BSP, BHTML, WebDynPro, eetc? If you have Context-Specific Character Encoding - you want to make sure that you are specifying utf-8 or whatever your target is producing...

@David Allen

SAP NetWeaver Application Server 7.21 / AS Java 7.30, The program invoking the service is a Java webservice in SAP.

But wehn we invoke from our end using POSTMAN and SOAP UI REST project it works. ALso one more thing , when we invoke using SOAP UI SOAP project it also returns garbage value. Hope this info helps.

Not applicable

All, This is the respose which teh cleint is getting and same is visible in trace tool of apigee

Content-Length 436 436 content-type text/xml; charset=utf-8 text/xml; charset=utf-8 date Wed, 10 Jun 2015 12:05:27 GMT Wed, 10 Jun 2015 12:05:27 GMT server SAP NetWeaver Application Server 7.21 / AS Java 7.30 SAP NetWeaver Application Server 7.21 / AS Java 7.30 Response Content Body Sn0];2AHIchvHJRV/4z_lpaBܙ]U%Yښ1�4Uu2'ONwsHbm۴}Z7>c=rRb%3.ï>aoeN[;wD){R|j7To}G96Cc pDƚeeaj?-B@mVtH [u=Ev 6ʂ`)tiʇ,;f^Y6H KX2bSάZ n|?#>>G; &E1޹B_8]U$գ~h$2HrU6?B˧aa96^hQaó87 _IIPl Sn0];2AHIchvHJRV/4z_lpaBܙ]U%Yښ1�4Uu2'ONwsHbm۴}Z7>c=rRb%3.ï>aoeN[;wD){R|j7To}G96Cc pDƚeeaj?-B@mVtH [u=Ev 6ʂ`)tiʇ,;f^Y6H KX2bSάZ n|?#>>G; &E1޹B_8]U$գ~h$2HrU6?B˧aa96^hQaó87 _IIPl

Not applicable

Out of the box you don't have inflate or unzip on NWAS 7.2 - use the following header to force the server to return uncompressed xml:

'accept-encoding': 'gzip;q=0,text/xml'

Thanks David, we somehow did a service callout from post flow and returned the response back to SAP. But now SAP system complains SOAP:1.027 SRT: Serialization / Deserialization failed.

Not applicable

Your best option my be to have your BASIS team install the necessary service pack to enable inflate on the NW Java client.