No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
WebServiceMock Interface
Enables sending fake responses when testing
Web service callouts of a class auto-generated from a WSDL.
Namespace
Usage
For an implementation example, see Testing Web Service Callouts.
WebServiceMock Methods
The following are methods for WebServiceMock.
doInvoke(Object, Object, Map<String, Object>, String, String, String, String, String, String)
The implementation of this method is called by the Apex runtime to send a fake response when a Web service callout
is made after Test.setMock has been called.
Signature
public Void doInvoke(Object stub, Object request, Map<String, Object> response, String endpoint, String soapAction, String requestName, String responseNS, String responseName, String responseType)
Parameters
- stub
- Type: Object
- An instance of the auto-generated class.
- request
- Type: Object
- The SOAP Web service request being invoked.
- response
- Type: Map<String, Object>
- A collection of key/value pairs representing the response to send for the request.
- When implementing this interface, set the response argument to a key/value pair representing the response desired.
- endpoint
- Type: String
- The endpoint URL for the request.
- soapAction
- Type: String
- The requested SOAP operation.
- requestName
- Type: String
- The requested SOAP operation name.
- responseNS
- Type: String
- The response namespace.
- responseName
- Type: String
- The name of the response element as defined in the WSDL.
- responseType
- Type: String
- The class for the response as defined in the auto-generated class.
Return Value
Type: Void