Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > SOAP4R: raise error with custom fault code

Reply
Thread Tools

SOAP4R: raise error with custom fault code

 
 
Peter C. Verhage
Guest
Posts: n/a
 
      01-15-2005
Hi,

Does anybody know how I can raise an SOAP error with a custom fault code
in my SOAP4R SOAP::RPC:StandaloneServer subclass?

Regards,

Peter
 
Reply With Quote
 
 
 
 
NAKAMURA, Hiroshi
Guest
Posts: n/a
 
      01-16-2005
--------------enigB12AE436EC3AAE247FAB1DD5
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

Peter C. Verhage wrote:
> Does anybody know how I can raise an SOAP error with a custom fault code
> in my SOAP4R SOAP::RPC:StandaloneServer subclass?


Soap4r does not support SOAP Fault Codes
now...(http://rrr.jin.gr.jp/doc/soap4r/RELE...l#restrictions) As
far as I know, you're the first person to try to do it.

I just modified the server implementation a little to let user allow to
return a SOAPFault instance. Following is excerpt of
http://rrr.jin.gr.jp/projects/soap4r...customfault.rb.

class CustomFaultServer < SOAP::RPC::StandaloneServer
def on_init
add_method(self, 'fault', 'msg')
end

def fault(msg)
SOAPFault.new(SOAPString.new("mycustom"),
SOAPString.new("error: #{msg}"),
SOAPString.new(self.class.name))
end
end

Snapshot tarball is at http://rrr.jin.gr.jp/download/ . With the latest
snapshot tarball, you can set a SOAPString as a faultcode(the first
parameter of SOAPFault#new) but it might not be enough for your usage.

Would you please try it and let me know what is still missing.

# ticket: http://rrr.jin.gr.jp/projects/soap4r/ticket/63

Regards,
// NaHi

--------------enigB12AE436EC3AAE247FAB1DD5
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFB6eT8f6b33ts2dPkRAtPVAJ4wIZuYZ0vcwrB7ItExAJ Jvk/WA8QCcDuR/
So2cb2CQDbhIBVURTGl8kTg=
=l8l8
-----END PGP SIGNATURE-----

--------------enigB12AE436EC3AAE247FAB1DD5--


 
Reply With Quote
 
 
 
 
Peter C. Verhage
Guest
Posts: n/a
 
      01-16-2005
NAKAMURA, Hiroshi wrote:
> Would you please try it and let me know what is still missing.


Thanks for your quick reply and implementation! I will test it as soon
as possible, hopefully in the next few days. Will let you know if
anything is missing (but it doesn't look like it).

Regards,

Peter
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Raise X or Raise X()? bvdp Python 10 03-12-2012 04:08 PM
"raise (type, value, traceback)" and "raise type, value, traceback" Jack Bates Python 0 05-02-2011 05:23 PM
raise Exception or raise Exception() ernest Python 2 11-14-2010 08:14 PM
Segmentation fault at raise exception. O01eg Oleg Ruby 6 04-24-2010 06:33 PM
raise or not to raise [Newbie] Jacol Python 5 02-05-2007 11:46 PM



Advertisments