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
Venkata Sravan Kumar BandariVenkata Sravan Kumar Bandari 

Hi, I am new to integration and here is my problem

In SFDC Account1 i was defined a class with a method as follows

global class Integration_Source {

    webservice static void Integration_method() {
   
    System.debug('Sccessfully invoked Remote method');

    }
}

and generated wsdl and Partner wsdl, Now I am trying to invoke the method Integration_method() from SFDC Account2 as follows and i was also defined the remotesite settings there are No Errors in log file status is Success but the Method is not invoked. No String is displayed.
<------ Here i am not displaying the username and password of my SFDC Account1----->
Generated class from WSDL -----> Integration_Dest
Partner WSDL -----> Integration_PartnerSoap


Integration_PartnerSoap.LoginResult loginresult_var;
Integration_PartnerSoap.Soap obj_soap = new Integration_PartnerSoap.Soap();
loginresult_var = obj_soap.login('username','password-security token');

Integration_Dest.Integration_Source obj_source_method = new Integration_Dest.Integration_Source();
obj_source_method.SessionHeader = new Integration_Dest.SessionHeader_element();
obj_source_method.SessionHeader.sessionId = loginresult_var.sessionId;
obj_source_method.Integration_method();
Best Answer chosen by Venkata Sravan Kumar Bandari
Shashikant SharmaShashikant Sharma
I think you are checking debig log in calling org  and your debug statement is in Org where you have written the webservice. So make sure you  are checking debug logs correct org.

You could do two things :

1. Go and create a Log for this user 
loginresult_var = obj_soap.login('username','password-security token');
call the webservice and check logs in the org where you have the webservice

2. Change return type of your web service and return a string which you have written in debug statement
change this  : obj_source_method.Integration_method();
to 
String responseString = obj_source_method.Integration_method();
System.debug( ' responseString  : ' + responseString );

you could check this log in the caller orgwhere you are calling the webservice.

All Answers

Shashikant SharmaShashikant Sharma
I think you are checking debig log in calling org  and your debug statement is in Org where you have written the webservice. So make sure you  are checking debug logs correct org.

You could do two things :

1. Go and create a Log for this user 
loginresult_var = obj_soap.login('username','password-security token');
call the webservice and check logs in the org where you have the webservice

2. Change return type of your web service and return a string which you have written in debug statement
change this  : obj_source_method.Integration_method();
to 
String responseString = obj_source_method.Integration_method();
System.debug( ' responseString  : ' + responseString );

you could check this log in the caller orgwhere you are calling the webservice.
This was selected as the best answer
Venkata Sravan Kumar BandariVenkata Sravan Kumar Bandari
i have a doubt that is My webservice  is in org1 and i am calling it from org2

after the call I checked the log file in org1 and i got output

but y the output is didnt come in org2
Shashikant SharmaShashikant Sharma
Any system.debug writte in Org1 will not be shown in Org2 Logs. If you want to check Org2 log , you have to write system debug in Org2. Alhough in your logs you could see a Http call and status of response.
Venkata Sravan Kumar BandariVenkata Sravan Kumar Bandari
Thank You Mr. Shasikant Sharma...:-)
Shashikant SharmaShashikant Sharma
Glad that your issue got resolved. :)