2013-02-20 67 views
2

我們正在使用SalesForce的出站通知服務。SalesForce Web服務 - 請求元素未被識別

從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具有以下SOAP定義

<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" 

任何想法是什麼原因造成這個命名空間的問題?謝謝

回答

0

原來我使用了錯誤的工具來生成我的代理。

我應該一直在使用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 
收到出境的通知