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
Venki123Venki123 

Need a help webservice callout exception

Hi I am struggling with the below exception..

 

System.CalloutException: 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=

 

Class.WSDL2ApexVenki.Venki.sayHello: line 62, column 1 Class.VenkiController.: line 4, column 1

 

My classes are:

 

global

classVenki {

 

webService

staticstring sayHello() {

 

return'Hello World!';

}

}

 

Controller Class:

 

public

classVenkiController {

WSDL2ApexVenki.Venki stub =

newWSDL2ApexVenki.Venki();

 

String uname=

'Fine test';

 

publicString getUname() {

 

returnuname;

}

publicvoidsetUname(String username){

 

uname=username;

}

publicString getHelloWorld() {

string result;

WSDL2ApexVenki.Venki stub =

newWSDL2ApexVenki.Venki();

setUname(stub.sayHello());

returnuname;

 

}

 

 

}

 

Visual force page:

 

<

apex:pagecontroller="VenkiController"tabStyle="Account">

<

apex:form>

<

script>functionshow()

 

{

 

testHello();

 

}

</

script>

<

apex:actionFunctionname="testHello"action="{!getHelloWorld}"/>

<

h1> Testing! </h1>

 

 

<

apex:commandbuttononclick="show()"/>

<

apex:outputTextvalue="{!uname}"id="out"/>

 

 

</

apex:form>

</

apex:page>

 

Please help.