0

창 전화 8 응용 프로그램을 개발하고 싶습니다. 나는 윈도우 폰 8 응용 프로그램에 익숙하지 않다. 윈도우 폰 8 응용 프로그램에서 amazon의 제품 광고 API를 사용할 수 있는지 확인하고 싶다. 나는 점점 오전 문제는 내가 웹 응용 프로그램에서했던 것처럼 IClientMessageInspector 인터페이스를 참조 할 수없는 생각이다아마존 제품은 Windows Phone 8에서 광고를 광고합니다.

public class AmazonSigningMessageInspector : IClientMessageInspector 
{ 
    private string accessKeyId = ""; 
    private string secretKey = ""; 

    public AmazonSigningMessageInspector(string accessKeyId, string secretKey) 
    { 
     this.accessKeyId = accessKeyId; 
     this.secretKey = secretKey; 
    } 

    public object BeforeSendRequest(ref Message request, IClientChannel channel) 
    { 
     // prepare the data to sign 
     string operation = Regex.Match(request.Headers.Action, "[^/]+$").ToString(); 
     DateTime now = DateTime.UtcNow; 
     string timestamp = now.ToString("yyyy-MM-ddTHH:mm:ssZ"); 
     string signMe = operation + timestamp; 
     byte[] bytesToSign = Encoding.UTF8.GetBytes(signMe); 

     // sign the data 

     byte[] secretKeyBytes = Encoding.UTF8.GetBytes(secretKey); 
     HMAC hmacSha256 = new HMACSHA256(secretKeyBytes); 
     byte[] hashBytes = hmacSha256.ComputeHash(bytesToSign); 
     string signature = Convert.ToBase64String(hashBytes); 


     // add the signature information to the request headers 

     request.Headers.Add(new AmazonHeader("AWSAccessKeyId", accessKeyId)); 
     request.Headers.Add(new AmazonHeader("Timestamp", timestamp)); 
     request.Headers.Add(new AmazonHeader("Signature", signature)); 
     return null; 
    } 

    public void AfterReceiveReply(ref Message reply, object correlationState) { } 
} 

답변

0

이 인터페이스는, 그것은 매우 간단한 인터페이스의 8

윈도우 폰에서 지원되지 않습니다 그래도 다시 만들 수 있습니다.

+0

그래서 처음부터 끝까지 Windows Phone 8 amazon 앱을 만드는 데 문제가 없습니까? – maztt

+0

Visual Studio의 Windows Phone에서 작업을 시작했을 때 콘솔의 거의 모든 것들을 연구 한 후 첫 번째 단계에서 멈추는 것은 혼란스러운 일종입니다. – maztt

+0

다른 문제가 있는지 말할 수는 없지만 인터페이스가 누락 된 경우 쉽게 작성할 수 있습니다. API는 REST 인터페이스를 통해 모든 XML로만 보이기 때문에 모든 것이 가능해야합니다. –