SOAP call to customermanagement service works in node + soap but not in Postman. Any hints about common mistakes?

Alex Contreras 6 Reputation points
2021-10-22T19:05:25.59+00:00

I'm using node and the soap package. The code works and fetches the account info I need. This is legacy code which I'm trying to reverse engineer. When I call the soap packages' client.lastRequest, console.log('last request: ', client.lastRequest) I see the SOAP call that was made:

<?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope
        xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
        xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract"
        xmlns:tns="https://bingads.microsoft.com/Customer/v13"
        xmlns:q1="https://adapi.microsoft.com"
        xmlns:q2="https://adapi.microsoft.com"
        xmlns:q3="https://adapi.microsoft.com"
        xmlns:q4="https://adapi.microsoft.com"
        xmlns:q5="https://adapi.microsoft.com"
        xmlns:q6="https://adapi.microsoft.com"
        xmlns:q7="https://adapi.microsoft.com"
        xmlns:q8="https://adapi.microsoft.com"
        xmlns:q9="https://adapi.microsoft.com"
        xmlns:q10="https://adapi.microsoft.com"
        xmlns:q11="https://adapi.microsoft.com"
        xmlns:q12="https://adapi.microsoft.com"
        xmlns:q13="https://adapi.microsoft.com"
        xmlns:q14="https://adapi.microsoft.com"
        xmlns:q15="https://adapi.microsoft.com"
        xmlns:q16="https://adapi.microsoft.com"
        xmlns:q17="https://adapi.microsoft.com"
        xmlns:q18="https://adapi.microsoft.com"
        xmlns:q19="https://adapi.microsoft.com"
        xmlns:q20="https://adapi.microsoft.com"
        xmlns:q21="https://adapi.microsoft.com"
        xmlns:q22="https://adapi.microsoft.com"
        xmlns:q23="https://adapi.microsoft.com"
        xmlns:q24="https://adapi.microsoft.com"
        xmlns:q25="https://adapi.microsoft.com"
        xmlns:q26="https://adapi.microsoft.com"
        xmlns:q27="https://adapi.microsoft.com"
        xmlns:q28="https://adapi.microsoft.com"
        xmlns:q29="https://adapi.microsoft.com"
        xmlns:q30="https://adapi.microsoft.com"
        xmlns:q31="https://adapi.microsoft.com"
        xmlns:q32="https://adapi.microsoft.com"
        xmlns:q33="https://adapi.microsoft.com"
        xmlns:q34="https://adapi.microsoft.com"
        xmlns:q35="https://adapi.microsoft.com"
        xmlns:q36="https://adapi.microsoft.com"
        xmlns:q37="https://adapi.microsoft.com">
        <soap:Header>
            <tns:Action>GetAccountsInfo</tns:Action>
            <tns:ApplicationToken>actual_token</tns:ApplicationToken>
            <tns:AuthenticationToken>actual_token</tns:AuthenticationToken>
            <tns:DeveloperToken>actual_token</tns:DeveloperToken>
        </soap:Header>
        <soap:Body>
            <GetAccountsInfoRequest
                xmlns="https://bingads.microsoft.com/Customer/v13" xsi:nil="true">
            </GetAccountsInfoRequest>
        </soap:Body>
    </soap:Envelope>

I also output the URL:

https://clientcenter.api.bingads.microsoft.com/Api/CustomerManagement/V13/CustomerManagementService.svc?wsdl

When I copy these into Postman/Insomia/other API clients I get a 200 OK response BUT not the data I need. The returned XML is 1000s of lines of what looks like the API (Microsoft/Bing Ads API for their customer management service) definition.

I assume it's telling me that the request is wrong, so here, take a guide. But I don't know where to begin looking.

Anything I should look out for when translating Nodes' soap package -> a SOAP call within Postman?

Microsoft Advertising API
Microsoft Advertising API
A Microsoft API that provides programmatic access to Microsoft Advertising to manage large campaigns or to integrate your marketing with other in-house systems.
416 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Eric Urban - MSFT 626 Reputation points Microsoft Employee
    2021-10-24T14:15:16.05+00:00

    Please see GetAccountsInfo for an example SOAP request. Does this help?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.