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 

Soap Api from one org to another org

I developed  simple soap api from one of my org and consumed it in another one ....


When i am calling it from another org gives me the below error

First error: Web service callout failed: WebService returned a SOAP Fault: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session faultcode=sf:INVALID_SESSION_ID faultactor=


public class LogInfo {
public String category;
public String level;
private String[] category_type_info = new String[]{'category','','LogCategory','1','1','false'};
private String[] level_type_info = new String[]{'level','','LogCategoryLevel','1','1','false'};
private String[] apex_schema_type_info = new String[]{'','true','false'};
private String[] field_order_type_info = new String[]{'category','level'};


public class LoginHistory {
public String ApiType;
public String ApiVersion;
public String Application;
public String Browser;
public String ClientVersion;
public DateTime LoginTime;
public String LoginType;
public String LoginUrl;
public String Platform;
public String SourceIp;
public String Status;
public String UserId;
private String[] ApiType_type_info = new String[]{'ApiType','','string','0','1','true'};
private String[] ApiVersion_type_info = new String[]{'ApiVersion','','string','0','1','true'};
private String[] Application_type_info = new String[]{'Application','','string','0','1','true'};
private String[] Browser_type_info = new String[]{'Browser','','string','0','1','true'};
private String[] ClientVersion_type_info = new String[]{'ClientVersion','','string','0','1','true'};
private String[] LoginTime_type_info = new String[]{'LoginTime','','dateTime','0','1','true'};
private String[] LoginType_type_info = new String[]{'LoginType','','string','0','1','true'};
private String[] LoginUrl_type_info = new String[]{'LoginUrl','','string','0','1','true'};
private String[] Platform_type_info = new String[]{'Platform','','string','0','1','true'};
private String[] SourceIp_type_info = new String[]{'SourceIp','','string','0','1','true'};
private String[] Status_type_info = new String[]{'Status','','string','0','1','true'};
private String[] UserId_type_info = new String[]{'UserId','','ID','0','1','true'};
private String[] apex_schema_type_info = new String[]{'','true','false'};
private String[] field_order_type_info = new String[]{'ApiType','ApiVersion','Application','Browser','ClientVersion','LoginTime','LoginType','LoginUrl','Platform','SourceIp','Status','UserId'};



public class LoginIp {
public DateTime ChallengeSentDate;
public DateTime CreatedDate;
public Boolean IsAuthenticated;
public String SourceIp;
public MYWebservice34.User_x Users;
public String UsersId;
private String[] ChallengeSentDate_type_info = new String[]{'ChallengeSentDate','','dateTime','0','1','true'};
private String[] CreatedDate_type_info = new String[]{'CreatedDate','','dateTime','0','1','true'};
private String[] IsAuthenticated_type_info = new String[]{'IsAuthenticated','','boolean','0','1','true'};
private String[] SourceIp_type_info = new String[]{'SourceIp','','string','0','1','true'};
private String[] Users_type_info = new String[]{'Users','','User','0','1','true'};
private String[] UsersId_type_info = new String[]{'UsersId','','ID','0','1','true'};
private String[] apex_schema_type_info = new String[]{'','true','false'};
private String[] field_order_type_info = new String[]{'ChallengeSentDate','CreatedDate','IsAuthenticated','SourceIp','Users','UsersId'};



how to rectify the error?????



You need to post your code,it seems that you are not sending sesionid properly with the object of the class in which your method has been defined.

Are u using enterprise/ partner wsdl of one salesforce org in another salesforce org?
Both are dev editions, what code I need to paste because the code of consumed wsdl is more than 4000 lines

I am assuming you are using  parthner wsdl .The errror is coming because you are not passing session id  as part of the request when u are calling your custom web service .


Have u develoeped any custom web service using apex ?


Ok,Can u put the code which gives you erorr.
What code u require pls specify as said earlier the custom Webservice of mine is above 5000 lines ....And the Custom webservice that i generated is simple Controller and thus made the wsdl from Generate Wsdl button on Classes page....Pls Reply
Hi ,

I am also getting the same error, can anyone suggest on the same, please refere the link