【问题标题】:SalesForce web service - The request element was not recognizedSalesForce Web 服务 - 请求元素未被识别
【发布时间】:2013-02-20 06:23:44
【问题描述】:

我们正在使用来自 SalesForce 的出站通知服务。

从 SalesForce WSDL 生成代理并尝试将其发送到我的 ASMX Web 服务后,我收到以下错误

请求元素 http://soap.sforce.com/2005/09/outbound'> 未被识别。

在我的 C# ASMX Web 服务上

[WebService(Namespace = "http://services.company1.com.au/services")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
[SoapDocumentService(RoutingStyle = SoapServiceRoutingStyle.RequestElement)]
public class ImportPosition : WebService, NotificationPort

SalesForce WSDL 具有以下肥皂定义

<definitions targetNamespace="http://soap.sforce.com/2005/09/outbound"
         xmlns="http://schemas.xmlsoap.org/wsdl/"
         xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
         xmlns:tns="http://soap.sforce.com/2005/09/outbound"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
         xmlns:ent="urn:enterprise.soap.sforce.com"
         xmlns:ens="urn:sobject.enterprise.soap.sforce.com">

如果我将 C# ASMX Web 服务命名空间更改为“http://soap.sforce.com/2005/09/outbound”,则请求成功进入,但作为空对象。

使用 Wireshark 我可以看到传入的 SOAP 消息

<notifications xmlns="http://soap.sforce.com/2005/09/outbound"

知道是什么导致了这个命名空间问题吗?谢谢

【问题讨论】:

    标签: c# soap salesforce asmx


    【解决方案1】:

    原来我使用了错误的工具来生成代理。

    我应该使用 wsdl.exe 而不是 svcutil.exe

    创建 Web 服务以接收来自 SalesForce 的出站通知的提示

    use .asmx 
    WS-I Basic Profile 1.1 
    Web Service Description Language (WSDL) 1.1
    Simple Object Access Protocol (SOAP) 1.1
    

    【讨论】:

      猜你喜欢
      • 2011-09-02
      • 1970-01-01
      • 2012-09-18
      • 2020-04-29
      • 1970-01-01
      • 2013-08-04
      • 2023-03-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多