0

When I add a service reference to my MVC3 application: I obtain methods which take a guid in parameter:

void getcities( string token);
void getCountry( string token);

but when I add a service reference to a Windows 8 application, the proxy generated doesn't include a token:

public System.Threading.Tasks.Task<Maquette_MyAirport_Win8.ServiceFlightInfo.CitiesResponse> GetAllCitiesAsync() 
{
  Maquette_MyAirport_Win8.ServiceFlightInfo.BaseRequest inValue = new Maquette_MyAirport_Win8.ServiceFlightInfo.BaseRequest();

  return ((Maquette_MyAirport_Win8.ServiceFlightInfo.FlightInfoService)(this)).GetAllCitiesAsync(inValue);
}

So when I call this method without a guid, it throws an error: you are not authorized to access this service.

Do you have any solution, please?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
user1428798
  • 1,534
  • 3
  • 24
  • 50

1 Answers1

0

The response is that the [System.ServiceModel.MessageHeaderAttribute] is not supported in windows 8.

So i add a custom behavior like this to inject headermessage: How to add a custom HTTP header to every WCF call?

Community
  • 1
  • 1
user1428798
  • 1,534
  • 3
  • 24
  • 50