Quickbooks集成错误号401

时间:2017-09-20 09:48:10

标签: java java-ee quickbooks quickbooks-online

我是quickbooks技术的新手,我想在Quick books和(CRUD-SampleApp-Java)应用程序之间进行集成,每次运行“CustomerCreate”类时我都会收到此错误: “调用实体时出错add :: message = AuthenticationFailed; errorCode = 003200; statusCode = 401”

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/kjaber/.m2/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/kjaber/.m2/repository/org/slf4j/slf4j-log4j12/1.7.21/slf4j-log4j12-1.7.21.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
0    [main] DEBUG org.apache.commons.configuration.ConfigurationUtils  - ConfigurationUtils.locate(): base is null, name is intuit-config.xml
4    [main] DEBUG org.apache.commons.configuration.ConfigurationUtils  - Loading configuration from the context classpath (intuit-config.xml)
34   [main] DEBUG org.apache.commons.configuration.ConfigurationUtils  - ConfigurationUtils.locate(): base is null, name is intuit-default-config.xml
35   [main] DEBUG org.apache.commons.configuration.ConfigurationUtils  - Loading configuration from the context classpath (intuit-default-config.xml)
63   [main] DEBUG com.intuit.logger  - Enter PrepareRequestInterceptor...
149  [main] DEBUG com.intuit.logger  - Exit PrepareRequestInterceptor.
149  [main] DEBUG com.intuit.logger  - Enter SerializeInterceptor...
149  [main] INFO  com.intuit.logger  - serialization format : json
517  [main] DEBUG com.intuit.logger  - Exit SerializeInterceptor.
517  [main] DEBUG com.intuit.logger  - Enter CompressionInterceptor...
517  [main] INFO  com.intuit.logger  - compression format : gzip
519  [main] DEBUG com.intuit.logger  - Exit CompressionInterceptor.
519  [main] DEBUG com.intuit.logger  - Enter HTTPClientConnectionInterceptor...
856  [main] DEBUG com.intuit.logger  - Request URI : https://sandbox-quickbooks.api.intuit.com/v3/company/193514552765139/customer?requestid=aa62bd10e21848f8a1ade7f666e59546&minorversion=12&
856  [main] DEBUG com.intuit.logger  - Http Method : POST
856  [main] DEBUG com.intuit.logger  - Request Body : {"DisplayName":"0hmQ77"}
868  [main] DEBUG org.apache.http.client.protocol.RequestAddCookies  - CookieSpec selected: default
877  [main] DEBUG org.apache.http.client.protocol.RequestAuthCache  - Auth cache not set in the context
878  [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager  - Connection request: [route: {s}->https://sandbox-quickbooks.api.intuit.com:443][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
891  [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager  - Connection leased: [id: 0][route: {s}->https://sandbox-quickbooks.api.intuit.com:443][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
892  [main] DEBUG org.apache.http.impl.execchain.MainClientExec  - Opening connection {s}->https://sandbox-quickbooks.api.intuit.com:443
1133 [main] DEBUG org.apache.http.impl.conn.DefaultHttpClientConnectionOperator  - Connecting to sandbox-quickbooks.api.intuit.com/12.149.173.155:443
1133 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory  - Connecting socket to sandbox-quickbooks.api.intuit.com/12.149.173.155:443 with timeout 0
1410 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory  - Enabled protocols: [TLSv1, TLSv1.1, TLSv1.2]
1410 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory  - Enabled cipher suites:[TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
1410 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory  - Starting handshake
2209 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory  - Secure session established
2209 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory  -  negotiated protocol: TLSv1.2
2209 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory  -  negotiated cipher suite: TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
2210 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory  -  peer principal: CN=*.api.intuit.com, OU=CTO-DEV-ICS Ops, O=INTUIT INC., L=San Diego, ST=California, C=US
2210 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory  -  peer alternative names: [api.intuit.com, *.api.intuit.com, api.intuit.net, *.api.intuit.net]
2211 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory  -  issuer principal: CN=Symantec Class 3 Secure Server CA - G4, OU=Symantec Trust Network, O=Symantec Corporation, C=US
2217 [main] DEBUG org.apache.http.impl.conn.DefaultHttpClientConnectionOperator  - Connection established 172.16.1.19:60298<->12.149.173.155:443
2217 [main] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection  - http-outgoing-0: set socket timeout to 0
2217 [main] DEBUG org.apache.http.impl.execchain.MainClientExec  - Executing request POST /v3/company/193514552765139/customer?requestid=aa62bd10e21848f8a1ade7f666e59546&minorversion=12& HTTP/1.1
2218 [main] DEBUG org.apache.http.impl.execchain.MainClientExec  - Proxy auth state: UNCHALLENGED
2221 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> POST /v3/company/193514552765139/customer?requestid=aa62bd10e21848f8a1ade7f666e59546&minorversion=12& HTTP/1.1
2221 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> Accept: application/json
2221 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> Content-Encoding: gzip
2221 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> content-type: application/json
2221 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> Accept-Encoding: gzip
2221 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> User-Agent: V3JavaSDK3.0.0
2221 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> Authorization: Bearer L011505900548zBbxMrQrmfBnApHFLwR8KslQ7zzVL2fgB0XaJ
2221 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> Content-Length: 44
2221 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> Host: sandbox-quickbooks.api.intuit.com
2221 [main] DEBUG org.apache.http.headers  - http-outgoing-0 >> Connection: Keep-Alive
2222 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "POST /v3/company/193514552765139/customer?requestid=aa62bd10e21848f8a1ade7f666e59546&minorversion=12& HTTP/1.1[\r][\n]"
2222 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "Accept: application/json[\r][\n]"
2222 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "Content-Encoding: gzip[\r][\n]"
2222 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "content-type: application/json[\r][\n]"
2222 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "Accept-Encoding: gzip[\r][\n]"
2222 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "User-Agent: V3JavaSDK3.0.0[\r][\n]"
2222 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "Authorization: Bearer L011505900548zBbxMrQrmfBnApHFLwR8KslQ7zzVL2fgB0XaJ[\r][\n]"
2222 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "Content-Length: 44[\r][\n]"
2222 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "Host: sandbox-quickbooks.api.intuit.com[\r][\n]"
2223 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
2223 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "[\r][\n]"
2223 [main] DEBUG org.apache.http.wire  - http-outgoing-0 >> "[0x1f][0x8b][0x8][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0xab]Vr[0xc9],.[0xc8]I[0xac][0xf4]K[0xcc]MU[0xb2]R2[0xc8][0xc8][\r]47W[0xaa][0x5][0x0]&[0xe6][0xb0][0x18][0x0][0x0][0x0]"
2490 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "HTTP/1.1 401 Unauthorized[\r][\n]"
2490 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "Server: nginx[\r][\n]"
2490 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "Date: Wed, 20 Sep 2017 09:37:07 GMT[\r][\n]"
2490 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "Content-Type: text/xml[\r][\n]"
2490 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "Content-Length: 388[\r][\n]"
2490 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "Connection: keep-alive[\r][\n]"
2490 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "Keep-Alive: timeout=5[\r][\n]"
2490 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "intuit_tid: 9856d20d-f8ce-d77c-024f-3cdcf258e401[\r][\n]"
2491 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "WWW-Authenticate: Bearer realm="Intuit", error="invalid_token"[\r][\n]"
2491 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "[\r][\n]"
2491 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "<?xml version="1.0" encoding="UTF-8" standalone="yes"?>[\n]"
2491 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "<IntuitResponse time="2017-09-20T02:37:07.562-07:00" xmlns="http://schema.intuit.com/finance/v3">[\n]"
2491 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "    <Fault type="AUTHENTICATION">[\n]"
2491 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "        <Error code="3200">[\n]"
2491 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "            <Message>message=AuthenticationFailed; errorCode=003200; statusCode=401</Message>[\n]"
2491 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "            <Detail></Detail>[\n]"
2491 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "        </Error>[\n]"
2491 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "    </Fault>[\n]"
2491 [main] DEBUG org.apache.http.wire  - http-outgoing-0 << "</IntuitResponse>[\n]"
2495 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << HTTP/1.1 401 Unauthorized
2495 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << Server: nginx
2495 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << Date: Wed, 20 Sep 2017 09:37:07 GMT
2495 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << Content-Type: text/xml
2496 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << Content-Length: 388
2496 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << Connection: keep-alive
2496 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << Keep-Alive: timeout=5
2496 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << intuit_tid: 9856d20d-f8ce-d77c-024f-3cdcf258e401
2496 [main] DEBUG org.apache.http.headers  - http-outgoing-0 << WWW-Authenticate: Bearer realm="Intuit", error="invalid_token"
2503 [main] DEBUG org.apache.http.impl.execchain.MainClientExec  - Connection can be kept alive for 5000 MILLISECONDS
2503 [main] DEBUG org.apache.http.impl.auth.HttpAuthenticator  - Authentication required
2503 [main] DEBUG org.apache.http.impl.auth.HttpAuthenticator  - sandbox-quickbooks.api.intuit.com:443 requested authentication
2503 [main] DEBUG org.apache.http.impl.client.TargetAuthenticationStrategy  - Authentication schemes in the order of preference: [Negotiate, Kerberos, NTLM, Digest, Basic]
2503 [main] DEBUG org.apache.http.impl.client.TargetAuthenticationStrategy  - Challenge for Negotiate authentication scheme not available
2503 [main] DEBUG org.apache.http.impl.client.TargetAuthenticationStrategy  - Challenge for Kerberos authentication scheme not available
2504 [main] DEBUG org.apache.http.impl.client.TargetAuthenticationStrategy  - Challenge for NTLM authentication scheme not available
2504 [main] DEBUG org.apache.http.impl.client.TargetAuthenticationStrategy  - Challenge for Digest authentication scheme not available
2504 [main] DEBUG org.apache.http.impl.client.TargetAuthenticationStrategy  - Challenge for Basic authentication scheme not available
2508 [main] DEBUG com.intuit.logger  - Connection status : HTTP/1.1 401 Unauthorized
2509 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager  - Connection [id: 0][route: {s}->https://sandbox-quickbooks.api.intuit.com:443] can be kept alive for 5.0 seconds
2509 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager  - Connection released: [id: 0][route: {s}->https://sandbox-quickbooks.api.intuit.com:443][total kept alive: 1; route allocated: 1 of 2; total allocated: 1 of 20]
2509 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager  - Connection manager is shutting down
2509 [main] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection  - http-outgoing-0: Close connection
2510 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager  - Connection manager shut down
2511 [main] DEBUG com.intuit.logger  - Exit HTTPClientConnectionInterceptor.
2511 [main] DEBUG com.intuit.logger  - Enter DecompressInterceptor...
2511 [main] DEBUG com.intuit.logger  - Decompressed Response Body : <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<IntuitResponse time="2017-09-20T02:37:07.562-07:00" xmlns="http://schema.intuit.com/finance/v3">
    <Fault type="AUTHENTICATION">
        <Error code="3200">
            <Message>message=AuthenticationFailed; errorCode=003200; statusCode=401</Message>
            <Detail></Detail>
        </Error>
    </Fault>
</IntuitResponse>

2511 [main] DEBUG com.intuit.logger  - Exit DecompressInterceptor.
2511 [main] DEBUG com.intuit.logger  - Enter DeserializeInterceptor...
2511 [main] INFO  com.intuit.logger  - HttpResponse content-type (deserialization format) : xml
2512 [main] DEBUG com.intuit.logger  - HttpResponse content-type (deserialization format) : xml
3585 [main] DEBUG com.intuit.logger  - Exit DeserializeInterceptor.
3585 [main] DEBUG com.intuit.logger  - Enter HandleResponseInterceptor...
3586 [main] ERROR com.intuit.logger  - Error while calling entity add:: message=AuthenticationFailed; errorCode=003200; statusCode=401

请注意我执行了以下配置: 在intuit-config.xml&gt;&gt;

<?xml version="1.0" encoding="UTF-8"?>
<intuit-config>
    <baseURL>
        <qbo>https://sandbox-quickbooks.api.intuit.com/v3/company</qbo> 
    </baseURL>
</intuit-config>

在config.properties中 我使用https://developer.intuit.com/v2/ui#/playground来获取此信息。

enter image description here

  

&GT;

#For OAuth2 app set oauth.type=2
oauth.type=2

#OAuth2 access token
oauth2.accessToken =L011505900548zBbxMrQrmfBnApHFLwR8KslQ7zzVL2fgB0XaJ

#company id or realmId
company.id=193514552765139

#OAuth1 keys
app.token=
consumer.key=
consumer.secret=
oauth.accessToken=
oauth.accessTokenSecret=

Java build:1.8.0_144 我已经添加了(ipp-v3-java-data,ipp-v3-java-devkit,oauth2-platform-api)来使项目成功构建 enter image description here

0 个答案:

没有答案