0

Request envelope is:

{ uri: 'https://webservice.s4.exacttarget.com/Service.asmx',
  method: 'POST',
  headers: 
   { 'User-Agent': 'node-fuel/1.3.1',
     'Content-Type': 'text/xml',
     SOAPAction: 'Retrieve' },
  body: '
<Envelope
    xmlns="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\n  
    <Header>\n    
        <To>https://webservice.s4.exacttarget.com/Service.asmx</To>\n    
        <fueloauth
            xmlns="http://exacttarget.com">>>>here my access token<<<<
        </fueloauth>\n  
    </Header>\n  
    <Body>\n    
        <RetrieveRequestMsg
            xmlns="http://exacttarget.com/wsdl/partnerAPI">\n      
            <RetrieveRequest>\n        
                <ObjectType>Send</ObjectType>\n        
                <Properties>ID</Properties>\n        
                <Properties>Email.ID</Properties>\n        
                <Properties>EmailName</Properties>\n        
                <Properties>FromAddress</Properties>\n        
                <Properties>FromName</Properties>\n        
                <Properties>HardBounces</Properties>\n        
                <Properties>InvalidAddresses</Properties>\n        
                <Properties>NumberSent</Properties>\n        
                <Properties>SendDate</Properties>\n        
                <Properties>SendLimit</Properties>\n        
                <Properties>Subject</Properties>\n        
                <Properties>Status</Properties>\n        
                <Properties>UniqueClicks</Properties>\n        
                <Properties>UniqueOpens</Properties>\n        
                <Client>\n          
                    <ID>XXXXXX</ID>\n        
                </Client>\n        
                <Filter xsi:type="SimpleFilterPart">\n          
                    <Property>ID</Property>\n          
                    <SimpleOperator>equals</SimpleOperator>\n          
                    <Value>4XXXXX3</Value>\n        
                </Filter>\n      
            </RetrieveRequest>\n    
        </RetrieveRequestMsg>\n  
    </Body>\n
</Envelope>' }

Returned response from salesforce marketing cloud is:

{ Error: Login Failed
    at .<anonymous> (/home/ec2-user/sfmc/node_modules/fuel-soap/lib/fuel-soap.js:603:28)
    at Parser.<anonymous> (/home/ec2-user/sfmc/node_modules/fuel-soap/node_modules/xml2js/lib/xml2js.js:484:18)
    at emitOne (events.js:96:13)
    at Parser.emit (events.js:188:7)
    at Object.onclosetag (/home/ec2-user/sfmc/node_modules/fuel-soap/node_modules/xml2js/lib/xml2js.js:445:26)
    at emit (/home/ec2-user/sfmc/node_modules/fuel-soap/node_modules/xml2js/node_modules/sax/lib/sax.js:640:35)
    at emitNode (/home/ec2-user/sfmc/node_modules/fuel-soap/node_modules/xml2js/node_modules/sax/lib/sax.js:645:5)
    at closeTag (/home/ec2-user/sfmc/node_modules/fuel-soap/node_modules/xml2js/node_modules/sax/lib/sax.js:905:7)
    at Object.write (/home/ec2-user/sfmc/node_modules/fuel-soap/node_modules/xml2js/node_modules/sax/lib/sax.js:1449:13)
    at Parser.exports.Parser.Parser.parseString (/home/ec2-user/sfmc/node_modules/fuel-soap/node_modules/xml2js/lib/xml2js.js:503:31)
    at Parser.parseString (/home/ec2-user/sfmc/node_modules/fuel-soap/node_modules/xml2js/lib/xml2js.js:7:59)
    at exports.parseString (/home/ec2-user/sfmc/node_modules/fuel-soap/node_modules/xml2js/lib/xml2js.js:535:19)
    at FuelSoap._parseResponse (/home/ec2-user/sfmc/node_modules/fuel-soap/lib/fuel-soap.js:590:2)
    at .<anonymous> (/home/ec2-user/sfmc/node_modules/fuel-soap/lib/fuel-soap.js:99:9)
    at Request.self.callback (/home/ec2-user/sfmc/node_modules/fuel-soap/node_modules/request/request.js:199:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/home/ec2-user/sfmc/node_modules/fuel-soap/node_modules/request/request.js:1036:10)
    at emitOne (events.js:101:20)
    at Request.emit (events.js:188:7)
    at IncomingMessage.<anonymous> (/home/ec2-user/sfmc/node_modules/fuel-soap/node_modules/request/request.js:963:12)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:926:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickDomainCallback (internal/process/next_tick.js:122:9)
  faultstring: 'Login Failed',
  faultCode: 'q0:Security',
  errorPropagatedFrom: 'SOAP Fault' }

What did I do wrong? What was the cause of this error and how can I resolve it?

0

My guess is that you are using the wrong endpoint. Stack 4 is typically reserved for Salesforce Learning accounts (not customers). Check the URL that is used when you authenticate into your account from a web browser to confirm what stack you are on, then refer to endpoint links.

If you need to get the appropriate endpoint programatically (e.g. you are building an app) then you can do so using the endpoint REST API method.

  • When I ran it the second time with same credentials it executed successfully and fetched appropriate results. Still, I am not able to find the actual cause of this. Why was it throw the error? – Krishan Kant Sharma Jun 24 '18 at 11:59
  • It could have been due to an API availability issue at that time. Can you confirm that you no longer experience this error? Or is it still intermittent? – Eliot Harper Jun 25 '18 at 2:09

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.