2017-12-29 40 views
0

QuickBooks DesktopにQuickBooksWebConnector経由で接続するSOAPアプリケーションを1つ作成しました。私はwsdl URLをWebConnectorに与えました。最初のコールバックコール中に、コネクタに次のエラーが表示されます。オブジェクト参照がJavaのSOAP WebServiceのオブジェクトのインスタンスに設定されていない

QBWC1012:次のエラーメッセージが原因で認証に失敗しました。 オブジェクト参照がオブジェクトのインスタンスに設定されていません。詳細については、QWCLogを参照してください。ログオンすることを忘れないでください。

理想的には、オブジェクト参照がオブジェクトのインスタンスに設定されていないことを意味します。

私はSOAPUIまたはWebServiceExplorerからこれを実行しようとしているときは以下に示すように、それが正しい応答メッセージを示しています

要求:

<soapenv:Envelope> 
    <soapenv:Body> 
    <q0:authenticate> 
     <q0:strUserName>Admin</q0:strUserName> 
     <q0:strPassword>Admin</q0:strPassword> 
    </q0:authenticate> 
    </soapenv:Body> 
</soapenv:Envelope> 

応答:

<soapenv:Envelope> 
    <soapenv:Body> 
    <authenticateResponse> 
     <authenticateReturn xsi:type="ns1:ArrayOfString"> 
     <ns1:string>{57F3B9B1-86F1-4fcc-B1EE-566DE1813D20}</ns1:string> 
     <ns1:string>none</ns1:string> 
     </authenticateReturn> 
    </authenticateResponse> 
    </soapenv:Body> 
</soapenv:Envelope> 

(から撮影WebServiceExplorer) このエラーを検索したときに、コネクタが何かnullを取得した場合、または応答が無効でこのエラーが発生する場合があります。 この種のエラーを解決する方法。

私はSOAP Webserviceの新機能であり、QuickBooksの新機能も搭載しています。

ありがとうございます。

答えて

0

従事ソリューション:私はエラーのこの種を解決するために、メソッド宣言とモデルクラス定義に注釈を添加

(下図)

注釈サービスの宣言:

@WebService(name = "QBWebConnectorSvcSoap", targetNamespace = "http://developer.intuit.com/") 
@XmlSeeAlso({ 
    ObjectFactory.class 
}) 
public interface QBWebConnectorSvcSoap { 

@WebMethod(action = "http://developer.intuit.com/authenticate") 
    @WebResult(name = "authenticateResult", targetNamespace = "http://developer.intuit.com/") 
    @RequestWrapper(localName = "authenticate", targetNamespace = "http://developer.intuit.com/", className = "com.cantero.quickbooks.ws.Authenticate") 
    @ResponseWrapper(localName = "authenticateResponse", targetNamespace = "http://developer.intuit.com/", className = "com.cantero.quickbooks.ws.AuthenticateResponse") 
    public ArrayOfString authenticate(
     @WebParam(name = "strUserName", targetNamespace = "http://developer.intuit.com/") 
     String strUserName, 
     @WebParam(name = "strPassword", targetNamespace = "http://developer.intuit.com/") 
     String strPassword); 

//same for remaining methods  
} 

モデルクラスの注釈:

package com.cantero.quickbooks.ws; 

import javax.xml.bind.annotation.XmlAccessType; 
import javax.xml.bind.annotation.XmlAccessorType; 
import javax.xml.bind.annotation.XmlRootElement; 
import javax.xml.bind.annotation.XmlType; 

/** 
* <p>Java class for anonymous complex type. 
* <p>The following schema fragment specifies the expected content contained within this class. 
* <pre> 
* &lt;complexType> 
* &lt;complexContent> 
*  &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 
*  &lt;sequence> 
*   &lt;element name="strUserName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> 
*   &lt;element name="strPassword" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> 
*  &lt;/sequence> 
*  &lt;/restriction> 
* &lt;/complexContent> 
* &lt;/complexType> 
* </pre> 
*/ 
@XmlAccessorType(XmlAccessType.FIELD) 
@XmlType(name = "", propOrder = { 
    "strUserName", 
    "strPassword" 
}) 
@XmlRootElement(name = "authenticate") 
public class Authenticate { 

    protected String strUserName; 
    protected String strPassword; 

    public String getStrUserName() { 
     return strUserName; 
    } 

    public void setStrUserName(String value) { 
     this.strUserName = value; 
    } 

    public String getStrPassword() { 
     return strPassword; 
    } 

    public void setStrPassword(String value) { 
     this.strPassword = value; 
    } 

} 

あなたは、このリンクを参照することができます[targetNamespaceを/ webAction /のXmlType]これらのアノテーションに書き込むかについての詳細は:

https://www.connexforquickbooks.com/qbwebservice.asmx?op=authenticate

関連する問題