+ Start a Discussion

wsdl file genaration gives error?

hi,i wrote a class like this 

global class SoapApiAccountContact {   
    webService static List<Contact> sayContact() {
    List<contact> con=[select Id,LastName from contact where Account.Name='tvarana'];
    return con;

for genarating wsdl file for this class i am getting this error

Apex Generation Failed
Unable to find complexType for {http://soap.sforce.com/schemas/class/SoapApiAccountContact}address

any one please help me how to create a client class to pass list of contacts to server

Surya KiranSurya Kiran

Change the class version to below 30. It may help.
Shri RajShri Raj
I have copied you code and pasted in my org. Its working fine. Give a try again with a new class name . It should work
i changed version also but it is not genareting.same error it is giving.

but i achieved in another way
global class SoapAccountContact {

    global class SoapContact {

        webservice String lastName;

    webService static List<SoapContact> searchByAccount(String name) {

        List<SoapContact> c= new List<SoapContact>();

        list<contact> con = [select LastNAme from contact where Account.Name=:name];

        for (Integer i=0;i<con.size();i++) {
            SoapContact p = new SoapContact();
            p.lastName = con[i].LastName;
        System.debug('Returning people: '+c);

        return c;


thanks for your reply