<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: IncompleteElementContentError in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/IncompleteElementContentError/m-p/57967#M32648</link>
    <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/21663"&gt;@dkpapo123&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you switch to production credentials, are you also setting the environment?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Setting Production or Sandbox Environments&lt;/H3&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To set the environment use the setenvironment method on the controller before executing. E.g. for the example above:&lt;/P&gt;
&lt;DIV class="highlight highlight-source-python"&gt;
&lt;PRE&gt;&lt;SPAN class="pl-c"&gt;# Defaults to constants.SANDBOX for sandbox testing&lt;/SPAN&gt;
createtransactioncontroller.setenvironment(constants.&lt;SPAN class="pl-c1"&gt;PRODUCTION&lt;/SPAN&gt;)&lt;/PRE&gt;
&lt;/DIV&gt;</description>
    <pubDate>Thu, 04 May 2017 21:19:31 GMT</pubDate>
    <dc:creator>RichardH</dc:creator>
    <dc:date>2017-05-04T21:19:31Z</dc:date>
    <item>
      <title>IncompleteElementContentError</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/IncompleteElementContentError/m-p/57395#M32116</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I'm using what is essentially the sample code from &lt;/SPAN&gt;&lt;A href="http://developer.authorize.net/api/reference/index.html#customer-profiles-create-customer-profile" target="_blank"&gt;http://developer.authorize.net/api/reference/index.html#customer-profiles-create-customer-profile&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;from authorizenet import apicontractsv1
from authorizenet.apicontrollers import *
from livesettings import config_value
from decimal import *
import random


def create_customer_profile():
    merchantAuth = apicontractsv1.merchantAuthenticationType()
    merchantAuth.name = config_value('AUTHORIZENET','API_LOGIN')
    merchantAuth.transactionKey = config_value('AUTHORIZENET','TRANSACTION_KEY')

    createCustomerProfile = apicontractsv1.createCustomerProfileRequest()
    createCustomerProfile.merchantAuthentication = merchantAuth
    createCustomerProfile.profile = apicontractsv1.customerProfileType('jdoe' + str(random.randint(0, 10000)),
                                                                       'John2 Doe', 'jdoe@mail.com')

    controller = createCustomerProfileController(createCustomerProfile)
    controller.execute()

    response = controller.getresponse()

    if (response.messages.resultCode == "Ok"):
        print("Successfully created a customer profile with id: %s" % response.customerProfileId)
    else:
        print("Failed to create customer payment profile %s" % response.messages.message[0]['text'].text)

    return response


create_customer_profile()&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;but I get the exception included in the subject. The stack trace isn't isn't especially informative:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;Error Message: Traceback (most recent call last):
File "", line 1, in 
File "/var/www/myecoinsulation-com/myecoinsulation/customer_and_sales/authorize_pasta.py", line 40, in 
create_customer_profile()
File "/var/www/myecoinsulation-com/myecoinsulation/customer_and_sales/authorize_pasta.py", line 28, in create_customer_profile
controller.execute()
File "/var/www/myecoinsulation-com/venv-myecoinsulation/local/lib/python2.7/site-packages/authorizenet/apicontrollersbase.py", line 153, in execute
xmlResponse= self._response.toxml(encoding=constants.xml_encoding, element_name=self.getrequesttype())
File "/var/www/myecoinsulation-com/venv-myecoinsulation/local/lib/python2.7/site-packages/pyxb/binding/basis.py", line 555, in toxml
dom = self.toDOM(bds, element_name=element_name)
File "/var/www/myecoinsulation-com/venv-myecoinsulation/local/lib/python2.7/site-packages/pyxb/binding/basis.py", line 527, in toDOM
self._toDOM_csc(bds, element)
File "/var/www/myecoinsulation-com/venv-myecoinsulation/local/lib/python2.7/site-packages/pyxb/binding/basis.py", line 2661, in _toDOM_csc
order = self._validatedChildren()
File "/var/www/myecoinsulation-com/venv-myecoinsulation/local/lib/python2.7/site-packages/pyxb/binding/basis.py", line 2188, in _validatedChildren
return self.__automatonConfiguration.sequencedChildren()
File "/var/www/myecoinsulation-com/venv-myecoinsulation/local/lib/python2.7/site-packages/pyxb/binding/content.py", line 638, in sequencedChildren
cfg = self._diagnoseIncompleteContent(symbols, symbol_set)
File "/var/www/myecoinsulation-com/venv-myecoinsulation/local/lib/python2.7/site-packages/pyxb/binding/content.py", line 493, in _diagnoseIncompleteContent
raise pyxb.IncompleteElementContentError(self.__instance, cfg, symbols, symbol_set)
IncompleteElementContentError: (, , [], {})&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;What am I doing wrong?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 20:58:18 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/IncompleteElementContentError/m-p/57395#M32116</guid>
      <dc:creator>preston</dc:creator>
      <dc:date>2017-03-24T20:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: IncompleteElementContentError</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/IncompleteElementContentError/m-p/57438#M32156</link>
      <description>&lt;P&gt;I found the problem. I was using the live credentials on the test url (which the SDK defaults to). I feel like a different sort of error ought to be raised to make that clearer.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 15:25:46 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/IncompleteElementContentError/m-p/57438#M32156</guid>
      <dc:creator>preston</dc:creator>
      <dc:date>2017-03-28T15:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: IncompleteElementContentError</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/IncompleteElementContentError/m-p/57443#M32161</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/21441"&gt;@preston&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the feedback!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll raise this as an issue with the SDK team to see if we can make any improvements in this area.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 16:25:34 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/IncompleteElementContentError/m-p/57443#M32161</guid>
      <dc:creator>Aaron</dc:creator>
      <dc:date>2017-03-28T16:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: IncompleteElementContentError</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/IncompleteElementContentError/m-p/57966#M32647</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;i have this error, how i can fix this, in sandbox is working but with api and transaction key real happened this error&lt;/P&gt;&lt;P&gt;please i need help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;pd: i am using sdk python too&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2017 19:53:30 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/IncompleteElementContentError/m-p/57966#M32647</guid>
      <dc:creator>dkpapo123</dc:creator>
      <dc:date>2017-05-04T19:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: IncompleteElementContentError</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/IncompleteElementContentError/m-p/57967#M32648</link>
      <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/21663"&gt;@dkpapo123&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you switch to production credentials, are you also setting the environment?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Setting Production or Sandbox Environments&lt;/H3&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To set the environment use the setenvironment method on the controller before executing. E.g. for the example above:&lt;/P&gt;
&lt;DIV class="highlight highlight-source-python"&gt;
&lt;PRE&gt;&lt;SPAN class="pl-c"&gt;# Defaults to constants.SANDBOX for sandbox testing&lt;/SPAN&gt;
createtransactioncontroller.setenvironment(constants.&lt;SPAN class="pl-c1"&gt;PRODUCTION&lt;/SPAN&gt;)&lt;/PRE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 04 May 2017 21:19:31 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/IncompleteElementContentError/m-p/57967#M32648</guid>
      <dc:creator>RichardH</dc:creator>
      <dc:date>2017-05-04T21:19:31Z</dc:date>
    </item>
  </channel>
</rss>

