[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

SOAP4R: raise error with custom fault code

Peter C. Verhage

1/15/2005 4:36:00 PM

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
2 Answers

NAKAMURA, Hiroshi

1/16/2005 3:53:00 AM

0

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/RELEASE_en.html#re...) 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/file/trunk/test/soap/fault/test_cust....

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... . 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...

Regards,
// NaHi

Peter C. Verhage

1/16/2005 10:47:00 PM

0

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