public void LookupDobCarriersByCarrierId(string carrierId, int indent = 0) { var operation = new LookupDobCarriersOperation { carrierId = carrierId }; var request = new LookupDobCarriersRequest { lookupDobCarriersOperations = operation }; LookupDobCarriers(request, MethodBase.GetCurrentMethod().Name, indent); }
private void LookupDobCarriers(LookupDobCarriersRequest lookupDobCarriersRequest, string description, int indent) { /* pass a local variable as a "ref" parameter, rather than passing the field itself, so * the service can't modify what the field refers to */ CorrelationHeader correlationHeader = _correlationHeader; SessionHeader sessionHeader = _sessionHeader; WarningHeader warningHeader; LookupDobCarriersResponse lookupDobCarriersResponse; _client.LookupDobCarriers(_applicationHeader, ref correlationHeader, ref sessionHeader, lookupDobCarriersRequest, out warningHeader, out lookupDobCarriersResponse); if (indent == 0) { Console.WriteLine(description + ":"); } if (lookupDobCarriersResponse != null) { LookupDobCarriersResult result = lookupDobCarriersResponse.lookupDobCarriersResults; var data = result.Item as LookupDobCarriersSuccessData; if (data == null) { var serviceError = result.Item as ServiceError; serviceError.Display(); } else { data.Display(indent); } } }