目前安装了两台服务器,我的开发服务器和服务器Quick Books。
这是保存在Quick Books服务器上的.QWC文件。
<?xml version="1.0" encoding="utf-8"?>
<QBWCXML>
<AppName>QBWebService</AppName>
<AppID></AppID>
<AppURL>https://<url>/soap.js</AppURL>
<AppDescription>This is The App</AppDescription>
<AppSupport>https://<url></AppSupport>
<UserName>User</UserName>
<OwnerID>{GUID}</OwnerID>
<FileID>{GUID}</FileID>
<QBType>QBFS</QBType>
</QBWCXML>
这是我的dev服务器上soap.js文件中的代码。
var soap = require('soap'),
fs = require('fs'),
xml = fs.readFileSync('wsdl.wsdl', 'utf8'),
https = require('https'),
options = {
key: fs.readFileSync('/path/to/key'),
cert: fs.readFileSync('/path/to/crt'),
ca: [
fs.readFileSync('/path/to/crt', 'utf8'),
fs.readFileSync('/path/to/crt', 'utf8'),
fs.readFileSync('/path/to/crt', 'utf8')
]
};
var server = https.createServer(options, function(request, response) {
response.end("404: Not Found: " + request.url);
});
var myService = {
'QBWebConnectorSvc': {
'QBWebConnectorSvcSoap': {
authenticate: function(args) {
return {
authenticateResult: { string: [guid(), {}]}
};
}
}
}
};
server.listen(443, function() {
console.log('Listening Jimbo');
});
soap.listen(server, '/wsdl', myService, xml);
var thisUrl = './wsdl/wsdl.wsdl';
soap.createClient(thisUrl, function(err, client) {
if(err) {
console.log('Error soap create client:');
console.log(err);
}
else {
console.log('In soap create client else');
console.log('Client:');
console.log(client);
console.log('This should be describe');
client.setSecurity(new soap.ClientSSLSecurity('/Path/to/Server/key', '/path/to/server/crt', function(err, secure) {
if(err) {
console.log('Error Not Secure:');
}
else {
console.log('Secure');
console.log(secure);
client.QBWebConnectorSvc.QBWebConnectorSvcSoap.authenticate(function(err, done) {
if(err) {
console.log('Err Auth:');
console.log(err);
}
else {
console.log('Auth Done:');
console.log(done);
}
});
}
}));
问题是Web连接器一直说它无法验证我的证书,并且#B; QBWC1048:QuickBooks Web连接器无法验证Web应用程序服务器证书。&#34;。我知道证书很好,防火墙在两台计算机之间打开。
以下是来自WebConnector的日志文件。
> 20160906.20:29:30 UTC : QBWebConnector.WebServiceManager.ReadQWC(QWCReader QWC) : Parsing application configuration xml file to load its content to variables
20160906.20:29:51 UTC : : QBWC1048: QuickBooks Web Connector could not verify the web application server certificate.Certificate URL:https://<url>/soap.jsStackTrace:at System.Net.HttpWebRequest.GetResponse()
at QBWebConnector.QWCReader.CheckCertURL()Message (description of theexception):Unable to connect to the remote server Source (name of application or object that caused the exception):SystemTargetSite (method that threw the exception):System.Net.WebResponse GetResponse()InnerException:System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond <IP>:443
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
atSystem.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state,IAsyncResult asyncResult, Exception& exception)
20160906.20:29:58 UTC :QBWebConnector.WebServiceManager.ReadQWC(QWCReader QWC) : QBWC1048: QuickBooks Web Connector could not verify the web application server certificate.
QBWC1051: The new application was not added
20160906.20:29:58 UTC : : ~SingleInstanceHandler() - usingInstanceChannel = false. Returning without any Registry key delete or unmarshalling.
如果您需要更多信息,请询问。
非常感谢任何帮助。谢谢。