/** * The process message is responsible for processing an incoming serviceTask and generate * a response based on the incoming serviceTask input * @param serviceTask The serviceTask that will be processed by the service * @return A result based on the processed incoming serviceTask * @see ServiceTask * @see ServiceResult */ @Override public ServiceResult<UpdateSoapPortsForwardedEndpointOutput> process(final ServiceTask<UpdateSoapPortsForwardedEndpointInput> serviceTask) { final UpdateSoapPortsForwardedEndpointInput input = serviceTask.getInput(); input.getPorts().stream() .map(soapPort -> this.operationRepository.findWithPortId(soapPort.getId())) .flatMap(List::stream) .forEach(operation -> { operation.setForwardedEndpoint(input.getForwardedEndpoint()); this.operationRepository.update(operation.getId(), operation); }); return createServiceResult(UpdateSoapPortsForwardedEndpointOutput.builder().build()); } }
/** * The process message is responsible for processing an incoming serviceTask and generate * a response based on the incoming serviceTask input * @param serviceTask The serviceTask that will be processed by the service * @return A result based on the processed incoming serviceTask * @see ServiceTask * @see ServiceResult */ @Override public ServiceResult<UpdateSoapOperationsForwardedEndpointOutput> process(final ServiceTask<UpdateSoapOperationsForwardedEndpointInput> serviceTask) { final UpdateSoapOperationsForwardedEndpointInput input = serviceTask.getInput(); input.getOperations().stream() .map(soapOperation -> this.operationRepository.findOne(soapOperation.getId())) .findFirst() .map(soapOperation -> { soapOperation.setForwardedEndpoint(input.getForwardedEndpoint()); return this.operationRepository.update(soapOperation.getId(), soapOperation); }); return createServiceResult(UpdateSoapOperationsForwardedEndpointOutput.builder().build()); } }
soapOperation.setStatus(SoapOperationStatus.MOCKED); soapOperation.setResponseStrategy(SoapResponseStrategy.RANDOM); soapOperation.setForwardedEndpoint(address.getLocation()); soapOperation.setOriginalEndpoint(address.getLocation()); soapOperation.setSoapVersion(address.getVersion());
public static SoapOperation generateSoapOperation(){ final SoapOperation soapOperation = new SoapOperation(); soapOperation.setId("SOAP OPERATION"); soapOperation.setName("Soap operation name"); soapOperation.setCurrentResponseSequenceIndex(1); soapOperation.setDefaultBody("Default body"); soapOperation.setForwardedEndpoint("Forwarded event"); soapOperation.setInvokeAddress("Invoke address"); soapOperation.setOriginalEndpoint("Original endpoint"); soapOperation.setHttpMethod(HttpMethod.POST); soapOperation.setStatus(SoapOperationStatus.MOCKED); soapOperation.setSoapVersion(SoapVersion.SOAP11); soapOperation.setIdentifyStrategy(SoapOperationIdentifyStrategy.ELEMENT_NAMESPACE); soapOperation.setMockResponses(new ArrayList<SoapMockResponse>()); return soapOperation; } }
soapOperation.setForwardedEndpoint(FORWARD_ENDPOINT); soapOperation.setHttpMethod(HttpMethod.GET); soapOperation.setId(SOAP_OPERATION_ID);
/** * The process message is responsible for processing an incoming serviceTask and generate * a response based on the incoming serviceTask input * @param serviceTask The serviceTask that will be processed by the service * @return A result based on the processed incoming serviceTask * @see ServiceTask * @see ServiceResult */ @Override public ServiceResult<UpdateSoapOperationOutput> process(final ServiceTask<UpdateSoapOperationInput> serviceTask) { final UpdateSoapOperationInput input = serviceTask.getInput(); final SoapOperation updated = input.getOperation(); final SoapOperation soapOperation = this.operationRepository.findOne(input.getOperationId()); soapOperation.setStatus(updated.getStatus()); soapOperation.setForwardedEndpoint(updated.getForwardedEndpoint()); soapOperation.setResponseStrategy(updated.getResponseStrategy()); soapOperation.setSimulateNetworkDelay(updated.getSimulateNetworkDelay()); soapOperation.setNetworkDelay(updated.getNetworkDelay()); soapOperation.setDefaultMockResponseId(updated.getDefaultMockResponseId()); soapOperation.setMockOnFailure(updated.getMockOnFailure()); soapOperation.setIdentifyStrategy(updated.getIdentifyStrategy()); final SoapOperation updatedSoapOperation = this.operationRepository.update(input.getOperationId(), soapOperation); return createServiceResult(UpdateSoapOperationOutput.builder() .operation(updatedSoapOperation) .build()); } }
operation.setDefaultBody(operationV1.getDefaultBody()); operation.setCurrentResponseSequenceIndex(operationV1.getCurrentResponseSequenceIndex()); operation.setForwardedEndpoint(operationV1.getForwardedEndpoint()); operation.setOriginalEndpoint(operationV1.getOriginalEndpoint()); operation.setDefaultXPathMockResponseId(operationV1.getDefaultXPathMockResponseId());