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
Sparky JaneSparky Jane 

How to parse WSDL from the code that was developed?

Hi,
    The code that I've written is stated below:

global class MyWebService{
    webService static Id makeContact(String lastname, Account a){
        Contact c = new Contact(lastname = 'Sai Teja', AccountId = a.Id);
        insert c;
        return c.id; 
    }
}

-> I have generated WSDL for the above code.
-> I have saved the WSDL code as "web.wsdl"
-> And next I have clicked "Generate from WSDL" and I choose the file "web.wsdl"
-> Step-1: I have parsed the apex code from wsdl
-> Step-2: I have clicked on generate apex code
   
          "There an errror raised like this:

User-added image 
Can Some one please help me out?
James LoghryJames Loghry
Looks like it could be a Salesforce issue with generating the wsdl.  A few things you could try are:
  1. Updating your API version of your Apex class (or try reverting to say, version 18) to see if it will allow you to general the wsdl.  You can always set it back to the current API version after the wsdl is generated.
  2. Changing your method to accept an Id for the account, rather than the whole account record.  This is proably the better approach, especially if you're only using it to set the AccountId on a new contact.