HOla que tal.
quisiera probar un codigo hecho en java sobre una cosulta para el AWS de amazon, para probarlo en delphi.
ahora como no se mucho de java, eh estado tratando de hayas las comparativas al codigo.
el codigo java es:
[java]
public class
ItemSearchSample {
/**
* Main - API demo
* @param args
*/
public static void main ( String [] args ) {
- try {
- AWSECommerceService locator = new AWSECommerceServiceLocator();
AWSECommerceServicePortType service = locator.getAWSECommerceServicePort();
ItemSearch itemSearch = new ItemSearch();
ItemSearchRequest request = new ItemSearchRequest();
itemSearch.setSubscriptionId ( "0525E2PQ81DD7ZTWTK82" );
request.setSearchIndex ( "Books" );
request.setTitle ( "IBM+and+the+Holocaust" );
// Setup request
itemSearch.setRequest ( new ItemSearchRequest [] { request } );
// Get the response
ItemSearchResponse response = service.itemSearch ( itemSearch );
if ( response == null )- throw new Exception ( "Server Error - no response recieved!" );
Items [] itemsArray = response.getItems();
// Check for errors, stop at first error
if ( itemsArray == null )- throw new Exception ( "Server Error - empty response!" );
if ( itemsArray[0].getRequest().getErrors() != null )- throw new Exception ( itemsArray [0].getRequest().getErrors().getError()[0].getMessage() );
} catch ( Exception ex ) {- System.out.println( ex.toString() );
}
} }
[/java]
ahora lo que llevo en delphi es esto:
Código Delphi
[-]
var
service:AWSECommerceServicePorttype;
request:ItemSearchRequest;
search:itemsearch;
response:ItemSearchResponse;
begin
service:=(httprio1 as AWSECommerceServicePorttype);
search:=itemsearch.Create;
request:=ItemSearchRequest.Create;
search.SubscriptionId:='0525E2PQ81DD7ZTWTK82';
request.SearchIndex:='Book';
request.Title:='Ibm and the holocaust';
Search.Request:=request;
alguien sabe como pasar la ultimas lineas?
saludos
gracias.