/**
* @author Matt Kaufman
* @name StubDemonstration
* @description Demonstration of using a stub created by Wsdl-to-Apex
**/
public class StubDemonstration {

	/**
	*	@name demonstrateStubUsage
	*	@description Demonstrates using the an Apex Class generated by a WSDL
	**/
	public static void demonstrateStubUsage(){
		PartnerAPI.Soap stub = new PartnerAPI.Soap();
		stub.SessionHeader = new PartnerAPI.SessionHeader_element();
		stub.Sessionheader.sessionId = UserInfo.getSessionId();

		//Perform a query
		PartnerAPI.QueryResult queryResult = stub.query('SELECT Id FROM Payment__c LIMIT 1');
		system.debug( '/**** Size of the results ****/' );
		system.debug( queryResult.size );

		system.debug( '/**** List of the results ****/' );
		system.debug( JSON.serializePretty(queryResult.records) );
		for ( PartnerAPI.sObject_x r : queryResult.records ){

		}
	}

}