You need to sign in to do that
Don't have an account?
ManojKumar Muthu
sessionid invalid at this location
Hi,
I am trying to excute the below Apex class and stuck with an error.
Can someone hlep me with this?
global class CaseWeberviceControllers {
Webservice static List<Case> getCase(String accounid,String tracker,String priority,String contactEmail,String status)
{
list<Case> caseList = new List<Case>();
String str='Select id from Case where accountid =\''+ accounid+'\'';
if(String.isNotBlank(tracker))
{
str+=' AND Tracker__c =\''+ tracker+'\'';
}
if(String.isNotBlank(priority))
{
str+=' AND Priority=\''+ priority+'\'';
}
if(String.isNotBlank(contactEmail))
{
str+=' AND ContactEmail=\''+ contactEmail+'\'';
}
if(String.isNotBlank(status))
{
str+=' AND Status=\''+ status+'\'';
}
caseList = Database.query(str);
return caseList;
}
}
In Worbench,
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:str="http://soap.sforce.com/schemas/class/CaseWeberviceControllers">
<soapenv:Header>
<str:SessionHeader>
<str:sessionid>!AQkAQC3.022RUHDz4L8w1j4yuO5wh6B2QEcKEyISScpVdDuJvWRVgbdGI4N6vbjSAZpX.X0vmq7zFOHA1L6dHZIUVzSpSMCA</str:sessionid>
</str:SessionHeader>
</soapenv:Header>
<soapenv:Body>
<str:getCase>
<str:Tracker__c>Incident</str:Tracker__c>
<str:Priority>1</str:Priority>
</str:getCase>
</soapenv:Body>
</soapenv:Envelope>
Raw Response
HTTP/1.1 500 Server Error Date: Fri, 23 Nov 2018 09:49:25 GMT Cache-Control: no-cache,must-revalidate,max-age=0,no-store,private Set-Cookie: BrowserId=1LS3fvbPQeaj8Tefpb9ITw;Path=/;Domain=.salesforce.com;Expires=Tue, 22-Jan-2019 09:49:25 GMT;Max-Age=5184000 Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Type: text/xml; charset=utf-8 Transfer-Encoding: chunked
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Client</faultcode><faultstring>Element {http://soap.sforce.com/schemas/class/CaseWeberviceControllers}sessionid invalid at this location</faultstring></soapenv:Fault></soapenv:Body></soapenv:Envelope>
I am trying to excute the below Apex class and stuck with an error.
Can someone hlep me with this?
global class CaseWeberviceControllers {
Webservice static List<Case> getCase(String accounid,String tracker,String priority,String contactEmail,String status)
{
list<Case> caseList = new List<Case>();
String str='Select id from Case where accountid =\''+ accounid+'\'';
if(String.isNotBlank(tracker))
{
str+=' AND Tracker__c =\''+ tracker+'\'';
}
if(String.isNotBlank(priority))
{
str+=' AND Priority=\''+ priority+'\'';
}
if(String.isNotBlank(contactEmail))
{
str+=' AND ContactEmail=\''+ contactEmail+'\'';
}
if(String.isNotBlank(status))
{
str+=' AND Status=\''+ status+'\'';
}
caseList = Database.query(str);
return caseList;
}
}
In Worbench,
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:str="http://soap.sforce.com/schemas/class/CaseWeberviceControllers">
<soapenv:Header>
<str:SessionHeader>
<str:sessionid>!AQkAQC3.022RUHDz4L8w1j4yuO5wh6B2QEcKEyISScpVdDuJvWRVgbdGI4N6vbjSAZpX.X0vmq7zFOHA1L6dHZIUVzSpSMCA</str:sessionid>
</str:SessionHeader>
</soapenv:Header>
<soapenv:Body>
<str:getCase>
<str:Tracker__c>Incident</str:Tracker__c>
<str:Priority>1</str:Priority>
</str:getCase>
</soapenv:Body>
</soapenv:Envelope>
Raw Response
HTTP/1.1 500 Server Error Date: Fri, 23 Nov 2018 09:49:25 GMT Cache-Control: no-cache,must-revalidate,max-age=0,no-store,private Set-Cookie: BrowserId=1LS3fvbPQeaj8Tefpb9ITw;Path=/;Domain=.salesforce.com;Expires=Tue, 22-Jan-2019 09:49:25 GMT;Max-Age=5184000 Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Type: text/xml; charset=utf-8 Transfer-Encoding: chunked
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Client</faultcode><faultstring>Element {http://soap.sforce.com/schemas/class/CaseWeberviceControllers}sessionid invalid at this location</faultstring></soapenv:Fault></soapenv:Body></soapenv:Envelope>