2013-02-20 66 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 
收到出境的通知