Hey everyone! I’m trying to upload a file to a txn...
# general
j
Hey everyone! I’m trying to upload a file to a txn using the SOAP APIs, but I keep receiving the below error. Has anyone seen this/know what I’m doing wrong? Request & Response in the thread!
Copy code
org.xml.sax.SAXException: Expected {urn:<http://core_2020_2.platform.webservices.netsuite.com|core_2020_2.platform.webservices.netsuite.com>}internalId, found {urn:<http://filecabinet_2020_2.documents.webservices.netsuite.com|filecabinet_2020_2.documents.webservices.netsuite.com>}internalId
Copy code
<?xml version="1.0" encoding="utf-8"?>
<soap-env:Envelope xmlns:soap-env="<http://schemas.xmlsoap.org/soap/envelope/>">
    <soap-env:Header>
        <tokenPassport xmlns:ns0="urn:messages_2020_2.platform.webservices.netsuite.com">
            <account xmlns:ns1="urn:core_2020_2.platform.webservices.netsuite.com">{Domain}</account>
            <consumerKey xmlns:ns2="urn:core_2020_2.platform.webservices.netsuite.com">{CONSUMER_KEY}</consumerKey>
            <token xmlns:ns3="urn:core_2020_2.platform.webservices.netsuite.com">{TOKEN_ID}</token>
            <nonce xmlns:ns4="urn:core_2020_2.platform.webservices.netsuite.com">{nonce}</nonce>
            <timestamp xmlns:ns5="urn:core_2020_2.platform.webservices.netsuite.com">{timestamp}</timestamp>
            <signature xmlns:ns6="urn:core_2020_2.platform.webservices.netsuite.com" algorithm="HMAC-SHA256">{signature}</signature>
        </tokenPassport>
    </soap-env:Header>
    <soap-env:Body>
        <add xmlns="urn:messages_2020_2.platform.webservices.netsuite.com">
            <record xmlns:xsi="<http://www.w3.org/2001/XMLSchema-instance>" xmlns="urn:<http://filecabinet_2020_2.documents.webservices.netsuite.com|filecabinet_2020_2.documents.webservices.netsuite.com>" xsi:type="File">
                <name>test</name>
                <attachFrom>_computer</attachFrom>
                <content>RXh0ZXJuYWwgSUQsTmFtZQ0KMTAzLHNjYXJsZXQNCjEwMixkYXduDQoxMDQsc3VuDQo=</content>
                <owner>
                    <internalId>5777</internalId>
                    <type>journalEntry</type>
                </owner>
                <folder internalId="20"/>
            </record>
        </add>
    </soap-env:Body>
</soap-env:Envelope>
Copy code
{
  "soapenv:Envelope": {
    "@xmlns:soapenv": "<http://schemas.xmlsoap.org/soap/envelope/>",
    "@xmlns:xsd": "<http://www.w3.org/2001/XMLSchema>",
    "@xmlns:xsi": "<http://www.w3.org/2001/XMLSchema-instance>",
    "soapenv:Body": {
      "soapenv:Fault": {
        "faultcode": "soapenv:Server.userException",
        "faultstring": "org.xml.sax.SAXException: Expected {urn:<http://core_2020_2.platform.webservices.netsuite.com|core_2020_2.platform.webservices.netsuite.com>}internalId, found {urn:<http://filecabinet_2020_2.documents.webservices.netsuite.com|filecabinet_2020_2.documents.webservices.netsuite.com>}internalId",
        "detail": {
          "ns1:hostname": {
            "@xmlns:ns1": "<http://xml.apache.org/axis/>",
            "#text": "partners225.prod-iad-na4.core.ns.internal"
          }
        }
      }
    }
  }
}
b
owner is a recordref, the internal id is an attribute, not an element
j
amazing! cant believe i missed that, thank you so much!