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
Royston59Royston59 

Is it possible to edit the WSDL file?

I would like to send the 'name' field in the Lead Object to an external API. However only the 'FirstName' and 'LastName' are available.

Can I edit the WSDL file that is created with the outbound message and change 'FirstName' to 'name' then save it?

BalajiRanganathanBalajiRanganathan
i dont think updating the WSDL file will work as it is only used by the receiver to program their endpoint.

Lead Name is a compound field(first name and last name). so you have to send both firstName and Last Name in the outbound messge.

And ask your consumer of the message to combine it to single field if required.
You can aslo try adding a formula field which combines both first name and last name and send that field.
Royston59Royston59

Thanks balaji - I suspected that it wasnt possible :/

I did consider the idea of creating custom fields at my end, but unfortunately they would render 'custom_field_name__C' Changing the receiving API fields is unfortunately not an option :(

perhaps some Apex coding?

mjohnson-TICmjohnson-TIC
If you want to convert a WSDL into a modifiable Apex Class, you can do so be logging into a sandbox, Setup -> Develop -> Apex Classes and clicking "Generate from WSDL". This will automatically parse your WSDL and create an Apex Class based on it. From there you can modify or invoke the methods generated within the WSDL. Hope that helps!
Royston59Royston59
Thanks mjohnson-TIC !!
Im one step closer :) I am currently working in a Sandbox. Ive followed your idea above. Can you tell me how I can apply this new Apex Class to my outbound messages? The subsequently to my 'live' version.

You obviously know what you are doing!! - The other issue that I have is the API that I am trying to push to has different field id t o what we have. Is there anyway of fixing this.

For Example 
The API field is 'telephone' ours is 'phone' if I create a custom field called 'telephone' it will be followed with '__c'

Any more tips would be greatly received!!
mjohnson-TICmjohnson-TIC
Unfortunately I do not know of an easy way to do this using outbound messages and workflows. It seems like it would be easy enough for Salesforce to create field mapping within the outbound message, so you do not need to send the API names to your endpoint - hopefully in a future release.

What you would need to do is generate a WSDL based on the endpoint you are sending the data to.

Then instead of a workflow, invoke one of the methods used in the generated Apex WSDL class based on logic written in a trigger.

Integrations are never easy and take alot of time and patience.
Royston59Royston59
Thanks mjohnson-TIC - you have pointed me in the right direction. I just need to work out how to fire the generated Apex WSDL class when the trigger is satisfied.