C#:
----------------
private void getCustomer()
{
// This operation requires a valid session
this.login( true );
// Prompt for the nsKey
_out.write( "\nnsKey for record to be retrieved: " );
String nsKey = _out.readLn();
// Invoke the get() operation to retrieve the record
RecordRef recordRef = new RecordRef();
recordRef.internalId = nsKey;
recordRef.type = RecordType.customer;
recordRef.typeSpecified = true;
ReadResponse response = _service.get( recordRef );
// Process response from get() operation
_out.info( "\nRecord returned from get() operation: " );
if ( !response.status.isSuccess )
{
_out.info(
"ERROR: " +
getStatusDetails( response.status ) );
}
else
{
Customer customer = (Customer) response.record;
_out.info(
"\nnsKey=" + customer.internalId + ", " +
"\nentityId=" + customer.entityId +
(customer.companyName==null ? "" : ("\ncompanyName=" + customer.companyName)) +
(customer.stage==null ? "" : ("\nstage=" + customer.stage)) +
(customer.email==null ? "" : ("\nemail=" + customer.email)) +
(customer.phone==null ? "" : ("\nphone=" + customer.phone)) +
"\nisInactive=" + customer.isInactive +
(!customer.dateCreatedSpecified ? "" : ("\ndateCreated=" +
customer.dateCreated.ToShortDateString())) );
}
}
0