function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jhilgemanjhilgeman 

Downloading the WSDL Programmatically

I have a bit of code that uses the username/password/security token combo to log into the API using the PHP Toolkit, and it works fine. What I'd like to do is download the WSDL using this session. My code looks like:

 

require_once("includes/sfconnect.inc.php");

$sfsid = $sf->getSessionId();
$location = $sf->getLocation();
$tmp = parse_url($location);
$newURL = "https://".$tmp["host"]."/secur/frontdoor.jsp?sid=".$sfsid."&retURL="/soap/wsdl.jsp?type=*";

 

print $newURL;
print "<br><pre>" . htmlspecialchars(file_get_contents($newURL)) . "</pre><br>\n";

As a result, I get this:

 

https://na6-api.salesforce.com/secur/frontdoor.jsp?sid=00D....etc etc etc....BBY&retURL=../soap/wsdl.jsp?type=*

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<script src="/static/041509/js/ClientHash.js" type="text/javascript"></script><script type="text/javascript">ClientHash.prototype.needsClientHash('sid_Client', '0000... some stuff omitted...00KeyB', 'my ip address here', '/servlet/servlet.ClientHashValidator?ResponseRequestedURL=%2Fsecur%2Ffrontdoor.jsp%3Fsid%3D00 .... the long session ID again ... rwziBBY%26retURL%3D..%2Fsoap%2Fwsdl.jsp%3Ftype%3D*');
</script><script type='text/javascript'>
if (window.location.replace){
window.location.replace('..\/soap\/wsdl.jsp?type=*');
} else {;
window.location.href ='..\/soap\/wsdl.jsp?type=*';
}
</script>
</head>
<body>
<noscript>
You do not have Javascript enabled. Javascript is required to use salesforce.com. Please enable Javascript, then click <a href="../soap/wsdl.jsp?type=*">here</a> to continue.
</noscript>
</body>
</html>

 

Anyone know how to fix this? All I want to do is download the Enterprise WSDL every once in a while (so when someone adds a field, the server can can auto-download the updated WSDL)

JPClark3JPClark3

"You do not have Javascript enabled" -

Did you find an answer to this issue? I'm trying to do something different, but getting this reply also.