Trouble with SoapVar or is it xsi:Type?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I'm pretty sure what I'm up against now is a namespace issue and/or a
misunderstanding of how to use SoapVar.

 From the NetSuite docs, the request should look something like:

<search xmlns="">
<searchRecord xsi:type="ns1:ContactSearch"
    <ns1:customerJoin xsi:type="ns2:CustomerSearchBasic"
        <ns2:internalId operator="anyOf"
            <ns3:searchValue internalId="1" type="customer"
xsi:type="ns3:RecordRef"/ >

But using SoapVar and SoapClient, what I'm actually requesting looks

<SOAP-ENV:Envelope xmlns:SOAP-ENV="

The code to do so looks something along the lines of:

$ssr = new SOAPContactSearch();
$ssr->customerJoin = new SOAPCustomerSearchBasic(); $ssr->customerJoin-
Quoted text here. Click to load it
$ssr->customerJoin->internalId->searchValue = "1"; $param = new
SoapVar($ssr, SOAP_ENC_OBJECT); $search_result = $netsuite_service-
Quoted text here. Click to load it

The generated error is:

org.xml.sax.SAXException: Unable to marshall between XML and Castor
Objects :unable to find FieldDescriptor for 'internalId' in
ClassDescriptor of SearchRecord

I assume I'm using SoapVar() incorrectly or this is a namespace issue
(like I'm not specifying xsi:type)???

Thanks for any help!

~ Andrew

Site Timeline