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
PleasePlease 

No operation available for request ...

Via a s-control i call a apexcode to call a external webservice, I used the code from the platform_cookbook
(www.webservicex.net Stock Quote example) and changed it for using my own webservice...

i am getting the error "Fout: uncaught exception: {faultcode:'soapenv:Client', faultstring:'No operation available for request {http://soap.sforce.com/schemas/package/TestCallOut2}getAddress1, please check the WSDL for the service.', }"

 

can somebody help me to solve this problem?

 

these are my codes:

s-control:

<html>
<head>
<script type="text/javascript" src="/js/functions.js"></script>
<script src="/soap/ajax/10.0/connection.js"></script>
<script src="/soap/ajax/10.0/apex.js"></script>
<script>
function getAddress() { 
var result = sforce.apex.execute("TestCallOut2","getAddress1",{username:"xx", password:"xx", profileid:"123",       postalcode:"1111AB", housenumber:"123", countrycode:"AB"});
document.getElementById('userNameArea').innerHTML = 'Adres: '+result;
}
</script>
</head>
<body onload=getAddress()>
<div id=userNameArea>
</div>
</body>
</html>

 

Apexclass:

global class TestCallOut2 {
     public static MSAddressDirect2.getAddress1_response  getAddress1(String username, string password, string profileid, string postalcode, string housenumber, string countrycode) {
        MSAddressDirect2.AddressDirectServer2ServicePort stub = new MSAddressDirect2.AddressDirectServer2ServicePort();
        MSAddressDirect2.getAddress1_response adresje = stub.getAddress1(username, password, profileid, postalcode, housenumber, countrycode);
        return adresje;
    }
}

 

Apexclass (generated via WSDL):

//Generated by wsdl2apex

public class MSAddressDirect2 {
    public class getAddress1_element {
        public String username;
        public String password;
        public String profileid;
        public String postal_code;
        public String house_number;
        public String country_code;
        private String[] username_type_info = new String[]{'username','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] password_type_info = new String[]{'password','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] profileid_type_info = new String[]{'profileid','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] postal_code_type_info = new String[]{'postal_code','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] house_number_type_info = new String[]{'house_number','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] country_code_type_info = new String[]{'country_code','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'username','password','profileid','postal_code','house_number','country_code'};
    }
    public class AddressDirectServer2ServicePort {
        public String endpoint_x = 'http://193.67.5.194/cgi-bin/jsmdirect?MSAddressDirect2';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://soapserver.jsm.marktselect.com', 'MSAddressDirect2'};
        public MSAddressDirect2.GetAddress1_response getAddress1(String username,String password,String profileid,String postal_code,String house_number,String country_code) {
            MSAddressDirect2.getAddress1_element request_x = new MSAddressDirect2.getAddress1_element();
            MSAddressDirect2.getAddress1Response_element response_x;
            request_x.username = username;
            request_x.password = password;
            request_x.profileid = profileid;
            request_x.postal_code = postal_code;
            request_x.house_number = house_number;
            request_x.country_code = country_code;
            Map<String, MSAddressDirect2.getAddress1Response_element> response_map_x = new Map<String, MSAddressDirect2.getAddress1Response_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'getAddress1',
              'http://soapserver.jsm.marktselect.com',
              'getAddress1',
              'http://soapserver.jsm.marktselect.com',
              'getAddress1Response',
              'MSAddressDirect2.getAddress1Response_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.getAddress1Return;
        }
    }
    public class GetAddress1_response {
        public String address_city;
        public String address_house_number;
        public String address_postalcode;
        public String address_street;
        public String resultCode;
        public String resultMessage;
        private String[] address_city_type_info = new String[]{'address_city','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_house_number_type_info = new String[]{'address_house_number','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_postalcode_type_info = new String[]{'address_postalcode','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_street_type_info = new String[]{'address_street','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] resultCode_type_info = new String[]{'resultCode','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] resultMessage_type_info = new String[]{'resultMessage','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'address_city','address_house_number','address_postalcode','address_street','resultCode','resultMessage'};
    }
    public class getAddress1Response_element {
        public MSAddressDirect2.GetAddress1_response getAddress1Return;
        private String[] getAddress1Return_type_info = new String[]{'getAddress1Return','http://soapserver.jsm.marktselect.com','GetAddress1_response','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'getAddress1Return'};
    }
}
Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell
Your apex class/method doesn't say its a webservice.

All Answers

SuperfellSuperfell
Your apex class/method doesn't say its a webservice.
This was selected as the best answer
symantecAPsymantecAP

Hi
I got same response for my class which is accepting the fields from client and making a record and returning ID.

Class
global class CMT_CTA {

  webservice static Id makecta(String Scope,String Region,String SubRegion,String Country,String CalltoActionName,String CalltoActionType, Date startDate, String description) 
  {Offer__c cta = new offer__c();

update cta;
return cta.Id;
      
  } 
RESPONSE

 

xml version = "1.0" encoding = "UTF-8"?>

<ns0:ErrorReport xmlns:ns0 = "http://www.tibco.com/pe/EngineTypes">

                <StackTrace>at com.tibco.plugin.soap.SOAPSendReceiveActivity.postEval(SOAPSendReceiveActivity.java:371)

                at com.tibco.pe.core.TaskImpl.eval(TaskImpl.java:512)

                at com.tibco.pe.core.Job.a(Job.java:712)

                at com.tibco.pe.core.Job.k(Job.java:502)

                at com.tibco.pe.core.JobDispatcher$JobCourier.a(JobDispatcher.java:249)

                at com.tibco.pe.core.JobDispatcher$JobCourier.run(JobDispatcher.java:200)

                </StackTrace>

                <Msg/>

                <FullClass>com.tibco.pe.plugin.ActivityException</FullClass>

                <Class>ActivityException</Class>

                <ProcessStack>Custom CTA WSDL TESTING/Test Login &amp; Create.process/SOAPRequestReply</ProcessStack>

                <MsgCode>SOAPPLUGIN-100023</MsgCode>

                <Data>

                                <defaultFaultElement>

                                                <faultcode>soapenv:Client</faultcode>

                                                <faultstring>No operation available for request {http://soap.sforce.com/schemas/class/CMT_CTA}makecta</faultstring>

                                </defaultFaultElement>

                </Data>

</ns0:ErrorReport>

 

kINDLY HELP