Я собираюсь реализовать приложение прослушивателя для исходящих сообщений Salesforce.
обход реализует его с помощью устаревшей веб-службы ASMX. Код создается с помощью wsdl.exe с переключателем / serverInterface.
Вот WSDL исходящих сообщений Salesforce.
Process a number of notifications.
Notification Service Implementation
TLDR - мне нужно реализовать NotificationBinding, чтобы Salesforce могла вызывать мой веб-сервис при возникновении события в их системе.
С тех пор я понял, что svcutil изначально не поддерживает разработку Contract-First.
Согласно SOA с первым контрактом и WCF Я использовал WSCF.Blue для создания заглушек на стороне сервера из Salesforce wsdl. Хотя код компилируется, wsdl, созданный моей службой, не имеет требуемой операции уведомлений.
Интересно, что я делаю не так?
Итак, мне удалось быстро реализовать Salesforce wsdl с помощью wsdl.exe и / serverInterface, и похоже, что wsdl, созданный приложением на основе asmx, сильно отличается от приложения на основе wcf.
Это интерфейс, созданный wsdl.exe с помощью / serverInterface
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")]
[System.Web.Services.WebServiceBindingAttribute(Name="NotificationBinding", Namespace="http://soap.sforce.com/2005/09/outbound")]
[System.Xml.Serialization.XmlIncludeAttribute(typeof(sObject))]
public interface INotificationBinding {
///
[System.Web.Services.WebMethodAttribute()]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]
[return: System.Xml.Serialization.XmlElementAttribute("notificationsResponse", Namespace="http://soap.sforce.com/2005/09/outbound")]
notificationsResponse notifications([System.Xml.Serialization.XmlElementAttribute("notifications", Namespace="http://soap.sforce.com/2005/09/outbound")] notifications notifications1);
}
Это интерфейс, созданный WSCF.Blue
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Namespace="http://soap.sforce.com/2005/09/outbound", ConfigurationName="INotificationPort")]
public interface INotificationPort
{
// CODEGEN: Generating message contract since the operation notifications is neither RPC nor document wrapped.
[System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]
[System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(sObject))]
notificationsResponse1 notifications(notificationsRequest request);
}
Они кажутся довольно похожими, поэтому я не знаю, почему wsdl, сгенерированный этим приложением, будет такие разные? Стоит ли добавлять wsdls (не хочу больше задавать вопрос, если он уже есть)?