1

I want to know if WSO2 API Manager is compatible with Python and PHP based restful services or not?
I have several webservices which are developed on JavaEE, Python and PHP.
Except JavaEE, no other platform is communicating with WSO2.
On Python, I don't receive any RAW payload in my POST requests from WSO2. These services are working fine and can communicate with them via REST Console.

Please see my other STACKOVERFLOW POST for details.

I need to know how I can consume Python services just like my JavaEE services.

--UPDATE 2--

Both WSO2 AM and Python server use default settings

WSO2 Log - Python server response (NO TRY CATCH at server but root cause id empty payload)

    {org.apache.synapse.transport.http.wire} -  >> "OPTIONS /npl/1.0.0/neu-cha/getResults HTTP/1.1[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Host: 19.190.11.17:8243[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Origin: https://19.190.11.17:9443[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Access-Control-Request-Method: POST[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Content-Length: 0[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Access-Control-Request-Headers: accept, origin, authorization, content-type[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Connection: keep-alive[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Accept: */*[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10) AppleWebKit/600.2.5 (KHTML, like Gecko) Version/8.0.2 Safari/600.2.5[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Referer: https://19.190.11.17:9443/store/apis/info?name=neuCha&version=1.0.0&provider=admin&[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Accept-Language: en-us[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Accept-Encoding: gzip, deflate[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "[\r][\n]" {org.apache.synapse.transport.http.wire}

