You need to sign in to do that
Don't have an account?
ranveer singh 8
Invalid api version:0.0
I am facing this error wile i am saving the class which implements webservicemock any help much appriciated
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
Can you save your class with body and then add code method by method.
@isTest
global class ParkServiceMock implements WebServiceMock{
global void doinvoke(
Object stub,
Object request,
Map<String, Object> response,
String endpoint,
String soapAction,
String requestName,
String responseNS,
String responseName,
String responseType) {
string[] asa = new string[3];
asa[0]='Shiretoko National Park';
asa[1]='Oze National Park';
asa[2]='Hakusan National Park';
ParkService.byCountryResponse response_x = new ParkService.byCountryResponse();
response_x.return_x = asa;
response.put('response_x', response_x);
}
}
//Generated by wsdl2apex
public class ParkService{
public class byCountryResponse {
public String[] return_x;
private String[] return_x_type_info = new String[]{'return','http://parks.services/',null,'0','-1','false'};
private String[] apex_schema_type_info = new String[]{'http://parks.services/','false','false'};
private String[] field_order_type_info = new String[]{'return_x'};
}
public class byCountry {
public String arg0;
private String[] arg0_type_info = new String[]{'arg0','http://parks.services/',null,'0','1','false'};
private String[] apex_schema_type_info = new String[]{'http://parks.services/','false','false'};
private String[] field_order_type_info = new String[]{'arg0'};
}
public class ParksImplPort {
public String endpoint_x = 'https://th-apex-soap-service.herokuapp.com/service/parks';
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://parks.services/', 'parkService'};
public String[] byCountry(String arg0) {
parkService.byCountry request_x = new parkService.byCountry();
request_x.arg0 = arg0;
parkService.byCountryResponse response_x;
Map<String, parkService.byCountryResponse> response_map_x = new Map<String, parkService.byCountryResponse>();
response_map_x.put('response_x', response_x);
WebServiceCallout.invoke(
this,
request_x,
response_map_x,
new String[]{endpoint_x,
'',
'http://parks.services/',
'byCountry',
'http://parks.services/',
'byCountryResponse',
'parkService.byCountryResponse'}
);
response_x = response_map_x.get('response_x');
return response_x.return_x;
}
}
}
I tried in my dev environment and able to create both classes.
2. Switch to a new workspace (if you only have the default, create another one)
3. Switch Back to the workspece you were working on
4. Copy your notepad saved code to the class
5. Try to save your code again
Of course i assume you are working at developer console.
- Select all
- Close the file without saving
- Open file again
- Paste
- Save
It will be saved without an error.@brunol11 and @Shahroz Beig
This works for me!
Perform these steps:
- Select all
- Close the file without saving
- Open file again
- Paste
- Save
It will be saved without an error.