2

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

我只是通过右键单击项目添加服务,选择添加服务引用,为服务提供 WSDL url 并单击确定。(单击确定后询问凭据,我提供了它们)

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

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

Web 配置相关部分:

<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 连接器。谢谢...

4

1 回答 1

0

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

于 2011-04-21T10:36:54.007 回答