How to make post request using SOAP in node.js - node.js

I'm using the library SOAP (https://www.npmjs.com/package/soap) to make requests to a wsdl, but I'm getting the error HTTP GET not supported, using SOAPUI or even axios with post method seems to work

Related

Api is working fine with postman but not working in react

Nodejs api is working fine with postman but while i'm trying it with react i'm getting some errors like message: "Request aborted", name: "AxiosError", code: "ECONNABORTED"
I haven't added the authentication yet in my api so that is not needed i guess.
I tried to send it in various ways even i tried to handle preflight problem of cors but not sure if i handled that or not! the api is working with postman absolutely ok response as expected.
make sure you don't pass credentials query params in you get request. if you have added credentials in your get request replace your http method with post.

How to set the cookies response when calling nodejs api from laravel?

I have on linux server a running nodejs and laravel. When I try to call the nodejs api endpoint. The response is
{"errors":[{"msg":"Invalid value","param":"cookies","location":"body"}]}
This is the api call to the node
$response = $myclient->request("POST", "/api/path", ["json" => $query]);
The nodejs api is generating the cookies, but it is not readable. The project is using GuzzleHttp for handling the request on laravel. Is there a specfic method to define cookies with response?

Invalid and trucated data receiving while calling node API get route

While calling Node API get HTTP method data comes in truncated format, incomplete JSON.
But when calling the same api using POSTMAN getting proper response.
If is there any issue regarding NodeAPI please guide how can I solve it?

code HPE_INVALID_METHOD Node js Hapi js

I am trying to make GET request to my API endpoint and when I do the request from another server to the API I see this strange error (on the API):
170125/230803.439, [log,connection,client,error] data: {"bytesParsed":0,"code":"HPE_INVALID_METHOD"}
What does this error mean?
I am sorry I did request on https:// I should have done it on http:// instead

How to see request and response data in node soap?

I am trying to consume a soap api using node soap. My response cannot be parsed and I wonder how to see the request and response data to console to ease the error finding process.
As node soap uses the request library, one can debug it via:
NODE_DEBUG=request node src/index.js
as pointed out request's Readme.md:
Debugging
There are at least three ways to debug the operation of request:
Launch the node process like NODE_DEBUG=request node script.js (lib,request,otherlib works too).
Set require('request').debug = true at any time (this does the same thing as #1).
Use the request-debug module to view request
and response headers and bodies.
To see the generated SOAP XML request you can use this:
Client.lastRequest - the property that contains last full soap request for client logging

Resources