Valid XML for Publishing to QuickBooks Online Edition - Getting (400) Query Error

I am trying to post below xml https://apps.quickbooks.com/j/AppGateway and all I get is an error: the remote server returned an error: (error 400, invalid request. Does anyone have any idea that I am I doing wrong? Below is the C # code that I use to publish xml.

Thanks, Jeff

UPDATE: to add more to my question, I think the (400) Bad Request error indicates that I have something very bad with xml or with the way I submit xml. That's why I ask this question ... what am I missing here?

<?xml version="1.0" encoding="utf-8" ?>
<?qbxml version="7.0"?>
<QBXML>
<SignonMsgsRq>
<SignonDesktopRq>
<ClientDateTime>7/20/2009 12:36PM</ClientDateTime>
<ApplicationLogin>APP_LOGIN</ApplicationLogin>
<ConnectionTicket>CONNECTION_TICKET</ConnectionTicket>
<Language>English</Language>
<AppID>APP_ID</AppID>
<AppVer>1</AppVer>
</SignonDesktopRq>
</SignonMsgsRq>
<QBXMLMsgsRq>
<CustomerQueryRq requestID="2" />
</QBXMLMsgsRq>
</QBXML>



WebRequestObject = (HttpWebRequest)WebRequest.Create(requestUrl);
WebRequestObject.Method = "POST";
WebRequestObject.ContentType = "application/x-qbxml";
WebRequestObject.AllowAutoRedirect = false;
string post = XmlText.Text;

WebRequestObject.ContentLength = post.Length;

swr = new StreamWriter(WebRequestObject.GetRequestStream());
swr.Write(post);
swr.Close();

WebResponseObject = (HttpWebResponse)WebRequestObject.GetResponse();
0
source share
4

, 6.0, onError QBXMLMsgsRq. ( , Keith Palmer.)

/ xml :

<?xml version="1.0" encoding="utf-8" ?> 
<?qbxml version="6.0"?> 
<QBXML> 
    <SignonMsgsRq>
        <SignonDesktopRq> 
            <ClientDateTime>2009-07-21T10:10:00</ClientDateTime> 
            <ApplicationLogin>APPLICATION_LOGIN</ApplicationLogin>
            <ConnectionTicket>CONNECTION_TICKET</ConnectionTicket>
            <Language>English</Language> 
            <AppID>APP_ID</AppID>
            <AppVer>1</AppVer> 
        </SignonDesktopRq> 
    </SignonMsgsRq> 
    <QBXMLMsgsRq onError="continueOnError"> 
        <CustomerQueryRq requestID="2" /> 
    </QBXMLMsgsRq> 
</QBXML>
0

qbXML 6.0, QuickBooks Online Edition 7.0.

+1

xml ? , . , XML . , XML. , ,

0

XML :

QuickBooks Online OSR

Select CustomerQuery as the message. Use Chrome because it does not work in all browsers. Click XmlOps and you will see XML.

In another note, I have a commercial solution available here:

QuickBooks Online C # Development Integration

0
source

Source: https://habr.com/ru/post/1712017/


All Articles