0

I new to webservices and practices interacting with SFMC with SOAP calls. I am attempting to create a data extension, but keep getting a 400 error. I am using SOAP UI to make the calls.

Here is my XML envelope:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Header>
         <fueloauth xmlns="http://exacttarget.com">ACCESS TOKEN</fueloauth>
   </soapenv:Header>
<soapenv:Body>
      <CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <Options/>
         <Objects xsi:type="DataExtension">
            <PartnerKey xsi:nil="true"/>
            <ObjectID xsi:nil="true"/>
            <Name>Sam_DE</Name>
            <IsSendable>false</IsSendable>
            <Fields>
               <Field>
                  <Name>EmailAddress</Name>
                  <FieldType>EmailAddress</FieldType>
                  <IsPrimaryKey>true</IsPrimaryKey>
                  <IsRequired>true</IsRequired>
               </Field>
               <Field>
                  <Name>SubscriberKey</Name>
                  <FieldType>Text</FieldType>
                  <IsRequired>false</IsRequired>
               </Field>
               <Field>
                  <Name>Date</Name>
                  <FieldType>Date</FieldType>
                  <DefaultValue>getdate()</DefaultValue>
                  <IsRequired>true</IsRequired>
               </Field>
               <Field>
                  <Name>Average_Order_Value</Name>
                  <FieldType>Decimal</FieldType>
                  <IsRequired>true</IsRequired>
                  <Precision>10</Precision>
                  <Scale>2</Scale>
               </Field>
               <Field>
                  <Name>Is_Proofing_Customer?</Name>
                  <FieldType>Boolean</FieldType>
                  <DefaultValue>true</DefaultValue>
                  <IsRequired>true</IsRequired>
               </Field>
               <Field>
                  <Name>Number_of_Clusters</Name>
                  <FieldType>Number</FieldType>
                  <IsRequired>false</IsRequired>
               </Field>
               <Field>
                  <Name>Telephone</Name>
                  <FieldType>Phone</FieldType>
                  <IsRequired>false</IsRequired>
               </Field>
               <Field>
                  <Name>Locale</Name>
                  <FieldType>Locale</FieldType>
                  <IsRequired>false</IsRequired>
               </Field>
            </Fields>
            <CustomerKey>SamDE01</CustomerKey>
         </Objects>
      </CreateRequest>
   </soapenv:Body>

I will appreciate help with debugging this.

1

You can't include a ? character in a DE field name.

If you change <Name>Is_Proofing_Customer?</Name> to <Name>Is_Proofing_Customer</Name> then your request will work successfully.

I have modified your request payload and the following request works for me in SoapUI. Note, replace webservice.s7.exacttarget.com/Service.asmx with the endpoint to your Marketing Cloud Instance and add your accessToken retrieved from the Authentication Service.

<?xml version="1.0" encoding="UTF-8"?>
 <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
  <s:Header>
     <a:Action s:mustUnderstand="1">Create</a:Action>
     <a:MessageID>urn:uuid:7e0cca04-57bd-4481-864c-6ea8039d2ea0</a:MessageID>
     <a:ReplyTo>
        <a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address>
     </a:ReplyTo>
     <a:To s:mustUnderstand="1">https://webservice.s7.exacttarget.com/Service.asmx</a:To>
     <fueloauth xmlns="http://exacttarget.com">accesstoken</fueloauth>
  </s:Header>
 <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
     <CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
        <Options/>
        <Objects xsi:type="DataExtension">
           <PartnerKey xsi:nil="true"/>
           <ObjectID xsi:nil="true"/>
           <Name>Sam_DE</Name>
           <IsSendable>false</IsSendable>
           <Fields>
              <Field>
                 <Name>EmailAddress</Name>
                 <FieldType>EmailAddress</FieldType>
                 <IsPrimaryKey>true</IsPrimaryKey>
                 <IsRequired>true</IsRequired>
              </Field>
              <Field>
                 <Name>SubscriberKey</Name>
                 <FieldType>Text</FieldType>
                 <IsRequired>false</IsRequired>
              </Field>
              <Field>
                 <Name>Date</Name>
                 <FieldType>Date</FieldType>
                 <DefaultValue>getdate()</DefaultValue>
                 <IsRequired>true</IsRequired>
              </Field>
              <Field>
                 <Name>Average_Order_Value</Name>
                 <FieldType>Decimal</FieldType>
                 <IsRequired>true</IsRequired>
                 <Precision>10</Precision>
                 <Scale>2</Scale>
              </Field>
              <Field>
                 <Name>Is_Proofing_Customer</Name>
                 <FieldType>Boolean</FieldType>
                 <DefaultValue>true</DefaultValue>
                 <IsRequired>true</IsRequired>
              </Field>
              <Field>
                 <Name>Number_of_Clusters</Name>
                 <FieldType>Number</FieldType>
                 <IsRequired>false</IsRequired>
              </Field>
              <Field>
                 <Name>Telephone</Name>
                 <FieldType>Phone</FieldType>
                 <IsRequired>false</IsRequired>
              </Field>
              <Field>
                 <Name>Locale</Name>
                 <FieldType>Locale</FieldType>
                 <IsRequired>false</IsRequired>
              </Field>
           </Fields>
           <CustomerKey>SamDE01</CustomerKey>
        </Objects>
     </CreateRequest>
 </s:Body>
</s:Envelope>
  • Thanks for having a look at this. I have removed the '?' but still get a bad request. – Samuel Dare Mar 5 '17 at 22:07
  • Hmm, I also get a bad request when using SoapUI. I have modified the request payload and updated my answer. Please try again. – Eliot Harper Mar 5 '17 at 23:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.