|
|
| Author |
Message |
< Yaws mailing list ~ Code in soap server module crashes Yaws |
| Guest |
Posted: Fri Oct 05, 2007 12:20 pm |
|
|
|
Guest
|
Hello all,
I'm an Erlang newbie, so please don't hit me too hard if I fail in my
beginning, baby steps into this wonderful new world.
I'm developing web services with Yaws, and I've found some code in the
soap server module that can be (mis-) used to crash the web server. If
a soap client sends a request for a web service that's not started on
the server, yaws will crash instead of returning a nice error message.
The functions involved are request/5 and handle_call/3 in
yaws_soap_srv module. I've written my own code to handle this. My code
might not be the perfect solution, but anyway, the problem perhaps
should be fixed in the next version of Yaws?
My code (original code are commented out):
handle_call( {request, Id, Payload, SessionValue, SoapAction}, _From, State) ->
% Reply = request(State, Id, Payload, SessionValue, SoapAction),
% {reply, Reply, State}.
try request(State, Id, Payload, SessionValue, SoapAction) of
Reply -> {reply, Reply, State}
catch
throw: model_error ->
{reply, cli_error("Model error."), State};
throw: _ ->
{reply, srv_error("Unknown server error."), State}
end.
request(State, {M,F} = Id, Payload, SessionValue, Action) ->
% {ok, Model} = get_model(State, Id),
{Status, Model} = get_model(State, Id),
case Status of
ok -> ok;
error -> throw(model_error);
_ -> throw(other_error)
end,
[remaining code left out]
Regards,
Andreas
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post recived from mailinglist |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|