当我向此 Web 服务发送请求以获取信息时遇到问题这是我的配置代码
<bindings>
<basicHttpBinding>
<binding name="Z_SI_ADVANCE_VENDORBinding" messageEncoding="Text" textEncoding="utf-8">
<security mode="Transport">
<transport clientCredentialType="Basic" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
这是我向该网络服务发送请求的代码(http://www.xxxx.com)
Dim epAddress As New EndpointAddress("http://www.xxxx.com")
Dim binding As New BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly)
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic
Dim client As XI_ADVANCE_VENDOR.Z_SI_ADVANCE_VENDORClient = New XI_ADVANCE_VENDOR.Z_SI_ADVANCE_VENDORClient(binding, epAddress)
Dim p_output As XI_ADVANCE_VENDOR.BAPIRETURN1
client.ClientCredentials.UserName.UserName = "xxxxx"
client.ClientCredentials.UserName.Password = "xxxxx"
p_output = client.Z_SI_ADVANCE_VENDOR(param1,param2)
当调用请求完成时,它会在browser网页上显示“服务器错误”。