You need to sign in to do that
Don't have an account?
Method does not exist or incorrect signature
Hi All,
I have following issues,
In Salesforce i enter SAP Account number ,to fetch the Account data from an external web service(SAP)and populate the result in my salesforce page.I create a contoller ,following error are occur
Error:
Error: Compile Error: Dependent class is invalid and needs recompilation:
sapComDocumentSapSoapFunctionsMcS: line 19, column 13: Method does not exist or incorrect signature: WebServiceCallout.invoke(sapComDocumentSapSoapFunctionsMcS.zsd_cust_det_webservice, sapComDocumentSapSoapFunctionsMcS.ZsdCustWebservDemo_element, MAP<String,sapComDocumentSapSoapFunctionsMcS.ZsdCustWebservDemoResponse_element>, LIST<String>) at line 6 column 72
this is my controller:
public class Temperature
{
String output;
public void recordReplicator()
{
sapComDocumentSapSoapFunctionsMcS.zsd_cust_det_webservice stub=new sapComDocumentSapSoapFunctionsMcS.zsd_cust_det_webservice();
String IvAcctNo;
output= stub.ZsdTCustDetZsdCustWebservDemo(IvAcctNo);
}
public String getOutput()
{
return output;
}
}
this my generated wsdl2apex class:
//Generated by wsdl2apex
public class sapComDocumentSapSoapFunctionsMcS {
public class zsd_cust_det_webservice {
public String endpoint_x = 'http://serverapp5.cssydney.local:8000/sap/bc/srt/rfc/sap/zsd_cust_det_webservice/100/zsd_cust_det_webservice/zsd_cust_det_webservice';
public Map<String,String> inputHttpHeaders_x;
public Map<String,String> outputHttpHeaders_x;
public String clientCertName_x;
public String clientCert_x;
public String clientCertPasswd_x;
public Integer timeout_x;
private String[] ns_map_type_info = new String[]{'urn:sap-com:document:sap:soap:functions:mc-style', 'sapComDocumentSapSoapFunctionsMcS', 'urn:sap-com:document:sap:rfc:functions', 'sapComDocumentSapRfcFunctions'};
public sapComDocumentSapSoapFunctionsMcS.ZsdTCustDet ZsdCustWebservDemo(String IvAcctNo) {
sapComDocumentSapSoapFunctionsMcS.ZsdCustWebservDemo_element request_x = new sapComDocumentSapSoapFunctionsMcS.ZsdCustWebservDemo_element();
sapComDocumentSapSoapFunctionsMcS.ZsdCustWebservDemoResponse_element response_x;
request_x.IvAcctNo = IvAcctNo;
Map<String, sapComDocumentSapSoapFunctionsMcS.ZsdCustWebservDemoResponse_element> response_map_x = new Map<String, sapComDocumentSapSoapFunctionsMcS.ZsdCustWebservDemoResponse_element>();
response_map_x.put('response_x', response_x);
WebServiceCallout.invoke(
this,
request_x,
response_map_x,
new String[]{endpoint_x,
'',
'urn:sap-com:document:sap:soap:functions:mc-style',
'ZsdCustWebservDemo',
'urn:sap-com:document:sap:soap:functions:mc-style',
'ZsdCustWebservDemoResponse',
'sapComDocumentSapSoapFunctionsMcS.ZsdCustWebservDemoResponse_element'}
);
response_x = response_map_x.get('response_x');
return response_x.EtAccDet;
}
}
public class ZsdCustWebservDemo_element {
public String IvAcctNo;
private String[] IvAcctNo_type_info = new String[]{'IvAcctNo','urn:sap-com:document:sap:rfc:functions','char10','1','1','false'};
private String[] apex_schema_type_info = new String[]{'urn:sap-com:document:sap:soap:functions:mc-style','false','true'};
private String[] field_order_type_info = new String[]{'IvAcctNo'};
}
public class ZsdSCustDet {
public String AcctNo;
public String SalesOrdNo;
public String PoNo;
public String PoDate;
public String NetVal;
public String Currency_x;
private String[] AcctNo_type_info = new String[]{'AcctNo','urn:sap-com:document:sap:rfc:functions','char10','1','1','false'};
private String[] SalesOrdNo_type_info = new String[]{'SalesOrdNo','urn:sap-com:document:sap:rfc:functions','char10','1','1','false'};
private String[] PoNo_type_info = new String[]{'PoNo','urn:sap-com:document:sap:rfc:functions','char20','1','1','false'};
private String[] PoDate_type_info = new String[]{'PoDate','urn:sap-com:document:sap:rfc:functions','date','1','1','false'};
private String[] NetVal_type_info = new String[]{'NetVal','urn:sap-com:document:sap:rfc:functions','curr15.2','1','1','false'};
private String[] Currency_x_type_info = new String[]{'Currency','urn:sap-com:document:sap:rfc:functions','cuky5','1','1','false'};
private String[] apex_schema_type_info = new String[]{'urn:sap-com:document:sap:soap:functions:mc-style','false','true'};
private String[] field_order_type_info = new String[]{'AcctNo','SalesOrdNo','PoNo','PoDate','NetVal','Currency_x'};
}
public class ZsdTCustDet {
public sapComDocumentSapSoapFunctionsMcS.ZsdSCustDet[] item;
private String[] item_type_info = new String[]{'item','urn:sap-com:document:sap:soap:functions:mc-style','ZsdSCustDet','0','-1','false'};
private String[] apex_schema_type_info = new String[]{'urn:sap-com:document:sap:soap:functions:mc-style','false','true'};
private String[] field_order_type_info = new String[]{'item'};
}
public class ZsdCustWebservDemoResponse_element {
public sapComDocumentSapSoapFunctionsMcS.ZsdTCustDet EtAccDet;
private String[] EtAccDet_type_info = new String[]{'EtAccDet','urn:sap-com:document:sap:soap:functions:mc-style','ZsdTCustDet','1','1','false'};
private String[] apex_schema_type_info = new String[]{'urn:sap-com:document:sap:soap:functions:mc-style','false','true'};
private String[] field_order_type_info = new String[]{'EtAccDet'};
}
}
Is my controller are correct plz any one tell me
hi,
1)Once check ur Class name,is it correct name what you gave ,while importing WSDL file.
Hi,
There is no such method in your class 'sapComDocumentSapSoapFunctionsMcS'.
The method in side your class is 'ZsdCustWebservDemo'.
Try this
stub.ZsdCustWebservDemo(IvAcctNo);.
One more thing, return type for this methods in not string. Modify your controller code.
Regards,
Hi Manjunath, thanks for the reply. We alredy tried this
Try this
stub.ZsdCustWebservDemo(IvAcctNo);
but i getting same error,
One more thing, return type for this methods in not string. Modify your controller code.
tell me more about this line i cant understand that.
thanks for reply i checked the class name is correct.
now im getting this error
Error: Compile Error: Illegal assignment from sapComDocumentSapSoapFunctionsMcS.ZsdTCustDet to String at line 9 column 3
Hi,
You are not getting the same error which you got earlier. It is different.
In my previous reply, I have specifically told you to modify the code in your controller because 'ZsdCustWebservDemo' methods does not return string it returns something else (may be object of other class).
Regards,
Hi,
This line in your controller.
output= stub.ZsdCustWebservDemo(IvAcctNo);
stub.ZsdCustWebservDemo(IvAcctNo); will not return string. That is the reason I told you to modify your controller.
Regards
Im tried plz give a apex code for this wsdl2apex code
Hi,
Post your code that was used in the controller.
I can just guide you.
Regards,
Hi Manjunath,
now i change my controller plez tell me is it correct ,im new in salesforce apex classes.
public class test
{
public test(set<account> i)
{
list<account>lic=[select accountnumber from account where id in: i];
for( account s:lic)
{
sapComDocumentSapSoapFunctionsMcS create=new sapComDocumentSapSoapFunctionsMcS();
create.ZsdCustWebservDemos(s.accountnumber);
}
}
}
note :im getting this error:
Error: Compile Error: Method does not exist or incorrect signature: [sapComDocumentSapSoapFunctionsMcS].ZsdCustWebservDemos(String) at line 11 column 1
Hi,
It will surely will throw you an error. Since there is no method by the name 'ZsdCustWebservDemos' .
The name is 'ZsdCustWebservDemo'
How long have you been coding?
Regards,
Thanks for the reply and your patience Manjunath
Now im getting this error:
Error: Compile Error: Method does not exist or incorrect signature: [sapComDocumentSapSoapFunctionsMcS].ZsdCustWebservDemo(String) at line 11 column 1
I dont what to do.
Hi,
Its class_name.method().
You should be using this -
sapComDocumentSapSoapFunctionsMcS.zsd_cust_det_webservice create=new sapComDocumentSapSoapFunctionsMcS.zsd_cust_det_webservice();
create.ZsdCustWebservDemos(s.accountnumber);
Regards,
thank u very much Majunath now the apex class saving without error you are genius.