I just completed invoking SOAP Webservice from Erlang.
Here is what I did,
- inets:start(), This is very important without which http:request will not be succeeded.
- Took a shortcut: (hm.. not actually) I treated SOAP Call as Http POST call.
- I used Erlang http module
- http:request( post, URL, [{"Host" , Host}, {"SOAPAction", ""}],
"text/xml", getData ()},
[ {timeout, 5000} ], [{body_format, binary}])
- Used case expression to handle different condition
- getData() returns binary form of soap message. Here, correct payload of SOAP Request will be needed to make this request template. It returns binary form of the SOAP payload (String form can also be used)
- http:request would return either
- {ok, Result} -> Handle successful http request
- {error, Reason} -> Handle Errors
- {ok, saved_to_file}-> if you use “stream” option, this pattern will be invoked and it is optional.
- Result is response payload (http payload) and can be processed
Note:
Erlang has good support for Proxy and Proxy authentication unlike python. Python is mess in this area.