The endpoints handle each individual SOAP request. You won't need to override them, but you will need to inject each of their dependencies.
A task implements goreilly\WebConnector\Task\TaskInterface
to determine if a request should be sent and what kind
of xml to send.
A handler implements \goreilly\WebConnector\QBXMLResponseHandler\QBXMLResponseHandlerInterface
. When a response is
returned from Quickbooks, a handler that supports the response content will be selected and ran.
class ItemQueryHandler implements QBXMLResponseHandlerInterface
{
public function supports($type)
{
return $type === 'ItemQueryRs';
}
public function handle(\SimpleXMLElement $element)
{
// Insert items into database...
}
}
The Queue persists between requests. It will last for one click of the "Update Selected" button in the Web Connector because it clears cookies after that. You can store the Queue however you want, like in the session. You just need to retrieve and pass the Queue to the Server each request.
The Queue must be injected into the Handlers that need it.
- SendRequestXMLHandler: Uses the Queue to build and send XML from tasks stored in the queue.
- AuthenticateEndpoint: Uses the Queue to report the initial progress.
- ReceiveResponseXMLEndpoint: Uses the Queue to report progress after handling the response.
Authentication is optional, but you must pass an Authenticator object to the Authentication Endpoint. If you would like to always accept every request, use the NullAuthenticator.
- Determine what you want to get from Quickbooks.
- Look up the correct Query and Response formats from the Intuit Documentation: https://developer-static.intuit.com/qbSDK-current/Common/newOSR/index.html (Choose qbXML and the correct SDK version)
- If changes don't seem to be effecting anything try to stop and start your PHP Development Server since it caches the SOAPServer.
- Adding Responses to Handlers. I don't know if they need them?
- Unit Tests
- QBXML Validation via xsd
- Error Handling
- Find correct WSDL file