You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Tomasz Mazan <wi...@wp.pl> on 2007/09/06 14:50:48 UTC
Apache CXF web service and re/turning Fault
I configured Geronimo to use CXF as WS engine. If I return any object by
WebMethod - all look fine.
The problem is with returning Fault - I throw exception annotated with
@WebFault and want Fault to contain specified "faultcode" and "faultstring".
What should I do ?
No, It looks like (for php WS-client)
["faultstring"]=>
string(61) "pl.netia.fonbsa.core.services.jws.exception.WSException: null"
["faultcode"]=>
string(11) "soap:Server"
Any idea?
Beniamin
--
View this message in context: http://www.nabble.com/Apache-CXF-web-service-and-re-turning-Fault-tf4391944s134.html#a12521929
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: Apache CXF web service and returning Fault
Posted by Tomasz Mazan <wi...@wp.pl>.
dkulp wrote:
>
> This is actually per JAX-WS spec. Section 10.2.2.3. For user faults,
> the faultstring is taken from "ex.getMessage()". The faultcode is always
> env:Server. The actor is always empty.
>
> With CXF, you CAN create your own
> org.apache.cxf.binding.soap.SoapFault
> exception and fill in everthing yourself. According to spec, you should
> be able to do the same thing with a javax.xml.ws.SOAPFaultException, but
> that isn't working in CXF right now. I fixed that on CXF's trunk earlier
> this week so hopefully the next patch release of Geronimo will include it.
> (or possibly someone will write instructions on how to "update" the CXF in
> Geronimo with newer versions)
>
> Dan
>
>
>
> Tomasz Mazan wrote:
>>
>> I configured Geronimo to use CXF as WS engine. If I return any object by
>> WebMethod - all look fine.
>> The problem is with returning Fault - I throw exception annotated with
>> @WebFault and want Fault to contain specified "faultcode" and
>> "faultstring". What should I do ?
>>
>> No, It looks like (for php WS-client)
>>
>> ["faultstring"]=>
>> string(61) "pl.netia.fonbsa.core.services.jws.exception.WSException:
>> null"
>> ["faultcode"]=>
>> string(11) "soap:Server"
>>
>> Any idea?
>>
>> Beniamin
>>
>
>
Ok, thanks for those information. But my fault string contains
"mypackage.WSException: CUSTOMER_ALREADY_EXISTS: CUSTOMER_ALREADY_EXISTS". I
want Fault to contain only "CUSTOMER_ALREADY_EXISTS". It's possibly?
Beniamin
--
View this message in context: http://www.nabble.com/Apache-CXF-web-service-and-returning-Fault-tf4391944s134.html#a12523616
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: Apache CXF web service and returning Fault
Posted by Daniel Kulp <dk...@apache.org>.
This is actually per JAX-WS spec. Section 10.2.2.3. For user faults, the
faultstring is taken from "ex.getMessage()". The faultcode is always
env:Server. The actor is always empty.
With CXF, you CAN create your own
org.apache.cxf.binding.soap.SoapFault
exception and fill in everthing yourself. According to spec, you should
be able to do the same thing with a javax.xml.ws.SOAPFaultException, but
that isn't working in CXF right now. I fixed that on CXF's trunk earlier
this week so hopefully the next patch release of Geronimo will include it.
(or possibly someone will write instructions on how to "update" the CXF in
Geronimo with newer versions)
Dan
Tomasz Mazan wrote:
>
> I configured Geronimo to use CXF as WS engine. If I return any object by
> WebMethod - all look fine.
> The problem is with returning Fault - I throw exception annotated with
> @WebFault and want Fault to contain specified "faultcode" and
> "faultstring". What should I do ?
>
> No, It looks like (for php WS-client)
>
> ["faultstring"]=>
> string(61) "pl.netia.fonbsa.core.services.jws.exception.WSException: null"
> ["faultcode"]=>
> string(11) "soap:Server"
>
> Any idea?
>
> Beniamin
>
--
View this message in context: http://www.nabble.com/Apache-CXF-web-service-and-returning-Fault-tf4391944s134.html#a12522857
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.