You need to sign in to do that
Don't have an account?

A detail example of building a Listener in asp.net C#..
Hi Guys,
I am having issues with the listener that I am building rite now..
I have follow the AppExchange Developer Network Help File on building the Listener as follow...
but when come to INotificationBinding.. I am lost..
Can anyone show me a detail example.
Best Regards,
Nigil Chua
Once you have defined an outbound message and configured an outbound messaging endpoint, download the WSDL and create a listener:
- Right-click Click for WSDL and select Save As to save the WSDL to a local directory with an appropriate filename. For example, for an outbound message that deals with leads, you could name the WSDL file leads.wsdl.
- Unlike the enterprise or partner WSDLs, which describe the messages the client sends to Salesforce, this WSDL defines the messages that Salesforce will send to your client application.
- Most web services tools will generate stub listeners for you, in much the same way as they generate a client stub for the enterprise or partner WSDL. Look for a server side stub option.
For example, for .Net 2.0:
- Run wsdl.exe /serverInterfaceleads.wsdl with .Net 2.0. This generates NotificationServiceInterfaces.cs, which defines the notification interface.
- Create a class that implements NotificationServiceInterfaces.cs.
- You implement your listener by writing a class that implements this interface. There are a number of ways to do this. One simple way is to compile the interface to a DLL first (DLLs need to be in the bin directory in ASP.NET:
mkdir bin csc /t:library /out:bin\nsi.dll NotificationServiceInterfaces.cs
Now write an ASMX based web service that implements this interface. For example, in MyNotificationListener.asmx:<%@WebService class="MyNotificationListener" language="C#"%> class MyNotificationListener : INotificationBinding { public notificationsResponse notifications(notifications n) { notificationsResponse r = new notificationsResponse(); r.Ack = true; return r; } }
This example is a simple implementation, actual implementations will be more complex. - Deploy the service by creating a new virtual directory in IIS for the directory that contains the MyNotificationListener.asmx.
- You can now test that the service is deployed by viewing the service page with a browser. For example, if you create a virtual directory salesforce, you'd go to http://localhost/salesforce/MyNotificationListener.asmx.
The process for other web service tools is similar, please consult the documentation for your web service tool. For Axis, we recommend version 1.1 or later.
Your listener must meet these requirements:
- Must be reachable from the public Internet.
- If you use SSL, you must use port 443, and you must have a real certificate. If you certificate expires, message delivery will fail.
Hi there.. thanks for your reply
Is the Listener only meant for .net 2.0? can it work with .net 1.1?
When I following the help file example.. I got the following message
Error 1 The type or namespace name 'INotificationBinding' could not be found (are you missing a using directive or an assembly reference?) c:\inetpub\wwwroot\SalesForce\WebService.asmx 2 41 http://localhost/SalesForce/
Please advise..
Best Regards,
Nigil Chua
Hi there..
I have managed to get it worked on .net 2.0. just wondering if .net 1.1 is able to do so.. cos I having issue with the
implementing the binding to receive the notifications on .net 1.1
Please advise,
Nigil Chua
Hi Simon
I have trouble using this command Run wsdl.exe /serverInterfaceleads.wsdl.
Can't I just add it was a web service within my project.
Thanks
Stephen
No, you can't just add web service in your project, because that creates a web service client, not a server.
Message Edited by SimonF on 04-23-2008 07:25 AM
Hi Simon
I have a related question, I have everything setup right and webservice runs
but what should I do next to get a result, a response from salesforce?