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
Viktor IlyuhinViktor Ilyuhin 

Custom web service

Hi guys

I try to create Custom web service for call it from external application

1. Created simple apex class in sandbox
global class MyWebService {    webService static Integer SumValue(Integer a, Integer b) {
        return a + b;
    }
}
 
// Test class for the previous class.
@isTest
private class MyWebServiceTest {
  testMethod static void testSumValue() {
    Integer x = MyWebService.SumValue(5,10);
  }
}
2. Deployed to production

3. Get Seeeion ID from 
Enterprise WSDL

When i Try to call SumValue from MyWebService   

Request (SoapUI)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:myw="http://soap.sforce.com/schemas/class/MyWebService">
   <soapenv:Header>
      <myw:SessionHeader>
         <myw:sessionId>……….</myw:sessionId>
      </myw:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <myw:SumValue>
         <myw:a>10</myw:a>
         <myw:b>10</myw:b>
      </myw:SumValue>
   </soapenv:Body>
</soapenv:Envelope>

Anser
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>soapenv:Client</faultcode>
         <faultstring>No operation available for request {http://soap.sforce.com/schemas/class/MyWebService}SumValue</faultstring>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>
 
SoapUI

How I can to call my web service ?