通过 WEB 服务进行 .NET SAP 连接身份验证

发布于 2024-08-28 20:42:34 字数 1289 浏览 1 评论 0原文

我正在尝试连接到 SAP 提供的 Web 服务,但遇到身份验证问题。

我只是通过右键单击项目、选择添加服务引用、提供服务的 WSDL URL 并单击“确定”来添加服务。(单击“确定”后要求提供凭据,我提供了它们)

然后当我尝试从 serviceclien 对象调用方法时,我收到以下错误消息:

HTTP 请求未经客户端身份验证方案“匿名”的授权。从服务器收到的身份验证标头是“Basic Realm=”SAP Web Application Server“”。

Web Config 相关部分:

<basicHttpBinding>
<binding name="binding" closeTimeout="00:01:00"
 openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
 allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
 maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
 messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
 useDefaultWebProxy="true">
 <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
  maxBytesPerRead="4096" maxNameTableCharCount="16384" />      
 <security mode="None">       
  <transport clientCredentialType="None" proxyCredentialType="None"
   realm="">
   <extendedProtectionPolicy policyEnforcement="Never" />
  </transport>       
  <message clientCredentialType="UserName" algorithmSuite="Default" />
 </security>
</binding>

另外,我会遇到什么问题?我不想使用 SAP .NET 连接器。 谢谢...

I am trying to connect to a web service served by SAP and I have authentication problem.

I simply added the service by right clicking project, selecting add service reference, giving WSDL URL for the service and clicking OK.(After clicking ok asked for credentials and I provided them)

Then when I tried to call a method from the serviceclien object, I got the error message below:

The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Basic realm="SAP Web Application Server "'.

Web Config Related Part:

<basicHttpBinding>
<binding name="binding" closeTimeout="00:01:00"
 openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
 allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
 maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
 messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
 useDefaultWebProxy="true">
 <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
  maxBytesPerRead="4096" maxNameTableCharCount="16384" />      
 <security mode="None">       
  <transport clientCredentialType="None" proxyCredentialType="None"
   realm="">
   <extendedProtectionPolicy policyEnforcement="Never" />
  </transport>       
  <message clientCredentialType="UserName" algorithmSuite="Default" />
 </security>
</binding>

Also, What problems will i face with? I do not want to use SAP .NET Connector.
Thanks...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

分开我的手 2024-09-04 20:42:34

转至 SAP 上的 Web 服务导航器。下载 WSDL,它将分为三个部分。将它们拼接在一起并针对新的 WSDL 构建 .NET 代理。该服务似乎要求您进行基本身份验证。您需要 SAP 上的用户,该用户有权调用该服务并调用其后端。向您的服务添加基本身份验证 HTTP 标头。

Go to the Web Services Navigator on SAP. Download the WSDL, it will come in three parts. Splice them together and build a .NET proxy against the new WSDL. The service appears to require you to do basic auth. You need a user on SAP, that is authorized to call the service and invoke it's backend. Add a basic authentication HTTP header to your service.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文