Reply
Trusted Contributor
hemantgarg
Posts: 206
0

WebService Callout mock does not seem to work

Hi, I followed below post to mock a webservice callout for test class :- http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_callouts_wsdl2apex_testing.htm but it does not seem to work, is there any other setting required to make it work ? API Version is 26.0 and I am doing it on developer edition. It is still throwing error saying "System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out " Can anyone please help me ? Thanks in advance .
Thanks
Hemant Garg
My Blog
Super Contributor
Jia Hu
Posts: 839
0

Re: WebService Callout mock does not seem to work

[ Edited ]

This is an unknown issue. You can not use DML in the WebServiceMock or HttpCalloutMock. Check the links below,

http://success.salesforce.com/ideaView?id=08730000000jcfAAAQ
http://blogs.developerforce.com/developer-relations/2012/10/testing-http-callouts-with-static-data-i...