public List <ShipmentAddress> getShipmentAddressesJSON() { if (!CheckBasicAuthentication()) { //Autenticazione non riuscita throw new WebFaultException(HttpStatusCode.Unauthorized); } DALShipmentAddresses DAL = new DALShipmentAddresses(); return(DAL.GetShipmentAddresses()); }
public List <ShipmentAddress> getShipmentAddressesXML() { if (!CheckBasicAuthentication()) { //Autenticazione non riuscita //throw new HttpException(401, "Unauthorized access"); //No HttpException perchè viene convertita in errore 400 throw new WebFaultException(HttpStatusCode.Unauthorized); } DALShipmentAddresses DAL = new DALShipmentAddresses(); return(DAL.GetShipmentAddresses()); }