Netsuite API Raw XML Request

Recently someone asked me if I could send them a copy of the XML that gets sent back and forth when you make a Netsuite API call. This could be useful if you want to implement the Netsuite API in a language that they don’t provide libraries for. Anyway, here is the xml:

<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:core_2009_2.platform.webservices.netsuite.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="urn:messages_2009_2.platform.webservices.netsuite.com">
    <Header>
        <passport actor="http://schemas.xmlsoap.org/soap/actor/next">
            <email>myemail@mydomain.com</email>
            <password>mypassword</password>
            <account>234234</account>
            <role internalId="23" xsi:type="RecordRef"/>
        </passport>
    </Header>
    <Body>
        <get>
            <baseRef internalId="706" type="inventoryItem" xsi:type="RecordRef"/>
        </get>
    </Body>
</Envelope>

And here is the response (a lot of the content has been removed to keep it short):

<?xml version="1.0" encoding="utf-8"?><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:Header>
        <platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2009_2.platform.webservices.netsuite.com">
            <platformMsgs:nsId>[Content removed]</platformMsgs:nsId>
        </platformMsgs:documentInfo>
    </soapenv:Header>
    <soapenv:Body>
        <getResponse xmlns="urn:messages_2009_2.platform.webservices.netsuite.com">
            <readResponse>
                <platformCore:status isSuccess="true" xmlns:platformCore="urn:core_2009_2.platform.webservices.netsuite.com"/>
                <record internalId="706" externalId="ITEM706" xsi:type="listAcct:InventoryItem" xmlns:listAcct="urn:accounting_2009_2.lists.webservices.netsuite.com">
                    <!--Lots more stuff here-->
                </record>
            </readResponse>
        </getResponse>
    </soapenv:Body>
</soapenv:Envelope>

This xml was generated using the PHP_Toolkit and a modification of this test script.

If you want to see the xml from your own requests generated using the PHP Toolkit, just create a folder called “nslog” in the root directory of the toolkit. Then all requests and responses will be logged to that folder. Be careful though, it will fill up fast.

This entry was posted in Beginning with the PHPToolkit, Netsuite PHPToolkit and tagged , , , , , . Bookmark the permalink.

One Response to Netsuite API Raw XML Request

  1. Tarang Lute says:

    Hi
    In Netsuite,we have scenario where
    1. User will login via desktop application.
    2. On successfull login we need to redirect user to netsuite webapplication.
    3. We want to continue user desktop session in netsuite web application also.

    **Note : Login will only be done via desktop application.**

    Currenlty we are using Netsuite webservice with passport authentication.Also is it possible to login netsuite without providing account number.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>