Forum Moderators: coopster
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.microsoft.com/dynamics/gp/2006/01" xmlns:ns2="http://schemas.microsoft.com/dynamics/2006/01" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:GetCustomerByKey>
<ns1:key>
<ns1:Id>UCTest001</ns1:Id>
</ns1:key>
<ns2:Context>
<ns2:OrganizationKey xsi:type="ns2:CompanyKey">
<ns2:Id>1</ns2:Id>
</ns2:OrganizationKey>
<ns2:CurrencyType>Transactional</ns2:CurrencyType>
</ns2:Context>
</ns1:GetCustomerByKey>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
$newCust = new stdClass();
$newCust->key->Id = $custKey;
$newCompanyKey = new stdClass();
$newCompanyKey->Id = 1;
$newCust->Context->OrganizationKey = $newCompanyKey;
$newCust->Context->CurrencyType = CurrencyType::Transactional;
$GetCustomerByKey = $newCust;
<ns2:OrganizationKey/>
<s:complexType name="OrganizationKey" abstract="true">
<s:complexContent mixed="false">
<s:extension base="s2:Key" />
</s:complexContent>
</s:complexType>
<s:complexType name="Key" abstract="true" />
<s:complexType name="CompanyKey">
<s:complexContent mixed="false">
<s:extension base="s2:OrganizationKey">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="Id" type="s:int" />
</s:sequence>
</s:extension>
</s:complexContent>
</s:complexType>
$Context = new Context();
$Context->OrganizationKey = new CompanyKey();
$Context->OrganizationKey->Id = '1'; //1 real, 2 ?
$Context->CurrencyType = CurrencyType::Transactional;
So why does it work one way, not the other
"The specified type is abstract: name='OrganizationKey'"