• Sandeep Kumar Gaddam
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
Hello All

I have used an wesdl to generate apex classe inside salesforce and when i am trying to call it from excute anonymous window in developer console i am getting an error.

here is the class generated :

//Generated by wsdl2apex

public class AsyncVerisysComBr {
    public class RegisterActivationResponse_elementFuture extends System.WebServiceCalloutFuture {
        public verisysComBr.dtoRegistro getValue() {
            verisysComBr.RegisterActivationResponse_element response = (verisysComBr.RegisterActivationResponse_element)System.WebServiceCallout.endInvoke(this);
            return response.RegisterActivationResult;
        }
    }
    public class AsyncWebService1Soap {
        public String endpoint_x = 'http://181.192.160.53/wsIntegracaoDiscador/sandeepIntegrationWS.asmx';
        public Map<String,String> inputHttpHeaders_x;
        public String clientCertName_x;
        public Integer timeout_x;
        public verisysComBr.ValidationSoapHeader ValidationSoapHeader;
        private String ValidationSoapHeader_hns = 'ValidationSoapHeader=http://verisys.com.br/';
        private String[] ns_map_type_info = new String[]{'http://verisys.com.br/', 'verisysComBr'};
        public AsyncVerisysComBr.RegisterActivationResponse_elementFuture beginRegisterActivation(System.Continuation continuation,String ID) {
            verisysComBr.RegisterActivation_element request_x = new verisysComBr.RegisterActivation_element();
            request_x.ID = ID;
            return (AsyncVerisysComBr.RegisterActivationResponse_elementFuture) System.WebServiceCallout.beginInvoke(
              this,
              request_x,
              AsyncVerisysComBr.RegisterActivationResponse_elementFuture.class,
              continuation,
              new String[]{endpoint_x,
              'http://verisys.com.br/RegisterActivation',
              'http://verisys.com.br/',
              'RegisterActivation',
              'http://verisys.com.br/',
              'RegisterActivationResponse',
              'verisysComBr.RegisterActivationResponse_element'}
            );
        }
    }
}

i am trying to exectue using this below code 

AsyncVerisysComBr.RegisterActivationResponse_elementFuture ex1;
AsyncVerisysComBr.AsyncWebService1Soap ex2 = New AsyncVerisysComBr.AsyncWebService1Soap();
ex1 = ex2.beginRegisterActivation(60, '00vJ000000H6Nix');


Error i am getting is 

Line: 3, Column: 7
Method does not exist or incorrect signature: [AsyncVerisysComBr.AsyncWebService1Soap].beginRegisterActivation(Integer, String)

can some one help me how to call this class 

Thanks in Advance 
Hello All,

