You are here: Trouble with SoapVar or is it xsi:Type? « PHP Programming Language « IT news, forums, messages
Trouble with SoapVar or is it xsi:Type?

Posted by frugalprogrammer on 05/01/07 17:21

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.netsuite.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.netsuite.com">
<ns2:internalId operator="anyOf"
xsi:type="ns3:SearchMultiSelectField"
xmlns:ns3="urn:core_2_5.platform.webservices.netsuite.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.netsuite.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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация