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
MarconyMarcony 

No operation available for request {http://soap.sforce.com/schemas/class/...

Please help!

I’ve created an APEX class

 

 

global class LeadImporterExternal {

       WebService static String importLead(String xmlParameter) {

              leadImporter importer = new leadImporter();

              return importer.importLead(xmlParameter);

       }

}

 

Downloaded WSDL file for this class. Using this file I have generated a C# code for accessing a web service.

In my code, I’m calling this service in the following way:

 

 

 

SforceService SFSevice = new SforceService();

LoginResult loginResult = SFSevice.login(userName, password);

 

LeadImporterExternalService myService = new LeadImporterExternalService();

myService.Url = loginResult.serverUrl;

myService.SessionHeaderValue = new SessionHeader();

myService.SessionHeaderValue.sessionId = loginResult.sessionId;

 

string result = myService.importLead(xmlText);

 

 

 

But I keep getting an error SoapHeaderException: No operation available for request

{http://soap.sforce.com/schemas/class/LeadImporterExternal}importLead.

 

Can someone tell me why this is not working and what I’m doing wrong?

I’ll appreciate any help

Thanks!

Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell
remove the line that sets the Url property. (myService.Url = ...)

All Answers

SuperfellSuperfell
remove the line that sets the Url property. (myService.Url = ...)
This was selected as the best answer
AndreaRozAndreaRoz

Hi Simon,

yes it works but why?!

This means that internal webServices are on a differente WebServer, and that never changes?

Thanks a lot.

--

Andrea 

SuperfellSuperfell
It works because the wsdl already has the correct service URL in it.
anilmcaanilmca

Thanks Simon