You need to sign in to do that
Don't have an account?
Mark Roberts
Is it possible to programmatically generate the WSDL?
Hello,
I'm trialling SaleForce for our company (specifically synching data via the API)... and in doing so am changing schema quite a bit.
At the moment, I'm having to manually log in and regenerate schema each time (and then have an automated process to convert this into C#)
I would like to automate the refresh of schema.... however, I cannot see how to authenicate programmatically to the page https://eu1.salesforce.com/soap/wsdl.jsp?type=*
I'm probably missing something obvious - can someone help?
Regards,
Mark.
Yes, this is possible. For the enterprise wsdl the endpoint is soap/wsdl.jsp?type=* and for partner it is simply soap/wsdl.jsp with no parameter. You can initiate an HTTP connection to that endpoint with a header value "Cookie: sid=xxxxxxx" and you'll get the result. Here's an example:
curl -v https://na12.salesforce.com/soap/wsdl.jsp -H "Cookie: sid=xxxx"
> GET /soap/wsdl.jsp HTTP/1.1
> User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3
> Host: na12.salesforce.com
> Accept: */*
> Cookie: sid=xxxx
>
< HTTP/1.1 200 OK
< Server:
< Cache-Control: private
< Content-Disposition: inline; filename="partner.wsdl"
< Content-Type: text/xml; charset=UTF-8
< Transfer-Encoding: chunked
< Date: Thu, 01 Mar 2012 17:47:59 GMT
<
<?xml version="1.0" encoding="UTF-8"?>
<!--
Salesforce.com Partner Web Services API Version 24.0
Generated on 2012-03-01 17:47:59 +0000.
Copyright 1999-2012 salesforce.com, inc.
All Rights Reserved
-->
<definitions targetNamespace="urn:partner.soap.sforce.com"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:fns="urn:fault.partner.soap.sforce.com"
xmlns:tns="urn:partner.soap.sforce.com"
xmlns:ens="urn:sobject.partner.soap.sforce.com">
<types>
<schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:sobject.partner.soap.sforce.com">
<import namespace="urn:partner.soap.sforce.com"/>
You can get your session ID with a SOAP login call, or from the OAuth 2.0. The OAuth "username and password flow" is appropriate for development.
Hi,
I too have the same requirement to generate the WSDL file porgramatically. Could you please elaborate your answer about this so that it can be useful to me.
Thanks,
Vinay