2

Any ideas why the following SOAP request is throwing the error "Object reference not set to an instance of an object." ? I'm following the documentation almost exactly: http://help.exacttarget.com/en/technical_library/web_service_guide/technical_articles/retrieving_subscribers_using_listid/

SOAP Request:

<Body>
    <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
        <RetrieveRequest>
            <ObjectType>SubscriberList</ObjectType>
            <Client><ID>6210023</ID></Client>
            <properties>Client.ID</properties>
            <properties>List.ID</properties>
            <properties>List.ListName</properties>
            <properties>Subscriber.Status</properties>
            <properties>Subscriber.CreatedDate</properties>
            <properties>Subscriber.ID</properties>
            <properties>Subscriber.SubscriberKey</properties>
            <properties>Subscriber.EmailAddress</properties>
            <filter xsi:type="par:ComplexFilterPart" xmlns:par="http://exacttarget.com/wsdl/partnerAPI">
                <leftoperand xsi:type="par:SimpleFilterPart">
                    <property>List.ID</property>
                    <simpleoperator>equals</simpleoperator>
                    <value>4207</value>
                    </leftoperand>
                    <LogicalOperator>AND</LogicalOperator>
                    <rightoperand xsi:type="par:SimpleFilterPart">
                    <property>Subscriber.SubscriberKey</property>
                    <simpleoperator>equals</simpleoperator>
                    <value>[email protected]</value>
                    </rightoperand>
                </filter>
        </RetrieveRequest>
    </RetrieveRequestMsg>
</Body>

SOAP Response:

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
   <soap:Header>
      <wsa:Action>RetrieveResponse</wsa:Action>
      <wsa:MessageID>urn:uuid:e547cea2-0d14-4c9a-8dad-c83e0e642f31</wsa:MessageID>
      <wsa:RelatesTo>urn:uuid:b01c9b5c-050d-4919-9da2-253af76a3fca</wsa:RelatesTo>
      <wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
      <wsse:Security>
         <wsu:Timestamp wsu:Id="Timestamp-7a932e46-f212-441f-af4f-ef731b83d94b">
            <wsu:Created>2015-03-26T03:59:27Z</wsu:Created>
            <wsu:Expires>2015-03-26T04:04:27Z</wsu:Expires>
         </wsu:Timestamp>
      </wsse:Security>
   </soap:Header>
   <soap:Body>
      <RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <OverallStatus>Error: Object reference not set to an instance of an object.</OverallStatus>
         <RequestID>7fd3e98b-6864-4855-9362-a34dbfd3f3a2</RequestID>
      </RetrieveResponseMsg>
   </soap:Body>
</soap:Envelope>

Thank you for taking a look.

2
  • Does their example code work for you (with the correct List.Id)? If it does, you could gradually change it bit by bit towards your current request until you find the element that is causing the issue. I think the Sample SOAP Envelope has some issues with quote character encoding appearing as &quot; Mar 26, 2015 at 8:02
  • Using the example code with correct List.ID, I am met with simply an error with no description in the response XML. Using the above code, when I remove everything between the <RetrieveRequest> tags I receive an error: "Error: No ObjectType is specified for a retrieve request" - obvious. When I add only the <ObjectType> tag back, I again see the error: "Error: Object reference not set to an instance of an object." - Is there something additional that needs to accompany the ObjectType?
    – Daniel
    Mar 26, 2015 at 17:42

1 Answer 1

2

If you are trying to retrieve based on the ListID, I would suggest you use "List.ID" in the first SimpleOperator. And I would recommend using capital letters to start off each of your tags similar to the below. Ran the code you gave in my SOAPUI and saw the same error but then capitalized the properties, etc and it worked.

<soap:Body> 
<RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI"> 
<RetrieveRequest> 
<ObjectType>SubscriberList</ObjectType> 
<Client><ID>6210023</ID></Client>
<Properties>ID</Properties>
<Properties>PartnerKey</Properties>
<Properties>CreatedDate</Properties>
<Properties>Client.ID</Properties>
<Properties>Status</Properties>
<Properties>List.ID</Properties>
<Properties>List.ListName</Properties>
<Properties>Subscriber.Status</Properties>
<Properties>Subscriber.CreatedDate</Properties>
<Properties>Subscriber.ID</Properties>
<Properties>Subscriber.EmailAddress</Properties>
<Properties>Subscriber.SubscriberKey</Properties>
<Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:type="ComplexFilterPart"> 
<LeftOperand xsi:type="SimpleFilterPart"> 
<Property>List.ID</Property> 
<SimpleOperator>equals</SimpleOperator> 
<Value>4207</Value> 
</LeftOperand> 
<LogicalOperator>AND</LogicalOperator> 
<RightOperand xsi:type="SimpleFilterPart"> 
<Property>Subscriber.EmailAddress</Property> 
<SimpleOperator>equals</SimpleOperator> 
<Value>[email protected]</Value> 
</RightOperand> 
</Filter> 
</RetrieveRequest> 
</RetrieveRequestMsg> 
</soap:Body>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .