After modifying the WSDL file to remove all the tags, I successfully generated the Apex classes depending on the WSDL. However, now, as a beginner, I really do not know how to test if the classes are working. I know I can use execute anonymous in Eclipse to check if it is working. However, I do not know what to write in "source to execute". The major classes are as below:
public class servicesFastrComAuProduct {
public class RetrievePds_element {
public servicesFastrComAuProductData.PdsRequest request;
public String apiKey;
private String[] request_type_info = new String[]{'request','http://services.fastr.com.au/Product',null,'0','1','true'};
private String[] apiKey_type_info = new String[]{'apiKey','http://services.fastr.com.au/Product',null,'0','1','true'};
private String[] apex_schema_type_info = new String[]{'http://services.fastr.com.au/Product','true','false'};
private String[] field_order_type_info = new String[]{'request','apiKey'};
}
public class RetrievePdsResponse_element {
public servicesFastrComAuProductData.PdsResponse RetrievePdsResult;
private String[] RetrievePdsResult_type_info = new String[]{'RetrievePdsResult','http://services.fastr.com.au/Product',null,'0','1','true'};
private String[] apex_schema_type_info = new String[]{'http://services.fastr.com.au/Product','true','false'};
private String[] field_order_type_info = new String[]{'RetrievePdsResult'};
}
public class RetrieveAssignedProductsResponse_element {
public servicesFastrComAuProductData.RetrieveAssignedProductsResponse RetrieveAssignedProductsResult;
private String[] RetrieveAssignedProductsResult_type_info = new String[]{'RetrieveAssignedProductsResult','http://services.fastr.com.au/Product',null,'0','1','true'};
private String[] apex_schema_type_info = new String[]{'http://services.fastr.com.au/Product','true','false'};
private String[] field_order_type_info = new String[]{'RetrieveAssignedProductsResult'};
}
public class RetrieveAssignedProducts_element {
public String apiKey;
private String[] apiKey_type_info = new String[]{'apiKey','http://services.fastr.com.au/Product',null,'0','1','true'};
private String[] apex_schema_type_info = new String[]{'http://services.fastr.com.au/Product','true','false'};
private String[] field_order_type_info = new String[]{'apiKey'};
}
public class ProductService_Endpoint_basicHttpBinding {
public String endpoint_x = 'https://staging.avea.com.au:2001/ProductService.svc';
public Map<String,String> inputHttpHeaders_x;
public Map<String,String> outputHttpHeaders_x;
public String clientCertName_x;
public String clientCert_x;
public String clientCertPasswd_x;
public Integer timeout_x;
private String[] ns_map_type_info = new String[]{'http://services.fastr.com.au/Error', 'servicesFastrComAuError', 'http://services.fastr.com.au/Product/Data', 'servicesFastrComAuProductData', 'http://schemas.microsoft.com/2003/10/Serialization/', 'schemasMicrosoftCom200310Serializat', 'http://services.fastr.com.au/Product', 'servicesFastrComAuProduct', 'http://services.fastr.com.au/Product/Imports', 'servicesFastrComAuProductImports'};
public servicesFastrComAuProductData.PdsResponse RetrievePds(servicesFastrComAuProductData.PdsRequest request,String apiKey) {
servicesFastrComAuProduct.RetrievePds_element request_x = new servicesFastrComAuProduct.RetrievePds_element();
request_x.request = request;
request_x.apiKey = apiKey;
servicesFastrComAuProduct.RetrievePdsResponse_element response_x;
Map<String, servicesFastrComAuProduct.RetrievePdsResponse_element> response_map_x = new Map<String, servicesFastrComAuProduct.RetrievePdsResponse_element>();
response_map_x.put('response_x', response_x);
WebServiceCallout.invoke(
this,
request_x,
response_map_x,
new String[]{endpoint_x,
'http://services.fastr.com.au/Product/IProductService/RetrievePds',
'http://services.fastr.com.au/Product',
'RetrievePds',
'http://services.fastr.com.au/Product',
'RetrievePdsResponse',
'servicesFastrComAuProduct.RetrievePdsResponse_element'}
);
response_x = response_map_x.get('response_x');
return response_x.RetrievePdsResult;
}
public servicesFastrComAuProductData.RetrieveAssignedProductsResponse RetrieveAssignedProducts(String apiKey) {
servicesFastrComAuProduct.RetrieveAssignedProducts_element request_x = new servicesFastrComAuProduct.RetrieveAssignedProducts_element();
request_x.apiKey = apiKey;
servicesFastrComAuProduct.RetrieveAssignedProductsResponse_element response_x;
Map<String, servicesFastrComAuProduct.RetrieveAssignedProductsResponse_element> response_map_x = new Map<String, servicesFastrComAuProduct.RetrieveAssignedProductsResponse_element>();
response_map_x.put('response_x', response_x);
WebServiceCallout.invoke(
this,
request_x,
response_map_x,
new String[]{endpoint_x,
'http://services.fastr.com.au/Product/IProductService/RetrieveAssignedProducts',
'http://services.fastr.com.au/Product',
'RetrieveAssignedProducts',
'http://services.fastr.com.au/Product',
'RetrieveAssignedProductsResponse',
'servicesFastrComAuProduct.RetrieveAssignedProductsResponse_element'}
);
response_x = response_map_x.get('response_x');
return response_x.RetrieveAssignedProductsResult;
}
}
}
public class servicesFastrComAuProductData {
public class ArrayOfProduct {
public servicesFastrComAuProductData.Product[] Product;
private String[] Product_type_info = new String[]{'Product','http://services.fastr.com.au/Product/Data',null,'0','-1','true'};
private String[] apex_schema_type_info = new String[]{'http://services.fastr.com.au/Product/Data','true','false'};
private String[] field_order_type_info = new String[]{'Product'};
}
public class Cover {
public String Code;
public Integer CoverTerm;
public String Name;
private String[] Code_type_info = new String[]{'Code','http://services.fastr.com.au/Product/Data',null,'1','1','true'};
private String[] CoverTerm_type_info = new String[]{'CoverTerm','http://services.fastr.com.au/Product/Data',null,'0','1','true'};
private String[] Name_type_info = new String[]{'Name','http://services.fastr.com.au/Product/Data',null,'1','1','true'};
private String[] apex_schema_type_info = new String[]{'http://services.fastr.com.au/Product/Data','true','false'};
private String[] field_order_type_info = new String[]{'Code','CoverTerm','Name'};
}
public class ArrayOfCover {
public servicesFastrComAuProductData.Cover[] Cover;
private String[] Cover_type_info = new String[]{'Cover','http://services.fastr.com.au/Product/Data',null,'0','-1','true'};
private String[] apex_schema_type_info = new String[]{'http://services.fastr.com.au/Product/Data','true','false'};
private String[] field_order_type_info = new String[]{'Cover'};
}
public class PdsResponse {
public String DocumentUrl;
private String[] DocumentUrl_type_info = new String[]{'DocumentUrl','http://services.fastr.com.au/Product/Data',null,'0','1','true'};
private String[] apex_schema_type_info = new String[]{'http://services.fastr.com.au/Product/Data','true','false'};
private String[] field_order_type_info = new String[]{'DocumentUrl'};
}
public class Product {
public servicesFastrComAuProductData.ArrayOfCover CoverTypes;
public String Name;
private String[] CoverTypes_type_info = new String[]{'CoverTypes','http://services.fastr.com.au/Product/Data',null,'1','1','true'};
private String[] Name_type_info = new String[]{'Name','http://services.fastr.com.au/Product/Data',null,'1','1','true'};
private String[] apex_schema_type_info = new String[]{'http://services.fastr.com.au/Product/Data','true','false'};
private String[] field_order_type_info = new String[]{'CoverTypes','Name'};
}
public class RetrieveAssignedProductsResponse {
public servicesFastrComAuProductData.ArrayOfProduct Products;
private String[] Products_type_info = new String[]{'Products','http://services.fastr.com.au/Product/Data',null,'0','1','true'};
private String[] apex_schema_type_info = new String[]{'http://services.fastr.com.au/Product/Data','true','false'};
private String[] field_order_type_info = new String[]{'Products'};
}
public class PdsRequest {
public String CoverTypeCode;
private String[] CoverTypeCode_type_info = new String[]{'CoverTypeCode','http://services.fastr.com.au/Product/Data',null,'1','1','true'};
private String[] apex_schema_type_info = new String[]{'http://services.fastr.com.au/Product/Data','true','false'};
private String[] field_order_type_info = new String[]{'CoverTypeCode'};
}
}
public class servicesFastrComAuError {
public class FastrError {
public String Reason;
private String[] Reason_type_info = new String[]{'Reason','http://services.fastr.com.au/Error',null,'0','1','true'};
private String[] apex_schema_type_info = new String[]{'http://services.fastr.com.au/Error','true','false'};
private String[] field_order_type_info = new String[]{'Reason'};
}
}
There are actually five classes generated, but the other two classes are empty. I have my apikey here. I am just wondering how I input the apikey into the classes.
I wanted to put the WDSL file here, but it turns out that there are too many lines in the WDSL file. Therefore, I deleted it. Anyway, the generated classes are auto generated by Salesforce.
Thanks a lot if anyone can help me with the test for these classes.