I am using Consolibyte's PHP Dev Kit for Quick Books and I have a VM with Quick Books installed as well as the Web connector for Quick Books. I am able to successfully add my SOAP service to the web connector but every time I request it to do an update, I get an authentication failure with the following message:
The request failed with an empty response.
More info:
StackTrace = at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at QBWebConnector.localhost.WCWebServiceDoc.authenticate(String strUserName, String strPassword)
at QBWebConnector.localhost.WCWebService.authenticate(String strUserName, String strPassword)
at QBWebConnector.SOAPWebService.authenticate(String UserName, String Password)
at QBWebConnector.WebService.do_authenticate(String& ticket, String& companyFileName)
Source = System.Web.Services
Where should I look to get more information on why?
It looks like I got past my original error but now I am getting an invalid username or password response.
ns1:authenticateResponse Invalid username or password, try again.
The QuickBooks table has the username and password straight from the example and that is what I am using in the web connector. Where is a good place to place some logging so I can understand why the framework is failing authentication?
Below is a log file:
QBWC1012: Authentication failed due to following error message.
Client found response content type of 'text/html; charset=UTF-8', but expected 'text/xml'.
The request failed with the error message:
--
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Phoenix Courier:
QuickBooks </title>
<link href="/favicon.ico" type="image/x-icon" rel="icon"/><link href="/favicon.ico" type="image/x-icon" rel="shortcut icon"/>
<link rel="stylesheet" href="/font/fa/master.css"/> <link rel="stylesheet" href="/font/open-sans/styles.css"/> <link rel="stylesheet" href="/font/open-sans-condensed/styles.css"/> <link rel="stylesheet" href="/font/oswald/styles.css"/>
<link rel="stylesheet" href="/css/base.css"/> <link rel="stylesheet" href="/css/style.css"/> <link rel="stylesheet" href="/css/phoenix.css"/>
<script src="/js/jquery-3.3.1.min.js"></script>
<script src="/js/psUserInterface.js"></script></head>
<body>
<div class="page-wrap">
<div class="container clearfix">
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://developer.intuit.com/">
<SOAP-ENV:Body><ns1:authenticateResponse><ns1:authenticateResult><ns1:string>67481fd9-4703-fae4-6d81-0ccbf770b4fa</ns1:string>
<ns1:string></ns1:string>
</ns1:authenticateResult></ns1:authenticateResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope> </div>
</div>
<script>
PS_UI.navigation.initNavActive();
PS_UI.navigation.desktop.initNavArrows();
</script>
</body>
</html>
--.
More info:
StackTrace = at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at QBWebConnector.localhost.WCWebServiceDoc.authenticate(String strUserName, String strPassword)
at QBWebConnector.localhost.WCWebService.authenticate(String strUserName, String strPassword)
at QBWebConnector.SOAPWebService.authenticate(String UserName, String Password)
at QBWebConnector.WebService.do_authenticate(String& ticket, String& companyFileName)
Source = System.Web.Services
Here is my QWC file:
<?xml version="1.0"?>
<QBWCXML>
<AppName>My QuickBooks SOAP Server</AppName>
<AppID></AppID>
<AppURL>https://dispatch.sharp.com/</AppURL>
<AppDescription>An example QuickBooks SOAP Server</AppDescription>
<AppSupport>https://dispatch.phoenixcourier.com/</AppSupport>
<UserName>quickbooks</UserName>
<OwnerID>{57F3B9B6-86F1-4FCC-B1FF-166DE1813D20}</OwnerID>
<FileID>{57F3B9B6-86F1-4FCC-B1FF-966DE1813D20}</FileID>
<QBType>QBFS</QBType>
<Notify>false</Notify>
<Scheduler>
<RunEveryNMinutes>10</RunEveryNMinutes>
</Scheduler>
<IsReadOnly>false</IsReadOnly>
</QBWCXML>
</div>
I was able to get this to work. It basically was my content headers as I found during research. I was using the cake framework. I did the following for testing.
$this->RequestHandler->respondAs('text/xml');