6. eksempel på kode

NRGConsumerSearch consumerSearch = new NRGConsumerSearch();

//set the headers
CustomerCode customercode = new CustomerCode();
customercode.Text = newstring[1];
customercode.Text.SetValue("XXXX", 0);
consumerSearch.customerCode = customercode;

CustomerCodeOwner customercodeowner = new CustomerCodeOwner();
customercodeowner.Text = newstring[1];
customercodeowner.Text.SetValue("XXXX",0);
consumerSearch.customerCodeOwner = customercodeowner;

UserId userid = new UserId();
userid.Text = newstring[1];
userid.Text.SetValue("XXXX", 0);
consumerSearch.userId = userid;

UserPassword password = new UserPassword();
password.Text = newstring[1];
password.Text.SetValue("XXXX",0);
consumerSearch.userPassword = password;

Language lang = new Language();
lang.Text = newstring[1];
lang.Text.SetValue("se",0);
consumerSearch.language = lang;

ToCountry toc = new ToCountry();
toc.Text = newstring[1];
toc.Text.SetValue("se",0);
consumerSearch.toCountry = toc;

FromCountry frc = new FromCountry();
frc.Text = newstring[1];
frc.Text.SetValue("se",0);
consumerSearch.fromCountry = frc;

// create the request object and set the search criteria
NRGConsumerSearchRequest request = new NRGConsumerSearchRequest();
request.criteria = new Criteria();
request.criteria.firstName = "Pelle";
request.criteria.lastName = "Svensson";

// make the request
NRGConsumerSearchResponse response = consumerSearch.service(request);
// do something with the response
for ( int i = 0; i< response.consumer.Length; i++)
System.Console.Out.WriteLine( response.consumer[i].consumerName );