+ Start a Discussion
ndrannapareddyndrannapareddy 

WebService Error

I am Getting the Following Error when Invoking a External Service .

 

How do i check if the External System Is being called atleast .

 

 

This is being Invoked from My Developer Console.

 

 

string ResponseString;
string EmailId= 'adb@xyz.com';
integer lnno= 201345680;
try{
tempuriOrg13.WSHttpBinding_IProdWcfService loan= new tempuriOrg13.WSHttpBinding_IProdWcfService();
System.debug('Inputs to Function'+ln +'siteUrl'+siteUrl);
ResponseString=loan.CallWcfService(lnno,EmailId);
system.debug('Output from outside system '+ResponseString);
}catch(Exception E)
{
    system.debug(E);
}

 

External service class file generated from WSDL

 

//Generated by wsdl2apex

public class tempuriOrg13 {
    public class CallWcfServiceResponse_element {
        public String CallWcfServiceResult;
        private String[] CallWcfServiceResult_type_info = new String[]{'CallWcfServiceResult','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
        private String[] field_order_type_info = new String[]{'CallWcfServiceResult'};
    }
    public class CallWcfService_element {
        public Integer transactionNo;
        public String email;
        private String[] transactionNo_type_info = new String[]{'transactionNo','http://www.w3.org/2001/XMLSchema','int','0','1','false'};
        private String[] email_type_info = new String[]{'email','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
        private String[] field_order_type_info = new String[]{'transactionNo','email'};
    }
    public class WSHttpBinding_IProdWcfService {
        public String endpoint_x = 'http://api.*****.com:8081/ProdWcfService.svc';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://schemas.microsoft.com/2003/10/Serialization/', 'temporgMicro', 'http://tempuri.org/', 'tempuriOrg13'};
        public String CallWcfService(Integer transactionNo,String email) {
            tempuriOrg13.CallWcfService_element request_x = new tempuriOrg13.CallWcfService_element();
            tempuriOrg13.CallWcfServiceResponse_element response_x;
            request_x.transactionNo = transactionNo;
            request_x.email = email;
            Map<String, tempuriOrg13.CallWcfServiceResponse_element> response_map_x = new Map<String, tempuriOrg13.CallWcfServiceResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://tempuri.org/IProdWcfService/CallWcfService',
              'http://tempuri.org/',
              'CallWcfService',
              'http://tempuri.org/',
              'CallWcfServiceResponse',
              'tempuriOrg13.CallWcfServiceResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.CallWcfServiceResult;
        }
    }
}





Error received :

 

21:41:15.278 (278886000)|VARIABLE_SCOPE_BEGIN|[16]|E|Exception|true|false
21:41:15.279 (279018000)|VARIABLE_ASSIGNMENT|[16]|E|"common.apex.runtime.impl.ExecutionException: IO Exception: External server did not return any content"|0x25f92037
21:41:15.279 (279035000)|STATEMENT_EXECUTE|[16]
21:41:15.279 (279040000)|STATEMENT_EXECUTE|[17] 21:41:15.279 (279068000)|SYSTEM_METHOD_ENTRY|[17]|System.debug(ANY) 21:41:15.279 (279102000)|USER_DEBUG|[17]|DEBUG|System.CalloutException: IO Exception: External server did not return any content 21:41:15.279 (279113000)|SYSTEM_METHOD_EXIT|[17]|System.debug(ANY)



Best Answer chosen by Admin (Salesforce Developers) 
ManjunathManjunath

Hi,

 

Try hosting your service on to a static server. Then try invoking it.

 

Regards,

 

All Answers

Bindhyachal Kumar SinghBindhyachal Kumar Singh

Hi ndrannapaereddy,

 

I think your endpoint is not responding well. Check your endpoint url and then try again.

 

In Remote Site Setting set this url also:

 

https://c.ap1.visual.force.com   

 

Here c.ap1 is my salesforce server instance. Use own server instance instead of c.ap1

 

 

Vinit_KumarVinit_Kumar

Hi,

 

Try calling your external URL using API tool which are generally available like SOAP UI and see how it is behaving and see if you are able to get any response or not.

 

In this way you can narrow down your issue.

ndrannapareddyndrannapareddy

I tried to invoke the Service from External System and it worked .

 

The Difference I have from WSDL hosted is .

 

It has the binding soap12 hosted and I changed it to Soap since SF cannot generate class from soap12 .

 

can some one give me a suggestion is this what is the stopper ..

 

Thanks

 

 

 

ManjunathManjunath

Hi,

 

Try hosting your service on to a static server. Then try invoking it.

 

Regards,

 

This was selected as the best answer