I have an existing WSDL using which we have to create the SOAP webservices. We are able to get response but to handle errors thrown from cxf client we have nothing in place yet. So far :
ApplicationConfiguration
@Bean
public EndpointImpl endpoint(Bus bus, IGetDocumentImpl iGetDocument) {
EndpointImpl endpoint = new EndpointImpl(bus, iGetDocument);
endpoint.publish(GET_BINARY_DOCUMENT_ENDPOINT);
SOAPBinding soapBinding = (SOAPBinding) endpoint.getBinding();
soapBinding.setMTOMEnabled(true);
return endpoint;
}
XML Request
IGetDocumentsService
@Service
@Slf4j
public class IGetDocumentsService implements IGetDocuments {
@Override
public GetDocumentsDataResponse getDocumentsData(InputXml parameters) {
}
The XML tags missing in input or unmarshalling exception needs to be handled to throw a custom fault. I saw we can use aspect and @ControllerAdvice but I could not find any suitable solution.