SFService是一个“空间”,但使用像类型 [英] SFService is a 'namespace' but is used like a type

查看:410
本文介绍了SFService是一个“空间”,但使用像类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现通过SalesForce公司的SOAP API验证一个会话ID(即我已经有)的一个简单的任务。问题是,我互联网上找到的所有例子是这样的:

I'm trying to accomplishing a simple task of validating a SessionID (that I already have) through the SOAP API of SalesForce. Problem is, all the examples I found on internet is like this:

SforceService约束力=新SforceService();

binding.Url =的serverUrl;

binding.SessionHeaderValue =新SessionHeader();
binding.SessionHeaderValue.sessionId =的sessionId;

但对于第一个行不为我工作,我已经添加了通过Visual Studio和我已经通过我的账户上下载的Salesforce WSDL文件中的Web引用。但SforceService是不能被实例化命名空间。

but for the very first line doesn't work for me, I've added the web reference through Visual Studio and WSDL file that I've downloaded through my account on salesforce. but SforceService is a namespace that can't be instantiated.

这是我的Solution Explorer中的样子添加引用后:

this is how my Solution Explorer looks like after adding the reference:

我想要是验证一个会话ID!

All I want to is to validate a SessionID!!

任何想法?

推荐答案

您添加服务引用,不是一个Web引用,你需要去通过先进的按钮,并选择Web引用来代替。 (或者你应该能够得到它的服务引用工作,但编程模型是不同的,所以你看样品不适用)

You added a service reference, not a web reference, you need to go through the advanced button and pick web reference instead. (Or you should be able to get it to work with a service reference, but the programming model is different, so the samples you're looking at don't apply)

这篇关于SFService是一个“空间”,但使用像类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