You need to sign in to do that
Don't have an account?

Test method for apex batch calling external web service
Hi.
I want to ask how to create a test method for apex batch where there is method calling external web service? the external web service is created from generate apex from wsdl.. Any suggestions would be great..
Thanks..
Test methods do not allow callouts.
So dont handle the response where you are making a callout. do callout in one method and handle response in other method.
i hope you understand else post your code.
Regards,
Shravan
Hi,
Webservice callouts are not allowed using test methods. Instead of sending the webservice request, you can prepare the sample reponse data of webservice and use that in testmethods.
Please let me know if there is any issue.
Thanks,
Devendra Natani
Blog
I hope this post will be helpful.
http://wiki.developerforce.com/index.php/An_Introduction_to_Apex_Code_Test_Methods
Thanks
Ankit Arora
Blog | Facebook | Blog Page
Hi, I still don't understand how to do it..
Here is my code snippet :
"Star_Service" is my external web service generated from wsdl.. How ot test that method? Any suggestions?
Thanks...
Edwin