I am new to integrations i have craeted a web service inside salesforce for creating an activity. i want to insert an activity into salesforce with some fields value as blank some times . how can i do that . 

 webservice static ServiceResponse CreateContactOrLeadActivityOutBoundCalls (string RecordID,
                                                                                string Comentarios,
                                                                                string grava,
                                                                                
                                                                                string CampanhaRecordID,
                                                                                string Status,
                                                                                string DDD,
                                                                                string DDI,
                                                                                Integer CallDurationInSeconds,
                                                                                Boolean FidelizadoParaAgent,
                                                                                Datetime Reagendamento,
                                                                                Datetime StartCallTime,
                                                                                Datetime EndCallTime){ 
        ServiceResponse response = new ServiceResponse();
        try{
            Id devRecordTypeId = Schema.SObjectType.Task.getRecordTypeInfosByName().get('Servicecloud').getRecordTypeId();// Sample RecordType on Task with Name Asia.
            string CurrentObject;
            if(RecordID.startsWith('003')){
                CurrentObject = 'Contact';
            }
            else if(RecordID.startsWith('00Q')){
                CurrentObject = 'Lead';
            }
            else{
                CurrentObject = '';
            }
            if(null != CurrentObject && '' != CurrentObject){
                if(null != Status && '' != Status){
                    if(CurrentObject == 'Contact'){
                        Contact contactRecord = [select Id, AccountID,FirstName,LastName from Contact where Id =:RecordID];
                        Campaign  CampanhaRecord = [select Id,Name, Status from Campaign  where Id =:CampanhaRecordID];
                        if(null != contactRecord){                      
                            Task task = new Task(ActivityDate = Date.today(),
                                                    Subject='Call',
                                                    Tipo__c = 'Outbound Call',
                                                    C_digo_do_Agente__c = AgentCode,
                                                  
                                               
                                                    WhatId = CampanhaRecord.ID,
                                                    WhoId = contactRecord.ID,
                                                    
                                                    OwnerId = getUserIDFromAgentCode(AgentCode) != '' ? getUserIDFromAgentCode(AgentCode) : UserInfo.getUserId(),
                                                    Status = Status,
                                                    RecordTypeID = devRecordTypeId,
                                                    CV_StartCallTime__c =StartCallTime,
                                                    CV_EndCallTime__c = EndCallTime,
                                                    CallDurationInSeconds =  CallDurationInSeconds,
                                                    CV_ScheduleDate__c = Reagendamento,
                                                    Fidelizado_Para_Agent__c  = FidelizadoParaAgent);
                            insert task;


in the above code i only want (WhoID and WHATID) as required and all other filed can be blank while inserting.

Please help me 

Thanks in Advance 
Hello All

I have used an wesdl to generate apex classe inside salesforce and when i am trying to call it from excute anonymous window in developer console i am getting an error.

here is the class generated :

//Generated by wsdl2apex

public class AsyncVerisysComBr {
    public class RegisterActivationResponse_elementFuture extends System.WebServiceCalloutFuture {
        public verisysComBr.dtoRegistro getValue() {
            verisysComBr.RegisterActivationResponse_element response = (verisysComBr.RegisterActivationResponse_element)System.WebServiceCallout.endInvoke(this);
            return response.RegisterActivationResult;
        }
    }
    public class AsyncWebService1Soap {
        public String endpoint_x = 'http://181.192.160.53/wsIntegracaoDiscador/sandeepIntegrationWS.asmx';
        public Map<String,String> inputHttpHeaders_x;
        public String clientCertName_x;
        public Integer timeout_x;
        public verisysComBr.ValidationSoapHeader ValidationSoapHeader;
        private String ValidationSoapHeader_hns = 'ValidationSoapHeader=http://verisys.com.br/';
        private String[] ns_map_type_info = new String[]{'http://verisys.com.br/', 'verisysComBr'};
        public AsyncVerisysComBr.RegisterActivationResponse_elementFuture beginRegisterActivation(System.Continuation continuation,String ID) {
            verisysComBr.RegisterActivation_element request_x = new verisysComBr.RegisterActivation_element();
            request_x.ID = ID;
            return (AsyncVerisysComBr.RegisterActivationResponse_elementFuture) System.WebServiceCallout.beginInvoke(
              this,
              request_x,
              AsyncVerisysComBr.RegisterActivationResponse_elementFuture.class,
              continuation,
              new String[]{endpoint_x,
              'http://verisys.com.br/RegisterActivation',
              'http://verisys.com.br/',
              'RegisterActivation',
              'http://verisys.com.br/',
              'RegisterActivationResponse',
              'verisysComBr.RegisterActivationResponse_element'}
            );
        }
    }
}

i am trying to exectue using this below code 

AsyncVerisysComBr.RegisterActivationResponse_elementFuture ex1;
AsyncVerisysComBr.AsyncWebService1Soap ex2 = New AsyncVerisysComBr.AsyncWebService1Soap();
ex1 = ex2.beginRegisterActivation(60, '00vJ000000H6Nix');


Error i am getting is 

Line: 3, Column: 7
Method does not exist or incorrect signature: [AsyncVerisysComBr.AsyncWebService1Soap].beginRegisterActivation(Integer, String)

can some one help me how to call this class 

Thanks in Advance 
Hello All,

I am new to integrations i have craeted a web service inside salesforce for creating an activity. i want to insert an activity into salesforce with some fields value as blank some times . how can i do that . 

 webservice static ServiceResponse CreateContactOrLeadActivityOutBoundCalls (string RecordID,
                                                                                string Comentarios,
                                                                                string grava,
                                                                                
                                                                                string CampanhaRecordID,
                                                                                string Status,
                                                                                string DDD,
                                                                                string DDI,
                                                                                Integer CallDurationInSeconds,
                                                                                Boolean FidelizadoParaAgent,
                                                                                Datetime Reagendamento,
                                                                                Datetime StartCallTime,
                                                                                Datetime EndCallTime){ 
        ServiceResponse response = new ServiceResponse();
        try{
            Id devRecordTypeId = Schema.SObjectType.Task.getRecordTypeInfosByName().get('Servicecloud').getRecordTypeId();// Sample RecordType on Task with Name Asia.
            string CurrentObject;
            if(RecordID.startsWith('003')){
                CurrentObject = 'Contact';
            }
            else if(RecordID.startsWith('00Q')){
                CurrentObject = 'Lead';
            }
            else{
                CurrentObject = '';
            }
            if(null != CurrentObject && '' != CurrentObject){
                if(null != Status && '' != Status){
                    if(CurrentObject == 'Contact'){
                        Contact contactRecord = [select Id, AccountID,FirstName,LastName from Contact where Id =:RecordID];
                        Campaign  CampanhaRecord = [select Id,Name, Status from Campaign  where Id =:CampanhaRecordID];
                        if(null != contactRecord){                      
                            Task task = new Task(ActivityDate = Date.today(),
                                                    Subject='Call',
                                                    Tipo__c = 'Outbound Call',
                                                    C_digo_do_Agente__c = AgentCode,
                                                  
                                               
                                                    WhatId = CampanhaRecord.ID,
                                                    WhoId = contactRecord.ID,
                                                    
                                                    OwnerId = getUserIDFromAgentCode(AgentCode) != '' ? getUserIDFromAgentCode(AgentCode) : UserInfo.getUserId(),
                                                    Status = Status,
                                                    RecordTypeID = devRecordTypeId,
                                                    CV_StartCallTime__c =StartCallTime,
                                                    CV_EndCallTime__c = EndCallTime,
                                                    CallDurationInSeconds =  CallDurationInSeconds,
                                                    CV_ScheduleDate__c = Reagendamento,
                                                    Fidelizado_Para_Agent__c  = FidelizadoParaAgent);
                            insert task;


in the above code i only want (WhoID and WHATID) as required and all other filed can be blank while inserting.

Please help me 

Thanks in Advance