You need to sign in to do that
Don't have an account?
FaridKognoz
Outbound message & metadata API
I'm using c# to code a listener for outbound messages. When using the sessionId and EnterpriseUrl (from the outbound message) with the sforce api I have no problems accesing data in salesforce, but when traying to use the metadata api it says "No operation available for request".
Is there a way to use the metadata API with the sessionId and Enterprise Url provided in the outbound message?
Thanks;
All Answers
Simon:
The URL in the outbound message is: https://na6-api.salesforce.com/services/Soap/c/8.0/511500D80000000MZlL
Which is the default metadata api and what should I do exactly?
Thanks;
Farid
That finally worked! I did as you said, replacing the outbound message enterprise URL with the default metadata URL (but keeping the last part of the enterprise url, after the last '/') and use it as the metadata service endpoint and all worked perfectly. Didn't have to login, just used the sessionId provided in the outbound message.
Thanks :D
Hi
I am having same issue, can you please explain me in more details.
Thanks
conversen
Simon,
I am having same issue, can you explain me more details:
Here is the my situation:
I have created workflow rule & outbound message using metadata api & .Net code and it works fine. when oubound message trigger my webservice I dont get all the fields which I setup in outbound message. which WSDL I should use? either partner or metadata wsdl? Can you please send me sample code for both wsdl. Thanks Mangesh
The fields sent are the subset defined by the outbound messaging configs. There's an outbound messaging specific WSDL you should be using.
But I cant everytime get WSDL from outbound message and create listener class. we build the Outbound message programatically for each customer and customer can pickup the fields so that they can synchronize salesforce data with their own tables. I want something common outbound wsdl so dont have to depend on fields or object.
so we dont have control which field they choose in UI (our web page).
can I used Metadata WSDL to build listener class? do you have any sample code which will give me atleast objects or how to query if I know the fields names?
Please let me know.
Thanks
Mangesh
There is no common/generic WSDL for OM. But the WSDL just defines what the messages look like, if you know in advance what the messages look like (because your tool does the configuration) you can skip the wsdl altogether and just parse the xml.
Parse which XML? and where I can get it.
Also when I setup the endpoint url, (I have common webservice endpoint URL for all OM), when it gets call.. what code I should write to get updated data, if I know the fields.
Can you please update me.
Thanks
Mangesh
the XML of the soap message, its the payload of the HTTP request made to your endpoint.
public class AccountNotificationServiceImpl : INotificationBinding
{
public AccountNotificationServiceImpl()
{
//
// TODO: Add constructor logic here
//
}
notificationsResponse INotificationBinding.notifications(notifications notifications1)
{
AccountNotification[] accounts = notifications1.Notification;
for (int i = 0; i < accounts.Length; i++)
{
AccountNotification notification = accounts[i];
//Pull the account data out
Account account = (Account)notification.sObject;
//We will just echo some values to the console
string city = account.BillingCity;
Log.Info.TraceInformation(account.Name);
}
}
}
if u see account.BillinfCity added dynamically using our UI, but its not avilabel in WSDL, so throwing error as u explain. but my question how will i get XML in above code.
You have to write your own HTTP listener and access the raw http post body, rather than going through the soap stack (which hides all the xml from you, but requires a wsdl)
Do you have any sample code for this.
By the way Thanks for all you help.
Thanks
conversen.
I don't know of a specific example for this, in .NET you'd write a HttpHandler (i.e. implement IHttpHandler), in particular the OnPost method.
Ok. Thanks.