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
PleasePlease 

Return type of global method must also be global ...

Hi,

 

I get the following error: Return type of global method must also be global: MSAddressDirect2.GetAddress1_response op regel 2 kolom 62

 

 

does anybody know what todo i tried a few things but can't get it right!? 

 

global class TestCallOut2 {
     webservice static MSAddressDirect2.getAddress1_response getAddress1(String username, string password, string profileid, string postalcode, string housenumber, string countrycode) {
        MSAddressDirect2.AddressDirectServer2ServicePort stub = new MSAddressDirect2.AddressDirectServer2ServicePort();
        MSAddressDirect2.getAddress1_response adresje = stub.getAddress1(username, password, profileid, postalcode, housenumber, countrycode);
        return adresje;
    }
}

 

 

Apexclass (generated via WSDL):

//Generated by wsdl2apex

public class MSAddressDirect2 {
    public class getAddress1_element {
        public String username;
        public String password;
        public String profileid;
        public String postal_code;
        public String house_number;
        public String country_code;
        private String[] username_type_info = new String[]{'username','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] password_type_info = new String[]{'password','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] profileid_type_info = new String[]{'profileid','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] postal_code_type_info = new String[]{'postal_code','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] house_number_type_info = new String[]{'house_number','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] country_code_type_info = new String[]{'country_code','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'username','password','profileid','postal_code','house_number','country_code'};
    }
    public class AddressDirectServer2ServicePort {
        public String endpoint_x = 'http://xxx.xx.xx.xx/cgi-bin/jsmdirect?MSAddressDirect2';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://soapserver.jsm.marktselect.com', 'MSAddressDirect2'};
        public MSAddressDirect2.GetAddress1_response getAddress1(String username,String password,String profileid,String postal_code,String house_number,String country_code) {
            MSAddressDirect2.getAddress1_element request_x = new MSAddressDirect2.getAddress1_element();
            MSAddressDirect2.getAddress1Response_element response_x;
            request_x.username = username;
            request_x.password = password;
            request_x.profileid = profileid;
            request_x.postal_code = postal_code;
            request_x.house_number = house_number;
            request_x.country_code = country_code;
            Map<String, MSAddressDirect2.getAddress1Response_element> response_map_x = new Map<String, MSAddressDirect2.getAddress1Response_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'getAddress1',
              'http://soapserver.jsm.marktselect.com',
              'getAddress1',
              'http://soapserver.jsm.marktselect.com',
              'getAddress1Response',
              'MSAddressDirect2.getAddress1Response_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.getAddress1Return;
        }
    }
    public class GetAddress1_response {
        public String address_city;
        public String address_house_number;
        public String address_postalcode;
        public String address_street;
        public String resultCode;
        public String resultMessage;
        private String[] address_city_type_info = new String[]{'address_city','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_house_number_type_info = new String[]{'address_house_number','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_postalcode_type_info = new String[]{'address_postalcode','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_street_type_info = new String[]{'address_street','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] resultCode_type_info = new String[]{'resultCode','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] resultMessage_type_info = new String[]{'resultMessage','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'address_city','address_house_number','address_postalcode','address_street','resultCode','resultMessage'};
    }
    public class getAddress1Response_element {
        public MSAddressDirect2.GetAddress1_response getAddress1Return;
        private String[] getAddress1Return_type_info = new String[]{'getAddress1Return','http://soapserver.jsm.marktselect.com','GetAddress1_response','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'getAddress1Return'};
    }
}
Best Answer chosen by Admin (Salesforce Developers) 
HarmpieHarmpie
Did you try defining the imported classes as global as well?

All Answers

HarmpieHarmpie
Did you try defining the imported classes as global as well?
This was selected as the best answer
PleasePlease

Nee, dat niet, maar dat ga ik eens proberen dan...

 

in ieder geval bedankt voor je reactie

PleasePlease
Thanks ! That error is gone ! but now i have got a new one....."unable to pase response, apex type not found for element ...  "