PHP SOAP - Silverpop API - Login

I can’t seem to perform the simple task of logging in using the SOAP to SilverPop API. Can someone PLEASE help me out.

This is my PHP code:

function loginRequest(){
        
    $client = new SoapClient('http://api5.silverpop.com/SoapApi?wsdl', array("trace"=> 1));
    
            
    $error = 0;
    
    try {
       $login = $client->Login(array('USERNAME'=>'xxxxx', 'PASSWORD'=>'xxxxxx'));      

    } catch (SoapFault $fault) {
         
            $error = 1;
            print('<pre>');
            echo "GENERAL EXCEPTION:<br />".$fault->faultcode."-".$fault->faultstring."\
<br />";
            
            echo "EXCEPTION:\
";
            print_r($fault);
            
            echo "REQUEST:\
";
            echo htmlentities($client->__getLastRequest());
            echo "<br />";
            
            echo "REQUEST HEADERS:\
";
            echo $client->__getLastRequestHeaders();
            
            
            echo "RESPONSE HEADERS:\
";
            echo $client->__getLastResponseHeaders();
            
            echo "RESPONSE:\
";
            echo htmlentities($client->__getLastResponse());
            
            print('</pre>');
        }
        
        if ($error == 0) {       
        
            $res = $client->RESULT;
            
            var_dump($res);
        }
        
    }

loginRequest();

This is my Request:
<?xml version=“1.0” encoding=“UTF-8”?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:ns1=“SilverpopApi:EngageService.SessionMgmt.Login”><SOAP-ENV:Body><ns1:Login><ns1:USERNAME>ajankowski@summitmediagroup.com</ns1:USERNAME><ns1:PASSWORD>aAlLbB!330</ns1:PASSWORD></ns1:Login></SOAP-ENV:Body></SOAP-ENV:Envelope>

This is my Response:
REQUEST HEADERS:
POST /SoapApi HTTP/1.1
Host: api5.silverpop.com
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.2.6-1+lenny10
Content-Type: text/xml; charset=utf-8
SOAPAction: “SilverpopApi:Engageservice.Login”
Content-Length: 348

RESPONSE HEADERS:
HTTP/1.1 500 Internal Server Error
Connection: close
Content-Length: 593
Content-Type: text/plain; charset=UTF-8
RESPONSE:

The documentation example:

<soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:sil=“SilverpopApi:EngageService.SessionMgmt.Login”>
<soapenv:Header/> <soapenv:Body>
<sil:Login> <sil:USERNAME>somebody@silverpop.com</sil:USERNAME> <sil:PASSWORD>password!</sil:PASSWORD>
</sil:Login>
</soapenv:Body>
</soapenv:Envelope>

Can someone please help me out. There has to be some easy way of doing this.

Similar Thread:
http://www.sitepoint.com/forums/showthread.php?680729-SOAP-Help

It turns out that the issue was on Silverpop. I contacted another developer that had the same issue and it turns out it was a problem on Silverpops end. I was using POD5 and they did not have that configured for SOAP. Thanks “ma201dq”!!!

I contacted support and they fixed the issue on there end. :slight_smile: