I'm having Error 500 when trying to connect to service, and I believe I´m not sending all the info it needs to work because I use SOAPUI and it responds OK.
This is the snapshot from SOAPUI:
snapshot from SOAPUI
So, my question is how to add the request representation from SOAPUI into the service. this is my service:
public interface ValidarDNIService {
#Headers({
"Accept: application/xml",
"Content-Type: text/xml",
"Accept-Charset: utf-8"
})
#POST("/API/CustomerManagement/v1/customer/verify")
Call<VerifiyCustomerCompleteResponse> validarDNI(#Body NationalIdentityCardIdentification body);
thanks,
FIXED.
Just copied the SOAPAction from SOAP UI and created a "SOAPAction" parameter as a header
Related
I need to identify type of authorization on web-site to set-up this authorization in soapui request.
When I log in there is 'auth' POST-method detected in google chrome Network tab: https://xx.xx.xx.xx/services/auth? with payload {"login":"some_login","password":"some_passw"}
And when I do this request in SoapUI as POST HTTP request: https://xx.xx.xx.xx/services/auth?login=some_login&password=some_passw ; there is a responce of json format which contains "token": "eyJ0eXAiOiAiSldUIiwgImFs..."
I want to set up athorization for another method on this web-site, so first of all I need to know the type of authorization to set up in soapui Auth Tab:
UPDATE:
Token is not used in HTTP request types, it is available in e.g. REST request:
But I still can not make this token work
It seems that I was looking for the wrong type of athorization. All above is about server uthorization. But I need to complete web-app authorization.
So just using token in Header params of SoapUI did the trick:
My application has the following architecture,
An angular 1.5 application has a service which sends request to one of endpoints on server.
The request is received by an nginx server if it is an http request it is redirected to https server.
Then the nginx server redirects my request to upstream node server.
In angular I use the http service to send get and post request.
I don't know if my request along with the data are travelling encrypted by https protocol or as plain text by http protocol from angular to server and back.Can someone please clarify what is going on, the data might contains personal details of user and it is important that it is encrypted.
This question asks the same but is not answered properly.
Thank You.
You can force $http to use HTTPS simply by ensuring that your URL is formatted correctly.
var req = {
method: 'POST',
url: 'https://localhost/api/v1/users', // note: https specified
headers: {
'Content-Type': undefined
},
data: { test: 'test' }
}
angularjs docs - $https
I am using $http for sending post request with json object to the nodeJS server but when I print the request params on the server side then it shows empty.Here is the code.
$http.post('/login',userObj);
This is how I handled request on server
server.post(/login/,function(req,res){
console.log(req.body);
});
The problem is not in your AngularJS code. You need to use body-parser in Nodejs to handle the request.
Using SignalR Silverlight client, the request to server is not JSON. Actually, it is JSON but it is UrlEncoded as value of field "data", something like this (POST payload):
data=%7b%22I%22%3a%220%22%2c%22H%22%3a%22s3Hub%22%2c%22M%22%3a%22notify%22%2c%22A%22%3a...
with header
Content-Type: application/x-www-form-urlencoded
This is not what I can easily visually check in tools like Fiddler. The response is OK - JSON as I'd expected. How could I configure the client to use application/json as Content-Type?
You can't. Today we send a form urlencoded payload to the server. In a future version we might send via JSON. It's an implementation detail that really shouldn't affect your application.
I'm working on a C coded server that have to reply to browsers' requests. It have to give authentication when using url like this:
http://user:pass#website/
but I really don't know how or where get this information on my server, because what I got when I read the request is the same that I can read when I interact with the server simply using
http://website/
Second question is that sometime I have this favicon.ico request from browsers.. what can I reply to the browser to say "I have not this fu*** stupid icon"? :D
I'm of course using socket for this
Look for a request header named Authorization: containing the string Basic followed by the BASE64 encoded username and password. This method of authenticating is called HTTP Basic Authentication.
For the favicon, simply respond with a HTTP 404 response if you don't have one.