JAXBElement<Response> response = (JAXBElement<Response>) webserviceTemplate.marshalSendAndReceive( request, new SoapActionCallback("PutOrganisationUnitRequest") );
@Override public void resolveFault(WebServiceMessage message) throws IOException { // The upper class automatically resolve a SoapFaultClientException try { super.resolveFault(message); } catch(SoapFaultClientException sfce) { // This call will throw specific known exceptions resolvesSpecificException(sfce); // If no specific exception management is done, the SoapFaultClientException is thrown throw sfce; } }
new SoapActionCallback(soapAction).doWithMessage(message);
new SoapFaultMessageResolver().resolveFault(webServiceResponse); } else { new SimpleFaultMessageResolver().resolveFault(webServiceResponse);
SoapActionCallback soapActionCallback = new SoapActionCallback("restituisciStatiMessaggioListRequestSA"); RestituisciStatiMessaggioListResponse response = (RestituisciStatiMessaggioListResponse) getWebServiceTemplate().marshalSendAndReceive(request,soapActionCallback);
@Override public void resolveFault(WebServiceMessage message) throws IOException { // The upper class automatically resolve a SoapFaultClientException try { super.resolveFault(message); } catch(SoapFaultClientException sfce) { // This call will throw specific known exceptions resolvesSpecificException(sfce); // If no specific exception management is done, the SoapFaultClientException is thrown throw sfce; } }
final EightBallResponse response = new EightBallResponse(); final SoapActionCallback soapActionCallback = new SoapActionCallback("<the operation name as defined in the WSDL>"); response = (EightBallResponse) getWebServiceTemplate() .marshalSendAndReceive(request, soapActionCallback ); responseString = response.getAnswer().toString();
Map<String, Object> params = new HashMap<String, Object>(5); params.put("callId", "myCallId"); params.put("timeStamp", "thetimeStamp"); params.put("doc", "theDoc"); params.put("docName", "theDocName"); params.put("docContent", "theDocContent"); String xmlRequest = VelocityEngineUtils.mergeTemplateIntoString(velocityEngine, "requestTemplate.vm", "UTF-8", params).replaceAll("[\n\r]", ""); StreamSource requestMessage = new StreamSource(new StringReader(xmlRequest)); wsTemplate.sendSourceAndReceive("wsUrl", requestMessage,new new SoapActionCallback("verifySignature"),new CustomSourceExtractor());
WebServiceTemplate template = new WebServiceTemplate(messageFactory); Result result = new DOMResult(); template.sendSourceAndReceiveToResult( new StringSource("<content xmlns=\"http://tempuri.org\"/>"), new SoapActionCallback("http://tempuri.org/SOAPAction"), result);
public GetCustomerResponse getCustomerResponse(String username) { GetCustomerRequest request = new GetCustomerRequest(); request.setUsername(username); log.info("Requesting customer for " + username); return (GetCustomerResponse) getWebServiceTemplate() .marshalSendAndReceive( String.format("%s/v1/customers", this.getDefaultUri()), request, new SoapActionCallback(ROOT_NAMESPACE + GET_CUSTOMER_NAMESPACE)); }
@SuppressWarnings("unchecked") public List<BigInteger> listFlights() { ObjectFactory factory = new ObjectFactory(); TListFlights tListFlights = factory.createTListFlights(); JAXBElement<TListFlights> request = factory.createListFlightsRequest(tListFlights); // use SoapActionCallback to add the SOAPAction JAXBElement<TFlightsResponse> response = (JAXBElement<TFlightsResponse>) webServiceTemplate.marshalSendAndReceive(request, new SoapActionCallback("http://example.com/TicketAgent/listFlights")); return response.getValue().getFlightNumber(); } }
return (MyOperationResponse) getWebServiceTemplate().marshalSendAndReceive(request, new SoapActionCallback("urn:ProcessMyOperation"));
public UpdateCustomerResponse updateCustomerResponse(Profile profile) { UpdateCustomerRequest request = new UpdateCustomerRequest(); Customer customer = new Customer(); customer.setFirstName(profile.getFirstName()); customer.setLastName(profile.getLastName()); customer.setEmail(profile.getEmail()); customer.setUsername(profile.getUsername()); request.setCustomer(customer); log.info("Updating customer for " + customer.getUsername()); return (UpdateCustomerResponse) getWebServiceTemplate() .marshalSendAndReceive( String.format("%s/v1/customers", this.getDefaultUri()), request, new SoapActionCallback(ROOT_NAMESPACE + UPDATE_CUSTOMER_NAMESPACE)); } }