C# Service Request -
i stack on apple gsx api request in c# project. ok cannot response api.
certificates done, static ips have whitelisted.
return error when request "https://gsxapiut.apple.com/gsx-ws/services/emea/asp"
{"an error occurred while making http request https://gsxapiut.apple.com/gsx-ws/services/emea/asp. due fact server certificate not configured http.sys in https case. caused mismatch of security binding between client , server."}
request function :
public void authenticate() { try { basichttpbinding binding = new basichttpbinding(basichttpsecuritymode.transport); binding.security.transport.clientcredentialtype = httpclientcredentialtype.certificate; endpointaddress endpoint = new endpointaddress("https://gsxapiut.apple.com/gsx-ws/services/emea/asp"); var sslcertfilename = "test.p12"; var sslcertpassword ="xxxxx"; gsxapi3.gsxwsemeaaspportclient service = new gsxapi3.gsxwsemeaaspportclient(); servicepointmanager.expect100continue = true; servicepointmanager.securityprotocol = securityprotocoltype.ssl3; service.clientcredentials.clientcertificate.certificate = new x509certificate2( sslcertfilename, sslcertpassword, x509keystorageflags.machinekeyset); var auth = new gsxapi3.authenticaterequesttype() { languagecode = "en", serviceaccountno = "xxxxxxxxx", userid = "xxxxxxxxxxx", usertimezone = "cet" }; var session = service.authenticate(auth); var usersessionid = new gsxapi3.gsxusersessiontype { usersessionid = session.usersessionid }; } catch (exception err) { } }
Comments
Post a Comment