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
SimplySfdcSimplySfdc 

call apex class from .NET

Hi,

Is it possible to run an apex class from .NET code?
Thx.

sq

micwamicwa
You can call apex via a Webservice call. For this your apex class must be a webservice and you have to include the WSDL of that class in your .Net code as a reference.
SimplySfdcSimplySfdc
Hi micwa.

Thanks for your reply, apex class is a webservice
"webservice static Id createInv(Id regId, Integer invoiceType)"
Then I download get WSDL file from "Generate WSDL" button and add this wsdl to my web reference in .NET

I get following error:
Following error occured after call createInvoice {"No operation available for request {http://soap.sforce.com/schemas/class/Invoice} createInvoice"}

Parts of wsdl file download:
 <soap:address location="https://cs2-api.salesforce.com/services/Soap/class/Invoice"/>

 <definitions targetNamespace="http://soap.sforce.com/schemas/class/Invoice" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://soap.sforce.com/schemas/class/Invoice">

Is this error with WSDL file or apex class?

sq

SuperfellSuperfell
The error is in your .NET code, the request is going to the wrong URL.