Everyone, I have a webservice in (ASMX) on a c# asp.net site and I am receiving outbound messages from the sales force I have more than one type of Notification one is for Accounts other is Tasks the first one is working with all the default ClassNames when I generated the ProxyClass from WSDL file, when I did it for the Tasks and converted WSDL file to ProxyClass it was showing Errors about names are conflicting with one another, so I changed the names in the ProxyClass, such as defaul Name for Notifications to notificationTasks,NotificationReponce to notificationsResponseTask,sObject to sObjectTask, so when I ran the generic code for receive notification and return Ack=true
by default it worked with no issues but when I try the following Code: i.e trying to take values from the message it breaks showing Error of Server was not able to handle the request.
My Code:
class Tasks :INotificationBindingTasks
{
//class MyNotificationListener : INotificationBinding
public notificationsResponseTask notifications(notificationTasks notification2)
{
TaskNotification[] TaskNotification = notification2.Notification;
notificationsResponseTask r = new notificationsResponseTask();
r.Ack = true;
return r;
}
}
What am I doing wrong here?
So the way I look at your issue I think I have the solution I have ran into this issue before and its very simple to fix, there is a question already regarding this on Stack exchange here.
The way outbound works is the proxyCalss is coded in such way that to be able to successfully grab the notification and decode it you need it to be in spefic form and names are very sensitive for example you said you changed the name of notificationsResponse now when salesforce sends the message its expecting a return values with the name of notificationsResponse which you changed that's why changing the names in Class will only cause more issues.
Now if you read the question I added on this answer it says you can easily put the 2nd outbound message into a NameSpace which is Unique to that one class, do as follows, when you create the proxy class put the whole class into one namespace ex:
namespace Customnotification
{
// The whole rest of the class comes here
}
Now your new Outbound message is unique for its self and will not conflict with other ProxyClass, now in your webservice.asmx.cs
file do the following:
namespace Customnotification
{
public class Tasks : INotificationBinding
{
// REST of the process goes here for the receiving data from outbound
// Make sure you use the default notification names do not change them
}
Try that it should work. Thanks!