By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,722 Members | 1,874 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,722 IT Pros & Developers. It's quick & easy.

Trouble with SoapVar or is it xsi:Type?

P: n/a
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:

<soapenv:Body>
<search xmlns="urn:messages_2_5.platform.webservices.netsu ite.com">
<searchRecord xsi:type="ns1:ContactSearch"
xmlns:ns1="urn:relationships_2_5.lists.webservices .netsuite.com">
<ns1:customerJoin xsi:type="ns2:CustomerSearchBasic"
xmlns:ns2="urn:common_2_5.platform.webservices.net suite.com">
<ns2:internalId operator="anyOf"
xsi:type="ns3:SearchMultiSelectField"
xmlns:ns3="urn:core_2_5.platform.webservices.netsu ite.com">
<ns3:searchValue internalId="1" type="customer"
xsi:type="ns3:RecordRef"/ >
</ns2:internalId>
</ns1:customerJoin>
</searchRecord>
</search>
</soapenv:Body>

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

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/
envelope/"
xmlns:ns1="urn:messages_2_5.platform.webservices.n etsuite.com">
<SOAP-ENV:Body>
<ns1:search>
<customerJoin>
<internalId>
<operator>anyOf</operator>
<searchValue>1</searchValue>
</internalId>
</customerJoin>
</ns1:search>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

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

$ssr = new SOAPContactSearch();
$ssr->customerJoin = new SOAPCustomerSearchBasic(); $ssr->customerJoin-
>internalId = new SOAPSearchMultiSelectField(); $ssr->customerJoin-
internalId->operator = SOAPSearchMultiSelectFieldOperator::$anyOf;
$ssr->customerJoin->internalId->searchValue = "1"; $param = new
SoapVar($ssr, SOAP_ENC_OBJECT); $search_result = $netsuite_service-
>search($param); // $netsuite_service extends SoapClient, naturally
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

May 1 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.