Expected Result:
The actual error received:Code:<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode>SOAP-ENV:Client</faultcode> <faultstring xml:lang="en">Invalid Client Id.</faultstring> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Exception Message:Code:<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode>SOAP-ENV:Server</faultcode> <faultstring xml:lang="en">method 'public gov.dc.dmv.destiny.eis.services.ext.dcivs.domain.IvsResponse gov.dc.dmv.destiny.eis.services.ivs.service.impl.IvsServiceImpl.getInsuranceVerificationData(gov.dc.dmv.destiny.eis.services.ext.dcivs.domain.IvsRequest) throws gov.dc.dmv.destiny.eis.services.common.exception.InvalidDataException,gov.dc.dmv.destiny.eis.services.common.exception.InvalidRegionException,javax.xml.datatype.DatatypeConfigurationException,gov.dc.dmv.destiny.eis.services.common.exception.NoDataAvailableException' threw an Exception.</faultstring> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
I have Spring Integration MarshallingWebServiceInboundGateway as the Webservices inbound endpoint gateway. It then sends the request to Transformer and then to Service Activator. The service activator has an AOP interceptor and checks for a valid client id in the request message. If there is none, it throws "Invalid Client Id" normal Soap fault error with fault code as CLIENT. The channels configured are all direct channels since the invocation is synchronous.Code:org.springframework.integration.message.MessageHandlingException: method 'public gov.dc.dmv.destiny.eis.services.ext.dcivs.domain.IvsResponse gov.dc.dmv.destiny.eis.services.ivs.service.impl.IvsServiceImpl.getInsuranceVerificationData(gov.dc.dmv.destiny.eis.services.ext.dcivs.domain.IvsRequest) throws gov.dc.dmv.destiny.eis.services.common.exception.InvalidDataException,gov.dc.dmv.destiny.eis.services.common.exception.InvalidRegionException,javax.xml.datatype.DatatypeConfigurationException,gov.dc.dmv.destiny.eis.services.common.exception.NoDataAvailableException' threw an Exception. Caused by: gov.dc.dmv.destiny.eis.services.common.exception.InvalidDataException: Invalid Client Id at gov.dc.dmv.destiny.eis.services.common.aop.EisServiceClientIdValidator.before(EisServiceClientIdValidator.java:83)
Soap Fault Exception:
Any idea why I do not see the expected soap fault behavior. If I do not use MarshallingWebServiceInboundGateway and use simple gateway interface with the appropriate throws clause in the method signature, I see the expected behavior. MarshallingWebServiceInboundGateway is the ideal choice since it eliminates a simple Gateway interface, and two other classes. Any insight would be highly helpful.Code:package gov.dc.dmv.destiny.eis.services.common.exception; import org.springframework.ws.soap.server.endpoint.annotation.FaultCode; import org.springframework.ws.soap.server.endpoint.annotation.SoapFault; /** * InvalidDataException.java : Exception thrown when some of the required * data as per the conditional business logic is not present in the inbound * request message. * @author Vigil Bose */ @SoapFault(faultCode = FaultCode.CLIENT) public class InvalidDataException extends Exception { private static final long serialVersionUID = 1L; public InvalidDataException(String message){ super(message); } }
Thanks,
Vigil


Reply With Quote

