Hello,
I've created proxy scenario using cxf-bc and cxf-se components using
CXF-BC (1) --- CXF-SE bean (2) with injected provider --- CXF-BC (3) to external
endpoint (as described in all tutorials)
The problem:
After receiving fault from external endpoint (3) with a parameter
('errorDesc') included which describes bussiness cause of the fault, that
parameter
is empty/null after catching exception in my proxy bean.
In logs I could find that the falut is wrapped properly in JBIFalut
object after receiving soap fault from external endpoint: errorDesc
parameter is set with proper message.
fault: <?xml version="1.0" encoding="UTF-8"?><JBIFault
xmlns="http://cxf.apache.org/bindings/jbi"><ns2:BusyServiceFault
xmlns:ns2="http://busy-service.pl/busy/ws"><errorDesc>Defined busy
period should be independent of other date
regions.</errorDesc></ns2:BusyServiceFault></JBIFault>
But not in catched exception below. My bean with proxied busyService provider:
public class BusyServiceESBImpl implements BusyService {
private BusyService busyService; // injected proxied provider
// exposed by CXF-BC (1)
public Integer addBusyPeriod(String number) throws BusyServiceFault_Exception
{
try {
return getBusyService().addBusyPeriod(number);
// external endpoint returns business exception defined in WSDL
} catch (BusyServiceFault_Exception e) {
System.out.println(e.getFaultInfo().getErrorDesc());
// is NULL!!!!!!!!! errorDesc inside BusyServiceFault object is
lost
System.out.println(e.getMessage()); // returns faultstring
}
}
I would be very grateful for any help, I've spent a lot of time on
searching any solution.
Details:
CXF-BC xbean.xml
<cxfbc:consumer wsdl="classpath:BusyService.wsdl"
targetService="busy-service:BusyService"
targetInterface="busy-service:BusyService"/>
<cxfbc:provider wsdl="classpath:BusyService.wsdl"
locationURI="http://10.11.10.10:8080/BusyServiceWSImpl?wsdl"
service="busy-service:BusyServiceProxy"
endpoint="BusyServiceProxyPort"
interfaceName="busy-service:BusyService" />
CXF-SE xbean.xml
<cxfse:endpoint>
<cxfse:pojo>
<bean class="busy.esb.BusyServiceESBImpl">
<property name="busyService">
<cxfse:proxy service="busy:BusyServiceProxy" context="#context"
type="busy.ws.BusyService" />
</property>
</bean>
</cxfse:pojo>
</cxfse:endpoint>
Best regards
Sebastian Kuligowski