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

Invoking external Webservice on a button click - Error parsing wsdl

I am a newbee to SF development trying to integrate our product with SF. I want to invoke a web service on a button click. This is what I have done so far:
  • I have added a custom button to Accounts form
  • I have set it up as a On-click javascript type and on-click I am invoking a wrapper class which will invoke the appropriate Apex Webservice class.
  • I have a wsdl which defines the webservice operations
I am trying to generate apex classes from my wsdl. Once I have them generated I can invoke it within the wrapper class.
While one of the namespace gets a class generated, it is giving a compilation error in the other one. As the error message does not have any clear indication, can anyone shed some light on what the issue may be? Feel free to generate from wsdl yourself to check out the error message. Here is a link to the wsdl, I am using:
Gino BassoGino Basso

Your operation names seem to be confusing the Apex code generator (I think some are reserved words).

For example, if you prefix each of your operations with 'x' then the classes are generated correctly (I actually was able to leave the login and create operations unchanged).
Hi Gino
Thanks for your reply/help. That makes sense. I actually had a compilation error when I used "retrieve" in other place.
I have made the changes and it seem to generate the request now.

I am able to invoke a particular operation (login for example) and I see the request is processed in the server. But when the response is sent, SF complains "Unable to parse callout response. Apex type not found for element".

Also, to get it to work, I had trimmed down the wsdl quite a bit, as it was complaining about multiple parts in messages. I have the new wsdl at "". This wsdl generates one class (cms) but fails generating one of the classes (cms/wsdl). Technically, we can have more than 1 part element for messages in document/literal style. Any idea what could be wrong here.