You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by priya j <ja...@gmail.com> on 2007/12/18 04:23:41 UTC

Queries in handling the exeception for Http binding for RESTful Service

Hi all,
I am using the cxf - HTTP Binding for RESTful service to build a web Service
application.
i have two question in handling the exception :

1) I get the error xml as

<ns1:XMLFault xmlns:ns1="http://cxf.apache.org/bindings/xformat">
	<ns1:faultstring xmlns:ns1="http://cxf.apache.org/bindings/xformat">
		sg.sphsearch.sfe.webService.server.ErrorFault: dtgdtgd
	</ns1:faultstring>
	<ns1:detail xmlns:ns1="http://cxf.apache.org/bindings/xformat">
		<ErrorDetails xmlns="http://sfe.sphsearch.sg">
			<message>Invalid request parameter query.</message>			
		</ErrorDetails>
	</ns1:detail>
</ns1:XMLFault>

is that any way i can remove the ns1 and faultstring from my output. So that
the following output is

<ErrorDetails xmlns="http://sfe.sphsearch.sg">
		<message>Invalid request parameter query.</message>			
</ErrorDetails>	

2) Is that any way to handle all the HTTP status code exception, if so can
anyone send me a sample of it.

Please do help me in doing this.
Thanks inadvance.

Priya
-- 
View this message in context: http://www.nabble.com/Queries-in-handling-the-exeception-for-Http-binding-for-RESTful-Service-tp14375877p14375877.html
Sent from the cxf-user mailing list archive at Nabble.com.


RE: Queries in handling the exeception for Http binding for RESTful Service

Posted by "Liu, Jervis" <jl...@iona.com>.

> -----Original Message-----
> From: priya j [mailto:jagapriya.s@gmail.com]
> Sent: 2007年12月18日 11:24
> To: cxf-user@incubator.apache.org
> Subject: Queries in handling the exeception for Http binding for RESTful
> Service
> 
> 
> Hi all,
> I am using the cxf - HTTP Binding for RESTful service to build a web Service
> application.
> i have two question in handling the exception :
> 
> 1) I get the error xml as
> 
> <ns1:XMLFault xmlns:ns1="http://cxf.apache.org/bindings/xformat">
> 	<ns1:faultstring xmlns:ns1="http://cxf.apache.org/bindings/xformat">
> 		sg.sphsearch.sfe.webService.server.ErrorFault: dtgdtgd
> 	</ns1:faultstring>
> 	<ns1:detail xmlns:ns1="http://cxf.apache.org/bindings/xformat">
> 		<ErrorDetails xmlns="http://sfe.sphsearch.sg">
> 			<message>Invalid request parameter query.</message>
> 
> 		</ErrorDetails>
> 	</ns1:detail>
> </ns1:XMLFault>
> 
> is that any way i can remove the ns1 and faultstring from my output. So that
> the following output is
> 
> <ErrorDetails xmlns="http://sfe.sphsearch.sg">
> 		<message>Invalid request parameter query.</message>
> </ErrorDetails>
> 
[Liu, Jervis] You got the output above probably because you throw RuntimeException or Exception from your implementation that is not declared on your method. What you can do is defining your own Exception types such as CustomerNotFoundException, so that your implementation only throws checked exceptions. 

> 2) Is that any way to handle all the HTTP status code exception, if so can
> anyone send me a sample of it.
> 
> Please do help me in doing this.
> Thanks inadvance.
> 
> Priya
> --
> View this message in context:
> http://www.nabble.com/Queries-in-handling-the-exeception-for-Http-bindin
> g-for-RESTful-Service-tp14375877p14375877.html
> Sent from the cxf-user mailing list archive at Nabble.com.

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland