访问WebService中的方法失败,捕获的异常是“Server was unable to process request”和“The user Id is invalid.”谢谢大家了。

zorroonline 2006-03-02 02:05:36
访问WebService中的方法失败,捕获的异常是“Server was unable to process request”和“The user Id is invalid.”请问是什么原因呀,谢谢。

CrmService objService = new CrmService();
objService.Url = "http://10.100.0.100:5555/MSCRMServices/Service.asmx";
System.Net.NetworkCredential objNetCredential = new System.Net.NetworkCredential();
objNetCredential.UserName = @"Test\Administrator";
objNetCredential.Password = "123";
objService.Credentials = objNetCredential;
...全文
849 14 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
zorroonline 2006-04-20
  • 打赏
  • 举报
回复
问题没有解决
zorroonline 2006-03-02
  • 打赏
  • 举报
回复
为什么是namespace的问题
zorroonline 2006-03-02
  • 打赏
  • 举报
回复
谢谢,我试试,回头给你分
开发者开聊 2006-03-02
  • 打赏
  • 举报
回复
估计是namespace的问题
Overriding 2006-03-02
  • 打赏
  • 举报
回复
1> 我的webservice根目录属性-Directory Security-Edit-Integrated Windos Authentication选中
2>web.config文件里设置<authentication mode="Windows"/>
3>ws代码

[WebMethod]
public string HelloWorld() {
return "Hello World";
}
4>调用代码
private void button1_Click(object sender, EventArgs e)
{
sss.Service s = new sss.Service();
s.Credentials = new NetworkCredential("FAREAST\v-zzhao", "xxxxxx.");
MessageBox.Show( s.HelloWorld());
}
结果正确
zorroonline 2006-03-02
  • 打赏
  • 举报
回复
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<configSections>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data"/>
<section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings,Microsoft.Practices.EnterpriseLibrary.Caching"/>
</configSections>
<connectionStrings>
<add name="MRDataAccess" connectionString="server=10.100.0.194;database=dev0SCR_CRM;uid=sa;pwd=sql2005" providerName="System.Data.SqlClient"/>
<add name="dev0SCR_CRMConnectionString1" connectionString="Data Source=10.100.0.194;Initial Catalog=dev0SCR_CRM;Persist Security Info=True;User ID=sa;MultipleActiveResultSets=False;Packet Size=4096;Application Name="Microsoft SQL Server Management Studio"" providerName="System.Data.SqlClient"/>
</connectionStrings>
<dataConfiguration defaultDatabase="MRDataAccess"/>
<cachingConfiguration defaultCacheManager="Default Cache Manager">
<backingStores>
<add name="inMemory" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching"/>
</backingStores>
<cacheManagers>
<add name="Default Cache Manager" expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="1000" numberToRemoveWhenScavenging="10" backingStoreName="inMemory"/>
</cacheManagers>
</cachingConfiguration>
<appSettings>
<add key="CrmService" value="http://10.100.0.151:5555/MSCRMServices/2006/CrmService.asmx"/>
</appSettings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Messaging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Configuration.Install, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
</assemblies>
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>
Overriding 2006-03-02
  • 打赏
  • 举报
回复
还有把你的域去掉
Overriding 2006-03-02
  • 打赏
  • 举报
回复
web.config文件贴出来。
zorroonline 2006-03-02
  • 打赏
  • 举报
回复
是的 ,是域
Overriding 2006-03-02
  • 打赏
  • 举报
回复
Test是你的域吗?
zorroonline 2006-03-02
  • 打赏
  • 举报
回复
是的
Overriding 2006-03-02
  • 打赏
  • 举报
回复
你的webservice用的windows集成身份验证?
zorroonline 2006-03-02
  • 打赏
  • 举报
回复
函数类型正确
是不是因为一些验证的事情
supesa 2006-03-02
  • 打赏
  • 举报
回复
查查你Service.asmx中调用的函数类型是否正确?
资源下载链接为: https://pan.quark.cn/s/9e7ef05254f8 【久久在线FLASH系统】是一款专为久久在线网站打造的交互式Flash平台,集成了前台展示与后台管理功能,满足内容发布、管理和用户互动的需求。Flash技术曾广泛应用于网页动画和互动内容,尤其在早期互联网时代,在游戏、广告和多媒体教学等领域发挥了重要作用。该系统的核心包括以下几个关键方面: Flash技术:系统利用Flash创建动态图形、动画和交互内容,依赖Adobe Flash Player运行。其编程语言ActionScript支持面向对象开发,便于实现复杂逻辑和交互效果。 后台管理系统:作为系统的控制心,后台支持内容上传、编辑、分类、权限设置、用户管理及数据分析,确保内容的有序更新与发布。 产品演示模块:用户可在线预览和体验产品功能,无需下载,通过交互式演示了解产品操作流程和优势。 数据库集成:系统与数据库紧密结合,用于存储Flash文件信息、用户数据及访问记录,实现高效的数据管理与检索。 安全性与优化:系统具备防止非法访问和数据泄露的安全机制,并对Flash内容进行优化,提升加载速度与用户体验。 响应式设计:尽管Flash主要用于桌面端,系统仍考虑多设备兼容性,通过响应式设计适配不同屏幕尺寸,提供一致体验。 API接口:系统支持与其他平台或服务通过API进行数据交互,如社交媒体分享、数据分析等,拓展功能边界。 用户体验:界面设计注重交互性与视觉效果,提升用户满意度和停留时间,增强平台吸引力。 版本控制:系统支持内容版本管理,便于追踪更新历史,方便内容维护与回滚。 性能监控:内置性能监控工具,实时跟踪系统负载与资源使用情况,及时发现并解决问题,保障系统稳定运行。 【久久在线FLASH系统】是一个综合性解决方案,融合了前端展示、后台管理、互动体验和数据分析等功能,体现了当时Web

12,166

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 Web Services
社区管理员
  • Web Services社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