[ 
https://issues.apache.org/jira/browse/GERONIMO-3462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526206
 ] 

Jarek Gawor commented on GERONIMO-3462:
---------------------------------------

Here's what I see:

1) SOAP fault string is set and propagated correctly. SOAP fault code is not. 
Looks like a bug in CXF somewhere... will investigate more
2) The on-the-wire message looks ok to me (except the soap fault code is 
incorrect) for a WS client.
3) Looks like your client is an ejb client. In an ejb client you get a 
RemoteException that contains the SOAPFaultException as a root cause. So in an 
ejb client you might need to do RemoteException.getCause() to get the expected 
SOAPFaultException.



> Problem with throwing SOAPFaultException within WebService based on 
> SessionBean 
> --------------------------------------------------------------------------------
>
>                 Key: GERONIMO-3462
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-3462
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: webservices
>    Affects Versions: 2.0.1
>         Environment: ApacheCXF as service provider
>            Reporter: Tomasz Mazan
>            Assignee: Jarek Gawor
>
> I create SOAPFaultException using code below:
> {noformat}
>       public SOAPFaultException createFault(String errorCode, String 
> errorString) {
>               SOAPFault fault = null;
>               try {
>                       fault = SOAPFactory.newInstance().createFault();
>                       fault.setFaultCode(new QName("foo", "bar", "abc"));
>                       fault.setFaultString(errorString);
>                       fault.setFaultActor("ACTOR");
>               } catch (SOAPException ex) {
>                       return new SOAPFaultException(null);
>               }
>               return new SOAPFaultException(fault);
>       }
> {noformat}
> and my WebMethod returns this exception in case internal exception:
> {noformat}
> @WebService(serviceName = "MyService", portName = "CustomerServices")
> @Stateless(name = "MyCustomerService")
> public class MyCustomerService {
>       
>       @EJB
>       private CoreManager coreManager = null;
>       public MyCustomerService() {
>       }
>       @WebMethod(operationName = "createCustomer")
>       public Customer createCustomer(@WebParam(name = "identifier") String 
> identifier) throws SOAPFaultException {
>               try {
>                       return this.coreManager.createCustomer(identifier);
>               } catch (ServiceException e) {
>                       throw this.faultService.createFault("FAULT CODE", 
> "FAULT STRING");
>               }
>               
>       }
> }
> {noformat}
> and client catches fault with attributes:
> {noformat}
>   ["faultstring"]=> string(298) "java.rmi.RemoteException: The bean 
> encountered a non-application exception.; nested exception is: 
> javax.xml.ws.soap.SOAPFaultException: FAULT STRING: The bean encountered a 
> non-application exception.; nested exception i
> s: javax.xml.ws.soap.SOAPFaultException: FAULT STRING"
>   ["faultcode"]=> string(11) "soap:Server"
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to