[jira] Commented: (GERONIMO-3462) Problem with throwing SOAPFaultException within WebService based on SessionBean
[ https://issues.apache.org/jira/browse/GERONIMO-3462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12533747 ] Jarek Gawor commented on GERONIMO-3462: --- Is this still an issue or can this bug be resolved? 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.
[jira] Commented: (GERONIMO-3462) Problem with throwing SOAPFaultException within WebService based on SessionBean
[ https://issues.apache.org/jira/browse/GERONIMO-3462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12533777 ] Tomasz Mazan commented on GERONIMO-3462: Sorry Jarek, but I haven't testet it yet. I will do it in a few days - I'm overworked. 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.
[jira] Commented: (GERONIMO-3462) Problem with throwing SOAPFaultException within WebService based on SessionBean
[ https://issues.apache.org/jira/browse/GERONIMO-3462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526566 ] Jarek Gawor commented on GERONIMO-3462: --- Tomek, I'm still unable to reproduce your result. I created a test case in Geronimo for this issue. Can you maybe test your php client against the test service in Geronimo? To get/build the test service: 1) check out Geronimo from trunk and build it 2) start Geronimo (either your version or the one you just built) 3) cd testsuite/webservices-testsuite/jaxws-tests/jaxws-ejb and run mvn -P child. The last step will build the test service, deploy it, run some tests (they all should pass), and undeploy it. Once that is done, you can deploy by hand the generated .jar file in the target directory. Then update your php script to talk to this service and see how the fault looks like. 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.
[jira] Commented: (GERONIMO-3462) Problem with throwing SOAPFaultException within WebService based on SessionBean
[ https://issues.apache.org/jira/browse/GERONIMO-3462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526626 ] Tomasz Mazan commented on GERONIMO-3462: Jarek Thanks for your instruction. I'll try to implement your advices and reply with test's result. 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.
[jira] Commented: (GERONIMO-3462) Problem with throwing SOAPFaultException within WebService based on SessionBean
[ 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.
[jira] Commented: (GERONIMO-3462) Problem with throwing SOAPFaultException within WebService based on SessionBean
[ https://issues.apache.org/jira/browse/GERONIMO-3462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526231 ] Jarek Gawor commented on GERONIMO-3462: --- Btw, I also noticed that Axis2 EJB-based WS was returning a completely invalid fault message in this case. This should be fixed now in trunk (revision 574341) and branches/2.0 (revision 574343). Even with that fix, Axis2 is also not returning the specified fault code but it is passing the right fault string and actor. 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.
[jira] Commented: (GERONIMO-3462) Problem with throwing SOAPFaultException within WebService based on SessionBean
[ https://issues.apache.org/jira/browse/GERONIMO-3462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526265 ] Tomasz Mazan commented on GERONIMO-3462: Jarek 1) According to jax-ws spec (JSR-000224) point 10.2.2.3 faultcode is correct. Faultstring is wrapped in exception classname etc. - opposite to my expectations. 3) My client is a php script so I'm wondering why there's java.rmi.RemoteException Thanks 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.
[jira] Commented: (GERONIMO-3462) Problem with throwing SOAPFaultException within WebService based on SessionBean
[ https://issues.apache.org/jira/browse/GERONIMO-3462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526267 ] Jarek Gawor commented on GERONIMO-3462: --- What does php script call? 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.
[jira] Commented: (GERONIMO-3462) Problem with throwing SOAPFaultException within WebService based on SessionBean
[ https://issues.apache.org/jira/browse/GERONIMO-3462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526288 ] Tomasz Mazan commented on GERONIMO-3462: PHP script calls my function part of wsdl: {noformat} wsdl:operation name=createCustomer wsdl:input message=ns1:createCustomer name=createCustomer /wsdl:input wsdl:output message=ns1:createCustomerResponse name=createCustomerResponse /wsdl:output wsdl:fault message=ns1:SOAPFaultException name=SOAPFaultException /wsdl:fault /wsdl:operation xs:complexType name=SOAPFaultException xs:sequence xs:element name=faultcode nillable=true type=xs:QName/ xs:element name=faultstring nillable=true type=xs:string/ xs:element name=faultactor nillable=true type=xs:string/ xs:element name=message nillable=true type=xs:string/ /xs:sequence /xs:complexType {noformat} and php code looks like {noformat} $soapClient = new SoapClient(http://localhost:8080/MyApp/MyService?wsdl;, array(exceptions = true)); $temp = $soapClient - createCustomer(array(identifier = $argv[1]))-return; {noformat} 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.