Skip to content

Commit

Permalink
Client Connector - Get Data - Add call to existing webservice
Browse files Browse the repository at this point in the history
Add
public Get_MaxScanCountToReturn_Response
call_Get_MaxScanCountToReturn_Webservice(
Get_MaxScanCountToReturn_Request webserviceRequest )

The webservice already exists.
  • Loading branch information
danjasuw committed Jun 28, 2023
1 parent 0585bcb commit 50c8b84
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

import org.yeastrc.spectral_storage.get_data_webapp.shared_server_client.constants.WebserviceSpectralStorageGetDataPathConstants;
import org.yeastrc.spectral_storage.get_data_webapp.shared_server_client.exceptions.YRCSpectralStorageGetDataWebserviceCallErrorException;
import org.yeastrc.spectral_storage.get_data_webapp.shared_server_client.webservice_request_response.main.Get_MaxScanCountToReturn_Request;
import org.yeastrc.spectral_storage.get_data_webapp.shared_server_client.webservice_request_response.main.Get_MaxScanCountToReturn_Response;
import org.yeastrc.spectral_storage.get_data_webapp.shared_server_client.webservice_request_response.main.Get_ScanDataFromScanNumbers_Request;
import org.yeastrc.spectral_storage.get_data_webapp.shared_server_client.webservice_request_response.main.Get_ScanDataFromScanNumbers_Response;
import org.yeastrc.spectral_storage.get_data_webapp.shared_server_client.webservice_request_response.main.Get_ScanData_AllScans_ExcludePeaks_Request;
Expand Down Expand Up @@ -78,6 +80,8 @@ public synchronized void init( CallSpectralStorageGetDataWebserviceInitParameter

jaxbContext =
JAXBContext.newInstance(
Get_MaxScanCountToReturn_Request.class,
Get_MaxScanCountToReturn_Response.class,
Get_ScanNumbers_Request.class,
Get_ScanNumbers_Response.class,
Get_ScanData_AllScans_ExcludePeaks_Request.class,
Expand All @@ -102,6 +106,43 @@ public synchronized void init( CallSpectralStorageGetDataWebserviceInitParameter
/////////////////////////////



/**
* @param webserviceRequest
* @return
* @throws Exception
*/
public Get_MaxScanCountToReturn_Response call_Get_MaxScanCountToReturn_Webservice( Get_MaxScanCountToReturn_Request webserviceRequest ) throws Exception {
if ( ! instanceInitialized ) {
throw new IllegalStateException( "Not initialized" );
}
if ( webserviceRequest == null ) {
throw new IllegalArgumentException( "webserviceRequest param must not be null in call to call_Get_ScanNumbers_Request_Webservice(...)" );
}

String webserviceURL = spectralStorageServerBaseURL
+ WebserviceSpectralStorageGetDataPathConstants.GET_MAX_SCAN_COUNT_TO_RETURN_SERVLET_XML;
Object webserviceResponseAsObject = callActualWebserviceOnServerSendObject( webserviceRequest, webserviceURL );
if ( ! ( webserviceResponseAsObject instanceof Get_MaxScanCountToReturn_Response ) ) {
String msg = "Response unmarshaled to class other than Get_MaxScanCountToReturn_Response. "
+ " Unmarshaled Class: " + webserviceResponseAsObject.getClass();
YRCSpectralStorageGetDataWebserviceCallErrorException exception = new YRCSpectralStorageGetDataWebserviceCallErrorException( msg );
exception.setFailToDecodeDataReceivedFromServer(true);
throw exception;
}
Get_MaxScanCountToReturn_Response webserviceResponse = null;
try {
webserviceResponse = (Get_MaxScanCountToReturn_Response) webserviceResponseAsObject;
} catch ( Exception e ) {
String msg = "Error. Fail to cast response as Get_MaxScanCountToReturn_Response: "
+ e.toString();
YRCSpectralStorageGetDataWebserviceCallErrorException exception = new YRCSpectralStorageGetDataWebserviceCallErrorException( msg );
exception.setFailToDecodeDataReceivedFromServer(true);
throw exception;
}
return webserviceResponse;
}

/**
* @param webserviceRequest
* @return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ public class WebserviceSpectralStorageGetDataPathConstants {

// Servlets - Retrieving data from scan files using API Key and other parameters

public static final String GET_MAX_SCAN_COUNT_TO_RETURN_SERVLET_XML = "/query/getMaxScanCountToReturn_XML";

public static final String GET_SCAN_DATA_ALL_SCANS_EXCLUDE_PEAKS_SERVLET_XML = "/query/getScanData_AllScans_ExcludePeaks_Servlet_XML";

public static final String GET_SCAN_DATA_FROM_SCAN_NUMBERS_SERVLET_XML = "/query/getScanDataFromScanNumbers_XML";
Expand Down

0 comments on commit 50c8b84

Please sign in to comment.