You need to sign in to do that
Don't have an account?
Viktor 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
3. Get Seeeion ID from Enterprise WSDL
When i Try to call SumValue from MyWebService
Request (SoapUI)
Anser
How I can to call my web service ?
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>
How I can to call my web service ?