You need to sign in to do that
Don't have an account?
Jancy Mary
Simple Apex SOAP web service
Hi,
I am newbie to web services, I wrote a simple Apex class and made it as Apex SOAP web service, I tried to import the WSDL for my web service after importing the enterprise WSDL for my salesforce org on SOAP UI. Unfortunately I get the error as below,
Source: file:/C:/Users/Mvision/Desktop/New%20folder/SOAPTEST1.xml
Error: type 'RecordTypesSupported@http://soap.sforce.com/schemas/class/SOAPTEST1' not found.
Source: file:/C:/Users/Mvision/Desktop/New%20folder/SOAPTEST1.xml
Error: type 'RelationshipReferenceTo@http://soap.sforce.com/schemas/class/SOAPTEST1' not found.
Source: file:/C:/Users/Mvision/Desktop/New%20folder/SOAPTEST1.xml
Error: type 'SearchLayoutButtonsDisplayed@http://soap.sforce.com/schemas/class/SOAPTEST1' not found.
Source: file:/C:/Users/Mvision/Desktop/New%20folder/SOAPTEST1.xml
Error: type 'SearchLayoutFieldsDisplayed@http://soap.sforce.com/schemas/class/SOAPTEST1' not found.
Here is my code:
global with sharing class SOAPTEST1
{
webservice static List<Contact> OneCon(List<Contact> Con)
{
List<Contact> cc=[select Id, Name from Contact where SystemModStamp >=LAST_N_DAYS:30];
return cc;
}
}
I tried the same code last week and was able to get the expected result on SOAP UI, I remember that I did not make any changes to the code, not sure what went wrong since then I am unable to import the wsdl for this. I followed the below blog which gave me all clear explainations, but I am stuck with my code.
http://blog.deadlypenguin.com/blog/2012/02/03/salesforce-and-soapui/
Any help is much appreciated, thanks in advance:-)
I am newbie to web services, I wrote a simple Apex class and made it as Apex SOAP web service, I tried to import the WSDL for my web service after importing the enterprise WSDL for my salesforce org on SOAP UI. Unfortunately I get the error as below,
Source: file:/C:/Users/Mvision/Desktop/New%20folder/SOAPTEST1.xml
Error: type 'RecordTypesSupported@http://soap.sforce.com/schemas/class/SOAPTEST1' not found.
Source: file:/C:/Users/Mvision/Desktop/New%20folder/SOAPTEST1.xml
Error: type 'RelationshipReferenceTo@http://soap.sforce.com/schemas/class/SOAPTEST1' not found.
Source: file:/C:/Users/Mvision/Desktop/New%20folder/SOAPTEST1.xml
Error: type 'SearchLayoutButtonsDisplayed@http://soap.sforce.com/schemas/class/SOAPTEST1' not found.
Source: file:/C:/Users/Mvision/Desktop/New%20folder/SOAPTEST1.xml
Error: type 'SearchLayoutFieldsDisplayed@http://soap.sforce.com/schemas/class/SOAPTEST1' not found.
Here is my code:
global with sharing class SOAPTEST1
{
webservice static List<Contact> OneCon(List<Contact> Con)
{
List<Contact> cc=[select Id, Name from Contact where SystemModStamp >=LAST_N_DAYS:30];
return cc;
}
}
I tried the same code last week and was able to get the expected result on SOAP UI, I remember that I did not make any changes to the code, not sure what went wrong since then I am unable to import the wsdl for this. I followed the below blog which gave me all clear explainations, but I am stuck with my code.
http://blog.deadlypenguin.com/blog/2012/02/03/salesforce-and-soapui/
Any help is much appreciated, thanks in advance:-)
[1] http://blog.deadlypenguin.com/blog/2015/03/09/web-services-development-salesforce/
I tried the above code, I think I understood the line which you mentioned "define a global inner class as a way to wrapper your results", unfortunately I still get the same error even after trying with this updated code.
I went through Patrick's blog, but could not gather the information required for my understaing. May be it is higher level code or I am missing on something. I need your help on this again.
Thank you very much for your time & response on this:-)
Yes, I regenerated the WSDL after saving the updated code in my org, then tried importing this new WSDL file on the SOAP UI. Unfortunately I got the same error again. I tried importing the new WSDL file while I have the enterprise wsdl already imported on the SOAP UI project.
I did the above after deleting all the existing wsdl files in my computer thinking if that matter for this issue.
=================================================================================
global with sharing class PriceBookentry2 {
global class pricebookentryWrapper{
webservice product2 productid;
webservice pricebook2 pricebookid;
webservice double unitprice; }
global class productWrapper{
webservice String productName;
webservice boolean isActive;
webservice String ProductCode;
webservice String type;
webservice String category;
webservice Double price; }
global class pricebookWrapper{
webservice String pricebookName;
webservice boolean isActive;}
webservice static List<productwrapper> createProductPricebookPricebookEntry(List<productwrapper> productWrapperr,List<pricebookwrapper> pricebookWrapperr,List<pricebookentrywrapper> pricebookentryWrapperr){
List<product2> productsList=new List<product2>();
for(productWrapper product:productWrapperr){
Product2 products =new Product2();
products.name=product.productName;
products.Product_Type__c= product.type;
products.Product_Category__c= product.category;
products.Product_Price__c=product.price;
products.IsActive=true;
productsList.add(products);}
insert productsList;
List<pricebook2> priceBooks = new List<pricebook2>();
for(pricebookWrapper pricebook:pricebookWrapperr){
Pricebook2 pricebookss=new Pricebook2();
pricebookss.name=pricebook.pricebookName;
pricebookss.IsActive=true;}
priceBooks.add(pricebookss);
}
insert priceBooks;
/* Map<product2,pricebook2> ProductAndPricebookIDs=new Map<product2,pricebook2> ();
Product2 productIDs=[select id from product2 WHERE CreatedDate >:Datetime.now().addMinutes(-15)];
pricebook2 pricebookIDs=[select id from Pricebook2 WHERE CreatedDate >:Datetime.now().addMinutes(-15)];
ProductAndPricebookIDs.put(productIDs,pricebookIDs );
set<id> pid=new set<id>();
pid.addAll(ProductAndPricebookIDs.keySet());
List<pricebookentry> priceBookEntries = new List<pricebookentry>();
for(Map<product2,pricebook2> eachproductAndPricebook:ProductAndPricebookIDs){
PricebookEntry pbe=new PricebookEntry();
pbe.Pricebook2Id=eachproductAndPricebook.k
pbe.Product2Id=pricebookentry.productid;
pbe.UnitPrice=pricebookentry.unitprice;
}
} */
}
}