How to do a SOAP wsdl web services call from the command line

后端 未结 8 539
失恋的感觉
失恋的感觉 2020-11-30 17:40

I need to make a SOAP webservice call to https://sandbox.mediamind.com/Eyeblaster.MediaMind.API/V2/AuthenticationService.svc?wsdl and to use the operation ClientLogin while

相关标签:
8条回答
  • 2020-11-30 18:08

    For Windows users looking for a PowerShell alternative, here it is (using POST). I've split it up onto multiple lines for readability.

    $url = 'https://sandbox.mediamind.com/Eyeblaster.MediaMind.API/V2/AuthenticationService.svc'
    $headers = @{
        'Content-Type' = 'text/xml';
        'SOAPAction' = 'http://api.eyeblaster.com/IAuthenticationService/ClientLogin'
    }
    $envelope = @'
        <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
            <Body>
                <yourEnvelopeContentsHere/>
            </Body>
        </Envelope>
    '@     # <--- This line must not be indented
    
    Invoke-WebRequest -Uri $url -Headers $headers -Method POST -Body $envelope
    
    0 讨论(0)
  • 2020-11-30 18:10

    For Windows:

    Save the following as MSFT.vbs:

    set SOAPClient = createobject("MSSOAP.SOAPClient")
    SOAPClient.mssoapinit "https://sandbox.mediamind.com/Eyeblaster.MediaMind.API/V2/AuthenticationService.svc?wsdl"
    WScript.Echo "MSFT = " & SOAPClient.GetQuote("MSFT")
    

    Then from a command prompt, run:

    C:\>MSFT.vbs
    

    Reference: http://blogs.msdn.com/b/bgroth/archive/2004/10/21/246155.aspx

    0 讨论(0)
提交回复
热议问题