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
priyankasingla3101.3916265522429534E12priyankasingla3101.3916265522429534E12 

adding description for the custom operations in Apex code

Hi,

From last few days, I am working on Apex code to generate custom WSDL which includes custom operations. I want to have <documentation> for each custom operation in my custom WSDL, so that the one who is consuming that WSDL comes to know what these operations do. Salesforce Enterprise WSDL does contain <documentation> for each operation, and I want to do the same for custom WSDL.

I tries adding @Desciption annotation in my Apex code to see if it comes as <documentation> in WSDL for that particular operation,  but it didn't work.
Please help me out how to do that.

Thanks in advance
Ashish_SFDCAshish_SFDC
Hi Priyanka, 


Did you add the comments in the WSDL Class, are they are not being passed in the Genarated WSDL file which upon Parsed will be included in XML format with the comments?


Regards,
Ashish
priyankasingla3101.3916265522429534E12priyankasingla3101.3916265522429534E12
Yes I tried adding comments in the Apex class, but those are not visible in the generated WSDL.
Ashish_SFDCAshish_SFDC
Hi Priyanka, 


When a SF generated WSDL is consumed by a 3rd party app - that WSDL is converted to the 3rd Party class - say for example c#. 

So, the consumed WSDL cannot convert the WSDL to c# code with comments or details in it. 

As a best practice - we along with the WSDL file also give the documentation file which has the details. 


Regards,
Ashish


priyankasingla3101.3916265522429534E12priyankasingla3101.3916265522429534E12
So you mean to say that there would be problems while converting that custom WSDL (that contains description for operations) to c#?
But, the enterprise WSDL does contain the description for all operations, and I don't see any problems while consuming that WSDL.

And if I want to generate a documentation file for the details of the operations, do I need to do it manually, or is there some other way of doing that?