Re: Exception werfen (Controller und Webservice)
"Nils Beckmann" <[email protected]> Fri, 23 Feb 2007 09:30:27 +0100
| Newsgroups | gmane.comp.lang.ruby.german |
|---|---|
| Message-ID | <[email protected]> |
--===============0689406673==
Content-Type: multipart/alternative;
boundary="----=_Part_45371_4059551.1172219427463"
------=_Part_45371_4059551.1172219427463
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Okay.
Ich nutze soap4r. Rufe =FCber eine Webservice eine Methode im Controller au=
f.
Der Webservice gibt ein String zur=FCck. Sieht wie folgt aus:
api_method :create,
:expects =3D> [{:var =3D> :string},
....
{:varX =3D :string}],
:returns =3D> [:string]
Im Controller wird eine Methode abgearbeite in der eine Exception auftreten
kann.
def methode
begin
.
.
rescue =3D> exc
end
end
In dem rescue soll jetzt das Exception handling passieren.
Ich hab es mit Exception.new(exc) versucht.
Das Ergebniss was ich bekommme ist das der R=FCckgabestring vom Webservice =
die
Message von der Exception enth=E4lt. Was ich aber m=F6chte ich das ich eine
soapfault zur=FCck bekomme. Hab leider auch noch nichts gefunden was mir sa=
gt
ob es einen soapfaul =FCberhaupt in Ruby oder Ruby on Rails gibt. Ich wei=
=DF nur
das es bei Java geht.
gru=DF
Nils
Am 22.02.07 schrieb Tim Becker <[email protected]>:
>
> > Kurzgesagt. Habe eine Controller der eine Exception zur=FCck geben soll=
,
> an
> > eine Webservice. =DCber Soap. Es soll also ein soapfault zur=FCck komme=
n.
> > Vielleicht hat ja noch einer eine idee
>
>
> Ich vermute mal, dass Du soap4r verwendest? Was passiert den jetzt,
> wenn Du die Ruby Exception wirfst? Vielleicht kannst Du ein bisschen
> naeher erlaeutern, was Du probierst, was nicht wie erwartet
> funktioniert, usw. Idealerweise mit ein wenig Code.
>
> Gruss,
> -tim
>
>
>
> >
> > _______________________________________________
> > Ruby-de-talk mailing list
> > [email protected]
> > http://rubyforge.org/mailman/listinfo/ruby-de-talk
> >
> _______________________________________________
> Ruby-de-talk mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/ruby-de-talk
>
------=_Part_45371_4059551.1172219427463
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
<span class=3D"ppt" id=3D"[email protected]">Okay.<br><br>Ic=
h nutze soap4r. Rufe =FCber eine Webservice eine Methode im Controller auf.=
Der Webservice gibt ein String zur=FCck. Sieht wie folgt aus:<br></span><s=
pan class=3D"ppt" id=3D"[email protected]">
api_method :create, <br> =
:expects =3D> [{:var =
=3D> :string},<br>  =
; &nbs=
p; ....<b=
r> =
 =
; {:varX =3D :string}],<br>=
&nb=
sp; :returns =3D> [:string]
<br><br>Im Controller wird eine Methode abgearbeite in der eine Exception a=
uftreten kann.<br><br>def methode<br> begin<br>&nbs=
p; .<br>&=
nbsp; .<b=
r> rescue =3D> exc<br> <=
br> end<br>end<br><br>In dem rescue soll jetzt das =
Exception handling passieren.
<br>Ich hab es mit Exception.new(exc) versucht.<br>Das Ergebniss was ich be=
kommme ist das der R=FCckgabestring vom Webservice die Message von der Exce=
ption enth=E4lt. Was ich aber m=F6chte ich das ich eine soapfault zur=FCck =
bekomme. Hab leider auch noch nichts gefunden was mir sagt ob es einen soap=
faul =FCberhaupt in Ruby oder Ruby on Rails gibt. Ich wei=DF nur das es bei=
Java geht.
<br><br>gru=DF<br>Nils<br><br></span><br><div><span class=3D"gmail_quote">A=
m 22.02.07 schrieb <b class=3D"gmail_sendername">Tim Becker</b> <<a href=
=3D"mailto:[email protected]">[email protected]</a>>:</span><blockquot=
e class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 204, 204);=
margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> Kurzgesagt. Habe eine Controller der eine Exception zur=FCck geben sol=
l, an<br>> eine Webservice. =DCber Soap. Es soll also ein soapfault zur=
=FCck kommen.<br>> Vielleicht hat ja noch einer eine idee<br><br><br>Ich=
vermute mal, dass Du soap4r verwendest? Was passiert den jetzt,
<br>wenn Du die Ruby Exception wirfst? Vielleicht kannst Du ein bisschen<br=
>naeher erlaeutern, was Du probierst, was nicht wie erwartet<br>funktionier=
t, usw. Idealerweise mit ein wenig Code.<br><br>Gruss,<br> -tim=
<br><br>
<br><br>><br>> _______________________________________________<br>>=
; Ruby-de-talk mailing list<br>> <a href=3D"mailto:Ruby-de-talk@rubyforg=
e.org">[email protected]</a><br>> <a href=3D"http://rubyforge.o=
rg/mailman/listinfo/ruby-de-talk">
http://rubyforge.org/mailman/listinfo/ruby-de-talk</a><br>><br>_________=
______________________________________<br>Ruby-de-talk mailing list<br><a h=
ref=3D"mailto:[email protected]">[email protected]</a><br=
>
<a href=3D"http://rubyforge.org/mailman/listinfo/ruby-de-talk">http://rubyf=
orge.org/mailman/listinfo/ruby-de-talk</a><br></blockquote></div><br>
------=_Part_45371_4059551.1172219427463--
--===============0689406673==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Ruby-de-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ruby-de-talk
--===============0689406673==--