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
karthik karthikkarthik karthik 

How to display Attributes in WSDL.

Hi,

I want to return two diffenrent datatypes from custom wsdl, for that I have created a Wrapper class inside the custom wsdl and return two different datatypes. Below is my code.

Global class GetOpportunityId
{
 Global class Response{    
        Global String Message;
        Global Boolean Status;
   }  
  WebService static Response getOppFromVC(Opportunity OppParam,Account AccParam)
    {
    Response Res = New Response();   
    -------
    my Apex code here            
    ---------
    --------
    Res.Message = 'Upated Successfully';
    Res.status = True;
    return Res;
     }    
}


My wsdl:

<xsd:complexType name="Response">
<xsd:sequence/>
</xsd:complexType>

In the above XML the attributes like Message and Status are missing. How to get those attributes. Please it's some urgent.

Thanks in advance.
Best Answer chosen by karthik karthik
VinodKRVinodKR
Hi Karthik,

Declare the Data type like the below,It works tested.

WebService String Message;
WebService Boolean Status;

Thanks,

Have a great day ahead,Let the Force be with you!
Please mark this as best answer if it helps you.

All Answers

VinodKRVinodKR
Hi Karthik,

Declare the Data type like the below,It works tested.

WebService String Message;
WebService Boolean Status;

Thanks,

Have a great day ahead,Let the Force be with you!
Please mark this as best answer if it helps you.
This was selected as the best answer
karthik karthikkarthik karthik
It's working.... Thank You So Much Vinod :)