Friday, November 7, 2014

Apex Component error: Element type "input" should be followed by either attribute specifications, ">" or "/>"

Not sure if you have faced this situation, but let's see what we're trying to accomplish.

Scenario Display 2 radio buttons, one unchecked and another one checked based on the value of a variable.

How was developed
For educational purposes I'll just show 1 radio button :)
Looks simple, however we got the weird error message listed as title of this post.

Solution
After thinking carefully and asking salesforce support, we end up with the same solution
In order to display 1 radio button only, we have to write code for 2 radio buttons!

I hope this saves you valuable time.

Monday, October 13, 2014

Invoke a SOAP API written in Salesforce using Axis

I had to consume an API written by someone else in Salesforce. I got the WSDL and the EndPoint.

Essentially what I had to do is to replace existing code I wrote a year ago to perform User Provisioning in Salesforce and rely on this API to perform that logic.

Now the interesting part is how to write my client, the obvious answer was to use WSDL2Java (Axis), because I don't want to write much code. And this is my final code: This is a simple Cooking recipe with the exception of these lines: Things to keep in mind (otherwise you'll get "INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session"):
  1. Open a session in Salesforce (that's how get permission to invoke the API)
  2. Populate SessionHeader object (with Salesforce sessionId)
  3. Set the Header to your Port before making your call