{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> OPTIONS /npl/1.0.0/neu-cha/getResults HTTP/1.1 {org.apache.synapse.transport.http.headers}

{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> Host: 19.190.11.17:8243 {org.apache.synapse.transport.http.headers}

{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> Origin: https://19.190.11.17:9443 {org.apache.synapse.transport.http.headers}

{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> Access-Control-Request-Method: POST {org.apache.synapse.transport.http.headers}

{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> Content-Length: 0 {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> Access-Control-Request-Headers: accept, origin, authorization, content-type {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> Connection: keep-alive {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> Accept: */* {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10) AppleWebKit/600.2.5 (KHTML, like Gecko) Version/8.0.2 Safari/600.2.5 {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> Referer: https://19.190.11.17:9443/store/apis/info?name=neuCha&version=1.0.0&provider=admin& {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> Accept-Language: en-us {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> Accept-Encoding: gzip, deflate {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 << HTTP/1.1 200 OK {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 << Origin: https://19.190.11.17:9443 {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 << Accept: */* {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 << Access-Control-Request-Method: POST {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 << Access-Control-Allow-Origin: * {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 << Access-Control-Allow-Methods: GET,PUT,POST,DELETE,PATCH,OPTIONS {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 << Access-Control-Request-Headers: accept, origin, authorization, content-type {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 << Referer: https://19.190.11.17:9443/store/apis/info?name=neuCha&version=1.0.0&provider=admin& {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 << Host: 19.190.11.17:8243 {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 << Accept-Encoding: gzip, deflate {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 << Accept-Language: en-us {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 << Access-Control-Allow-Headers: authorization,Access-Control-Allow-Origin,Content-Type {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 << Date: Wed, 27 Jul 2016 08:58:11 GMT {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 << Transfer-Encoding: chunked {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 << Connection: keep-alive {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.wire} -  << "HTTP/1.1 200 OK[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Origin: https://19.190.11.17:9443[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Accept: */*[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Access-Control-Request-Method: POST[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Access-Control-Allow-Origin: *[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Access-Control-Allow-Methods: GET,PUT,POST,DELETE,PATCH,OPTIONS[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Access-Control-Request-Headers: accept, origin, authorization, content-type[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Referer: https://19.190.11.17:9443/store/apis/info?name=neuCha&version=1.0.0&provider=admin&[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Host: 19.190.11.17:8243[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Accept-Encoding: gzip, deflate[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Accept-Language: en-us[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Access-Control-Allow-Headers: authorization,Access-Control-Allow-Origin,Content-Type[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Date: Wed, 27 Jul 2016 08:58:11 GMT[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Transfer-Encoding: chunked[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Connection: keep-alive[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "0[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "POST /npl/1.0.0/neu-cha/getResults HTTP/1.1[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Host: 19.190.11.17:8243[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Origin: https://19.190.11.17:9443[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Content-Type: application/json[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Accept-Language: en-us[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Accept-Encoding: gzip, deflate[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Connection: keep-alive[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Accept: application/json[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10) AppleWebKit/600.2.5 (KHTML, like Gecko) Version/8.0.2 Safari/600.2.5[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Authorization: Bearer c7648f6ee71099c2e4779dda1d4f5bdf[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Referer: https://19.190.11.17:9443/store/apis/info?name=neuCha&version=1.0.0&provider=admin&[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Content-Length: 22[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> POST /npl/1.0.0/neu-cha/getResults HTTP/1.1 {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> Host: 19.190.11.17:8243 {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> Origin: https://19.190.11.17:9443 {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> Content-Type: application/json {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> Accept-Language: en-us {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> Accept-Encoding: gzip, deflate {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> Connection: keep-alive {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> Accept: application/json {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10) AppleWebKit/600.2.5 (KHTML, like Gecko) Version/8.0.2 Safari/600.2.5 {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> Authorization: Bearer c7648f6ee71099c2e4779dda1d4f5bdf {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> Referer: https://19.190.11.17:9443/store/apis/info?name=neuCha&version=1.0.0&provider=admin& {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 >> Content-Length: 22 {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.wire} -  >> "{"query":"b'day card"}" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.headers} -  http-outgoing-5 >> POST /neu-cha/getResults HTTP/1.1 {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-outgoing-5 >> Origin: https://19.190.11.17:9443 {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-outgoing-5 >> Accept: application/json {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-outgoing-5 >> Referer: https://19.190.11.17:9443/store/apis/info?name=neuCha&version=1.0.0&provider=admin& {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-outgoing-5 >> Accept-Encoding: gzip, deflate {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-outgoing-5 >> Accept-Language: en-us {org.apache.synapse.transport.http.headers}

{org.apache.synapse.transport.http.headers} -  http-outgoing-5 >> Content-Type: application/json; charset=UTF-8 {org.apache.synapse.transport.http.headers}

{org.apache.synapse.transport.http.headers} -  http-outgoing-5 >> Transfer-Encoding: chunked {org.apache.synapse.transport.http.headers}

{org.apache.synapse.transport.http.headers} -  http-outgoing-5 >> Host: 19.190.11.98:8010 {org.apache.synapse.transport.http.headers}

{org.apache.synapse.transport.http.headers} -  http-outgoing-5 >> Connection: Keep-Alive {org.apache.synapse.transport.http.headers}

{org.apache.synapse.transport.http.headers} -  http-outgoing-5 >> User-Agent: Synapse-PT-HttpComponents-NIO {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.wire} -  << "POST /neu-cha/getResults HTTP/1.1[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Origin: https://19.190.11.17:9443[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Accept: application/json[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Referer: https://19.190.11.17:9443/store/apis/info?name=neuCha&version=1.0.0&provider=admin&[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Accept-Encoding: gzip, deflate[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Accept-Language: en-us[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Content-Type: application/json; charset=UTF-8[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Transfer-Encoding: chunked[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Host: 19.190.11.98:8010[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Connection: Keep-Alive[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "User-Agent: Synapse-PT-HttpComponents-NIO[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "16[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "{"query":"b'day card"}[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "0[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "HTTP/1.0 400 Bad Request[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Server: PasteWSGIServer/0.5 Python/2.7.11[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Date: Wed, 27 Jul 2016 08:58:15 GMT[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Content-Length: 767[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "Content-Type: text/html; charset=UTF-8[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "    <html>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "        <head>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "            <title>Error: 400 Bad Request</title>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "            <style type="text/css">[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "              html {background-color: #eee; font-family: sans;}[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "              body {background-color: #fff; border: 1px solid #ddd;[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "                    padding: 15px; margin: 15px;}[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "              pre {background-color: #eee; border: 1px solid #ddd; padding: 5px;}[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "            </style>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "        </head>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "        <body>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "            <h1>Error: 400 Bad Request</h1>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "            <p>Sorry, the requested URL <tt>&#039;http://19.190.11.98:8010/neu-cha/getResults&#039;</tt>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "               caused an error:</p>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "            <pre>Error while parsing chunked transfer body.</pre>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "        </body>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  >> "    </html>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.headers} -  http-outgoing-5 << HTTP/1.0 400 Bad Request {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-outgoing-5 << Server: PasteWSGIServer/0.5 Python/2.7.11 {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-outgoing-5 << Date: Wed, 27 Jul 2016 08:58:15 GMT {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-outgoing-5 << Content-Length: 767 {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-outgoing-5 << Content-Type: text/html; charset=UTF-8 {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 << HTTP/1.1 400 Bad Request {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 << Access-Control-Allow-Origin: * {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 << Access-Control-Allow-Methods: POST {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 << Access-Control-Allow-Headers: authorization,Access-Control-Allow-Origin,Content-Type {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 << Content-Type: text/html; charset=UTF-8 {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 << Date: Wed, 27 Jul 2016 08:58:11 GMT {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 << Transfer-Encoding: chunked {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.headers} -  http-incoming-9 << Connection: Close {org.apache.synapse.transport.http.headers}
{org.apache.synapse.transport.http.wire} -  << "HTTP/1.1 400 Bad Request[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Access-Control-Allow-Origin: *[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Access-Control-Allow-Methods: POST[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Access-Control-Allow-Headers: authorization,Access-Control-Allow-Origin,Content-Type[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Content-Type: text/html; charset=UTF-8[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Date: Wed, 27 Jul 2016 08:58:11 GMT[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Transfer-Encoding: chunked[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "Connection: Close[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "2ff[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "    <html>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "        <head>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "            <title>Error: 400 Bad Request</title>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "            <style type="text/css">[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "              html {background-color: #eee; font-family: sans;}[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "              body {background-color: #fff; border: 1px solid #ddd;[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "                    padding: 15px; margin: 15px;}[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "              pre {background-color: #eee; border: 1px solid #ddd; padding: 5px;}[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "            </style>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "        </head>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "        <body>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "            <h1>Error: 400 Bad Request</h1>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "            <p>Sorry, the requested URL <tt>&#039;http://19.190.11.98:8010/neu-cha/getResults&#039;</tt>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "               caused an error:</p>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "            <pre>Error while parsing chunked transfer body.</pre>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "        </body>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "    </html>[\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "0[\r][\n]" {org.apache.synapse.transport.http.wire}
{org.apache.synapse.transport.http.wire} -  << "[\r][\n]" {org.apache.synapse.transport.http.wire}

Python Service Code:

Using Django

from django.shortcuts import render
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt

@csrf_exempt
def path(request):
    try:
        print request
        if request.method == 'GET':
            return HttpResponse("Hello GET Django")
        elif request.method =='POST':
            print request.body #ERROR OCCURS HERE
            return HttpResponse(request.body)
    except Exception, e:
        print e
        return HttpResponse(e)

Using Google App Engine

import webapp2

class MainHandler(webapp2.RequestHandler):
    def get(self):
        self.response.write('Hello app world!')


class PostHandler(webapp2.RequestHandler):
    def post(self):
        data = self.request.body #ERROR OCCURS HERE
        print data
        self.response.write('SUCCESS')


app = webapp2.WSGIApplication([
    ('/', MainHandler),
    ('/data', PostHandler)
], debug=True)

These services are working fine and I am able to communicate with them via Rest Console.
But through WSO2's rest console, I am unable to pass my payload to service.
Payload either comes empty or I get Malformed Request Error.

I have added Content-Length in request as per solution Still content length in request header also comes 0 like Content-Length: 0

Services made using node.js and JEE works fine!!

Why there is issue communicating with Python from WSO2???

Community
  • 1
  • 1
Abhinav Tyagi
  • 5,158
  • 3
  • 30
  • 60
  • 1
    As long as backend is rest, API Manager should give response fine. It doesn't matter from what language you have written the backend. – lakshman Jul 19 '16 at 08:16
  • Can you show an example? I am using anaconda 2 for developing web services for python. – Abhinav Tyagi Jul 19 '16 at 09:19
  • As laskshman mentioned the underlining technology of the rest service is irrelevant for API manager. Did you verify that the HTTP methods and the paths you defined in API manager matches the ones in your service? – Makmeksum Jul 20 '16 at 09:19
  • Yes path is correct. Issue is that my payload gets dropped by the server. Inside service payload content length is coming 0 – Abhinav Tyagi Jul 21 '16 at 00:48
  • @lakshman can you help me here? I have updated my question. – Abhinav Tyagi Jul 27 '16 at 06:23
  • @Abhinav: I will check and get back to you. – lakshman Jul 27 '16 at 06:39
  • @lakshman anything...? My Java service works but same python service not. Inside my python service, I receive no payload with content-length:0. I have captured WSO2 logs for both. But can't share on the Internet because of NDA – Abhinav Tyagi Jul 27 '16 at 16:43
  • Are there any errors in wso2carbon.log when you send the request to python service? if any post here and could you enable the wire log and send a request to the python service and post the log here. you could refer http://mytecheye.blogspot.com/2013/09/wso2-esb-all-about-wire-logs.html to see how enable wire log. this article is for ESB and it is valid for APIM as well. – lakshman Jul 28 '16 at 04:22
  • @lakshman Error message from server is there... I am updating my question. But when I debug the service the body comes as empty. Even if I try the above python services then also body is empty. Both WSO2 and Python services are using default settings. – Abhinav Tyagi Jul 28 '16 at 04:40
  • That log snippet shows message going out from API Manager. To troubleshoot why you getting empty response we need the full log related to a request. When you send a request to API Manager it will print incoming request, after that API Manager will call backend, it will also print in wire log, then backend will send a response and APIM will send response back to us, both will print on wire log. Could you post them too? Another thing is I assume you are calling APIM from store in built swagger console? Am I right? And what is your APIM version? – lakshman Jul 28 '16 at 14:21
  • @lakshman I have updated and put the complete logs for python call. And yes, I am calling my service from inbuilt API console of WSO2 AM. It's version is latest one 1.10.0. – Abhinav Tyagi Jul 28 '16 at 15:11
  • Could you check using Advanced Rest Client instead of swagger console to call APIM and let me know the result? – lakshman Jul 28 '16 at 16:38
  • @lakshman Using ARC, I can hit the service. No issues with it. – Abhinav Tyagi Jul 28 '16 at 16:40
  • @lakshman I have mentioned this in my other post http://stackoverflow.com/questions/37966488/wso2-api-post-python-web-service-empty-or-no-payload-to-server – Abhinav Tyagi Jul 28 '16 at 16:41
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/118560/discussion-between-lakshman-and-abhinav-tyagi). – lakshman Jul 28 '16 at 16:46

0 Answers0