【发布时间】:2015-04-03 16:34:09
【问题描述】:
我可以使用步骤here 致电销售团队。但是,当我尝试使用独立 Web 客户端 like this one 拨打电话时出现错误。错误如下。提供给 login() 的用户名和(密码+令牌)是有效的。
我不确定为什么我不能从独立的 SOAP 客户端调用 SOAP 方法。我相信我应该可以。我是否必须始终使用 Force-wsc 连接到 SalesForce?
请求:
<?xml version="1.0" encoding="utf-16"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<login xmlns="urn:enterprise.soap.sforce.com">
<username>MY_USERNAME</username>
<password>PASSWORD+TOKEN</password>
</login>
</soap:Body>
</soap:Envelope>
回应
ResponseCode: 500 (Server Error)
Transfer-Encoding:chunked
Content-Type:text/xml;charset=UTF-8
Date:Fri, 03 Apr 2015 16:25:47 GMT
Expires:Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie:BrowserId=KUXkegaIQ_aJnfVrQEeC-A;Path=/;Domain=.salesforce.com;Expires=Tue, 02-Jun-2015 16:25:47 GMT
<?xml version="1.0" encoding="utf-16"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode>INVALID_LOGIN</faultcode>
<faultstring>INVALID_LOGIN: Invalid username, password, security token; or user locked out.</faultstring>
<detail>
<sf:LoginFault xsi:type="sf:LoginFault">
<sf:exceptionCode>INVALID_LOGIN</sf:exceptionCode>
<sf:exceptionMessage>Invalid username, password, security token; or user locked out.</sf:exceptionMessage>
</sf:LoginFault>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
控制台错误:
************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Web.Services.Protocols.SoapException: INVALID_LOGIN: Invalid username, password, security token; or user locked out.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at SforceService.login(String username, String password)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at WebServiceStudio.MainForm.InvokeWebMethod()
客户端截图:
【问题讨论】:
标签: web-services soap salesforce soapui soap-client