Soap request body using 'postman' chrome app - web-services

How would the body of a soap request look like for the 'holiday web service' (http://www.holidaywebservice.com/HolidayService_v2/HolidayService2.asmx?wsdl) using the Postman google app?
I'm trying to use the getHolidaysAvailable method. I have tried the suggested format found on the holidaywebservice.com site but it does not work. In short, can anyone successfully post to this web service using Postman and share the soap request headers and body you use. Thanks!

Method needs to be POST and use http://www.holidaywebservice.com//HolidayService_v2/HolidayService2.asmx?wsdl as the URL.
You must include the following in the Headers:
Content-Type: text/xml; charset=utf-8
You can add SOAPAction in the headers but is not necessary for this web service request to work as the request body will specify which SOAP Method to use, 'GetHolidaysAvailable'.
SOAPAction: "http://www.holidaywebservice.com/HolidayService_v2/GetHolidaysAvailable"
Finally, the Body should look like this:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.holidaywebservice.com/HolidayService_v2/">
<SOAP-ENV:Body>
<ns1:GetHolidaysAvailable>
<ns1:countryCode>UnitedStates</ns1:countryCode>
</ns1:GetHolidaysAvailable>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Your request could be something like this even:
POST /HolidayService_v2/HolidayService2.asmx/GetHolidaysAvailable HTTP/1.1
Host: www.holidaywebservice.com
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
countryCode=UnitedStates

Related

What is the URL header used for in AWS API GET request?

I am looking at example AWS STS API request calls like below from the AWS web page
GET / HTTP/1.1
Host: sts.amazonaws.com
Content-Type: application/json; charset=utf-8
URL: https://sts.amazonaws.com/?DurationS .......
I can't seem to understand if the URL HTTP Header is a custom header used only by AWS or if its something new in HTTP (like with CORS)
Either way I could not find any reference to this Header.
Can someone please explain what this header is ? (i.e custom to AWS or something more general)

About multipart/form-data and boundary=MIMEBoundary_*

Currently i am using WSO2 API manager 1.8.0 to secure my web service endpoints . There is a end point allow to upload file and text (multipart/form-data). Firstly, I have invoked the endpoint directly and got success. Then i create a API by using WSO2 AM and provide upload file end point for production and sandbox url. After invoked, i got exception regarding to "Body part ended prematurely. Boundary detected in header or EOF reached."
I have investigated and see that the content type is changed
This is the correct one:
Content-Type: multipart/form-data; boundary=a65f7a9e-30a7-41ce-986b-e0ba8678cd7d
--a65f7a9e-30a7-41ce-986b-e0ba8678cd7d
Content-Disposition: form-data; name="type"
Content-Type: application/x-www-form-urlencoded
MY_DA_TA
--a65f7a9e-30a7-41ce-986b-e0ba8678cd7d--
And this is the difference
Content-Type: multipart/form-data; charset=UTF-8; boundary=MIMEBoundary_f7e66aa74d83cdf3eca30fd8f62eff42fd5b2e5d627e4e78
--2819d1cd-319b-4d7b-9685-b9944b6e22e5
Content-Disposition: form-data; name="type"
Content-Type: application/x-www-form-urlencoded
MY_DA_TA
--2819d1cd-319b-4d7b-9685-b9944b6e22e5--
How can i correct that ?
Just by glance I found a similar query [1]. Could you check if that works for you.
[1] multipart form data file upload using WSO2 API manger ?

HTTP POST request using boost::asio

Where can I see an example of HTTP POST request using boost::asio?
I've only saw some examples with HTTP GET requests.
Look at this http request header for example:
POST /path/script.cgi HTTP/1.0
From: test#tests.com
User-Agent: HTTPTool/1.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 32
argument1=text&argument2=arg2text
Check out the get example and change the request to this. Probably alter whatever you think should be altered

Force Internet Explorer to read POST message without downloading it

I have a scenario in which a client application sends a POST request to an asp.net page to which the page responds with a json string which I need to consume on the client side.
However, Internet explorer is trying to download the *.aspx page, containing the json string.
What HTTP headers must the response contain to disable the download in Internet Explorer?
Currently, the response HTTP headers are:
Access-Control-Allow-Headers:X-File-Name,X-File-Type,X-File-Size
Access-Control-Allow-Methods:GET,POST,OPTIONS
Access-Control-Allow-Origin:*
Cache-Control:private,private, no-cache
Content-Length:1050
Content-Type:application/json; charset=utf-8
Date:Fri, 12 Jul 2013 08:24:24 GMT
Pragma:no-cache
Server:Microsoft-IIS/7.5
Set-Cookie:ASP.NET_SessionId=qjudp3nct3czltyvc4yxpiri; path=/; HttpOnly
X-AspNet-Version:4.0.30319
X-Powered-By:ASP.NET
It depends on how you are consuming that web service.
If you are consuming it from inside a web page using jQuery, it shouldn't be a problem, Internet Explorer won't force download the file.
If you access the file directly after the POST (redirect to the URL that serves the JSON) and you want to display the JSON as plain text, you must set the Content-Type to text/plain; charset=utf-8

Able to GET authenticate but not POST authenticate

I am trying to connect to a REST API, using C#.
I was able to successfully do some GET request but POST kept giving me 401 Authentication error.
I have gone ahead and downloaded fiddler and this is what my requests look like:
GET (Works)
Request Headers
GET https: //hello.myurl.com/api HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Accept: application/xml
Authorization: Basic ***************************************************************************************************
Host: hello.myurl.com
-
POST (Doesn't work)
Request Headers
POST https: //hello.myurl.com/api HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Accept: application/xml
Authorization: Basic ***************************************************************************************************
Host: hello.myurl.com
Content-Length: 12
Request Body
status=hello
(* same in both using
String authinfo = "username:password";
Convert.ToBase64String(Encoding.ASCII.GetBytes(authInfo));
Any ideas why?
I'd consult the API documentation for that particular URL. GET requests are simply requesting a readonly version of data, a POST request is implying that you are making a change to a certain URL, so it's possible that the API allows GET requests without authentication, but requires authentication on the POST request.
In your case I'd hazard a guess that your authentication is not correct, but it's just being ignored on the GET request as it doesnt need authentication.