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
Sridhar VenkateswaraluSridhar Venkateswaralu 

Generate WSDL out of a REST Service

Hi All,

 

I have an Apex class which is exposed to the External system as a REST Service with all the different annotations for GET, Post and other methods. Is there any option where i can generate a WSDL file of the Rest Service similar to how we can do it for Soap service built in Apex.

 

waiting for your quick response.

 

Thanks,

*werewolf**werewolf*

There's not presently an accepted formal language to describe REST services as there is for SOAP.  Although some have proposed using WSDL 2.0 to describe REST services, I've never heard of anyone actually doing it.  There's also a language called WADL for REST which nobody uses either.

 

In a nutshell: no.  If you want a WSDL, make a SOAP service.

Sridhar VenkateswaraluSridhar Venkateswaralu

i tried to generate an APEX Class out of a wsdl containing HTTP Binding, i am receiving an exception saying as below:

 

WSDL Used: 

 

<?xml version='1.0' encoding='utf-8'?>
<wsdl:definitions xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tm='http://microsoft.com/wsdl/mime/textMatching/' xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:mime='http://schemas.xmlsoap.org/wsdl/mime/' xmlns:tns='http://www.webserviceX.NET/' xmlns:s='http://www.w3.org/2001/XMLSchema' xmlns:http='http://schemas.xmlsoap.org/wsdl/http/' targetNamespace='http://www.webserviceX.NET/' xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'>
<wsdl:types>
<s:schema elementFormDefault='qualified' targetNamespace='http://www.webserviceX.NET/'>
<s:element name='GetQuote'>
<s:complexType>
<s:sequence>
<s:element minOccurs='0' maxOccurs='1' name='symbol' type='s:string'/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name='GetQuoteResponse'>
<s:complexType>
<s:sequence>
<s:element minOccurs='0' maxOccurs='1' name='GetQuoteResult' type='s:string'/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name='string' nillable='true' type='s:string'/>
</s:schema>
</wsdl:types>
<wsdl:message name='GetQuoteHttpPostIn'>
<wsdl:part name='symbol' type='s:string'/>
</wsdl:message>
<wsdl:message name='GetQuoteHttpPostOut'>
<wsdl:part name='Body' element='tns:string'/>
</wsdl:message>
<wsdl:portType name='StockQuoteHttpPost'>
<wsdl:operation name='GetQuote'>
<wsdl:documentation xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'>
Get Stock quote for a company Symbol
</wsdl:documentation>
<wsdl:input message='tns:GetQuoteHttpPostIn'/>
<wsdl:output message='tns:GetQuoteHttpPostOut'/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name='StockQuoteHttpPost' type='tns:StockQuoteHttpPost'>
<http:binding verb='POST'/>
<wsdl:operation name='GetQuote'>
<http:operation location='/GetQuote'/>
<wsdl:input>
<mime:content type='application/x-www-form-urlencoded'/>
</wsdl:input>
<wsdl:output>
<mime:mimeXml part='Body'/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name='StockQuote'>
<wsdl:port name='StockQuoteHttpPost' binding='tns:StockQuoteHttpPost'>
<http:address location='http://www.webservicex.net/stockquote.asmx'/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

 

"Apex Generation Failed

Unable to find soap 1.1 address"

 

any idea on this?