Posts

Showing posts with the label soap

Springboot SOAP service unmarshalling Issue with the response from WebServiceTemplate

Springboot SOAP service unmarshalling Issue with the response from WebServiceTemplate I am really bugged with an unmarshalling issue with the response from the SOAP service. I am using springboot application and WebServiceTemplate for calling an existing SOAP service. I am using below code to set up beans for marshalling and webservicetemplate. Any help is highly appreciated. On calling webServiceTemplate.marshalSendAndReceive(request); I am expecting TravelResponse object but it is giving me JAXBElement<TravelResponse> object as response. I need help to understand 1) why is it giving above response instead of TravelResponse 2) How to convert to TravelResponse webServiceTemplate.marshalSendAndReceive(request); TravelResponse object JAXBElement<TravelResponse> object TravelResponse TravelResponse Code snippet below: @Bean Jaxb2Marshaller jaxb2Marshaller() { Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller(); jaxb2Marshaller.setContextPath("com.cater.t...

Send XML file to webservice SOAP with Java class

Send XML file to webservice SOAP with Java class I need to send an XML file through a java class to a SOAP webservice. I'm getting the following error message: com.sun.xml.ws.fault.ServerSOAPFaultException: Client received SOAP Fault from server: Cannot find dispatch method for {}Contribuinte Please see the server log to find more detail regarding exact cause of the failure. Here's the XML I want to send <?xml version="1.0" encoding="ISO-8859-1"?> <Contribuinte xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='Contribuinte.xsd'> <Nome>CONTRIBUINTE TESTE INTEGRAÇÃO</Nome> <NomeFantasia>CONTRIBUINTE TESTE INTEGRAÇÃO</NomeFantasia> <TipoPessoa>J</TipoPessoa> <Documento>16619539000163</Documento> <InscricaoMunicipal>152165</InscricaoMunicipal> <Rg>2185188</Rg> <InscricaoEstadual>151616</...