逗人, 我從客戶端以下Web服務調用: http://ajec.proxym-it.net/Ajec_sso_api/authenticate.wsdl調用Web服務錯誤「遠程服務器返回了意外的響應:(502)連接被拒絕。」
當我嘗試使用它,我得到了這個錯誤: 遠程服務器返回了意外的響應:(502)連接被拒絕。
內部異常是:{ 「遠程服務器返回一個錯誤:(502)錯誤的網關。」}
這是我的代碼:
AuthenticateService.AuthenticatePortClient oAuthenticatePortClient = new AuthenticateService.AuthenticatePortClient();
AuthenticateService.authenticateRequest oauthenticateRequest = new AuthenticateService.authenticateRequest();
oauthenticateRequest.serviceId = "MobileTeam";
oauthenticateRequest.serviceKey = "AJEC1";
oauthenticateRequest.userName = "MMelhem";
oauthenticateRequest.password = "[email protected]$$w0rd";
AuthenticateService.authenticateResponse oregisterUserResponse = oAuthenticatePortClient.authenticate(oauthenticateRequest);
和在web.config是:
<configuration>
<system.net>
<defaultProxy>
<proxy usesystemdefault="False" bypassonlocal="False" />
</defaultProxy>
</system.net>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="AuthenticatePortSoap11" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://172.16.0.82:80/Ajec_sso_api/authenticate"
binding="basicHttpBinding" bindingConfiguration="AuthenticatePortSoap11"
contract="AuthenticateService.AuthenticatePort" name="AuthenticatePortSoap11" />
</client>
</system.serviceModel>
</configuration>
問題一直這項服務曾經爲任何人工作?這是第一次將它作爲web服務使用嗎?它現在對別人有用嗎? HTTP 502意味着壞的網關(後端服務器出現問題)。下一步將是檢查(與管理web服務的人)後端的狀態(除了用戶名/密碼是否正確)。 – blackpen
當試圖在SoupUI應用程序上測試它時,它會工作,但當試圖在代碼上使用它時,它不會。 –