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
akkkakkk 

how to solve a prblem when am I generating (Generat from WSDL) and uploae the Partner WDSL ?

Hi Everyone

how to solave a problem when i am gererating a Partner WSDL from Sourse org After That Going to Generate the Targer Class WSDL Generating a Apex Code from WSDL then showing a error 


Please anyone provide the Soluation
User-added image
NagendraNagendra (Salesforce Developers) 
Hi Khan,

Sorry for this issue you are facing.

I faced a similar issue in the past and Below lines of code was causing the above problem.
<element name="NewValue" nillable="true" minOccurs="0" type="xsd:anyType"/>
<element name="OldValue" nillable="true" minOccurs="0" type="xsd:anyType"/>
Was able to resolve it by changing the below lines of code from anytype to string and then I was able to generate apex classes from the enterprise WSDLs.

Unfortunately, anyType isn't supported by the wsdl2apex functionality:

The Salesforce datatype anyType is not supported in WSDLs used to generate Apex code that is saved using API version 15.0 and later
See this page for a list of supported XML schema types Convert the anyType into a string and you're good to go!

Tip: 
  • open note pad ++
  • click on search(Ctrtl+F)
  • type "anytype"
  • Check for line that are similar to above 
  • change  anytype to string
  • and save it
Hope this helps.

Kindly mark this as solved if the reply was helpful so that it gets removed from the unanswered queue which results in helping others who are facing a similar issue.

Thanks,
Nagendra