访问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;
...全文
848 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/1bfadf00ae14 松下电工数字压力传感器用户手册详细介绍了DP-100系列数字压力传感器,涵盖其技术参数、操作方法及适用场景等,适用于各类需要精准压力测量的工业环境。 双屏显示:主屏与输出动作同步,可同时显示当前值和基准值,便于实时监控与调整。显示屏为12段字母数字显示,数字清晰易读。 三色指示:屏幕颜色随传感器状态变化(红、绿、橙),便于快速判断工作状态。 紧凑结构:尺寸仅□30mm,适合空间狭窄的安装环境。 多种操作模式:提供RUN模式(日常操作)、菜单设定模式(深入设置如输出模式切换)及PRO模式(高级功能如应差调整、复制设定)。 安全认证:DP-101(A)/102(A)型号通过特定认证,确保产品安全可靠。 复制功能:可通过数据通信将主传感器设定内容复制到其他传感器,减少人工设定错误,节省时间。 高性能传感:具备高精度,分辨率1/2,000,反应时间2.5ms(最长5,000ms可调),温度特性±0.5%F.S.,重复精度±0.1%F.S. 电子元件吸附检测:监测吸盘是否成功吸附电子元件。 总压力监测:测量管道或容器内的压力水平。 空气泄漏检测:通过压力变化检测泄漏情况。 DP-101□:适用于低压环境(-100kPa至100kPa)。 DP-102□:适用于高压环境(0kPa至1MPa)。 订购时需根据实际需求选择合适型号,考虑传感器的适用范围和工作条件。手册提供详细订购流程及注意事项,包括相关认证信息(如韩国S标志)。 复制功能:通过数据通信将主传感器设定复制到其他传感器,支持多种设定模式,避免设定错误,节省时间。 操作模式:RUN模式用于日常监控,菜单设定模式用于深入设置,PRO模式提供高级功能。 使用前需仔细阅读手册,了解各功能使用方法。遵循安全指南,正确安装和使用传感器,避免损坏。对于

12,166

社区成员

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

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