Re: [Blackspotter-webapi] interface rest para mobile, com dados por json ou xml
Status: Alpha
Brought to you by:
filipecarneiro
From: Cláudio T. <cl...@ua...> - 2009-12-21 11:22:49
|
Viva, realmente não está coerente. Posso enviar sem ser escaped. Na próxima release ficará resolvido. Cláudio From: Meik Schuetz [mailto:lim...@co...] Sent: domingo, 20 de Dezembro de 2009 18:48 To: Cláudio Teixeira Cc: Bla...@li... Subject: Re: [Blackspotter-webapi] interface rest para mobile, com dados por json ou xml Boas Claudio, apenas uma dúvida sobre o encoding/escaping dos strings do serviço: Exemplo da lixeira com título BRG Falperra 1. Nos campos normais recebo caracteres especiais sem de ser 'escaped', exemplo: <string>Plástico</string> No campo notes recebo as notas escaped com ampersand <notes>Acesso Facil Rampa da Falperra Zona com todo tipo de lixo malas colch&#245;es mais de 20 cadeiras de beb&#233; electrodomesticos sofas etc. necess&#225;rio cami&#227;o grande ou pick up para varias entregas.</notes> Existe maneira (mais) facil (do que em Objective-C) de transmitir estes &#nnn em caracteres sem ser escaped? Obrigado On 2009/12/14, at 23:48, Cláudio Teixeira wrote: Boas, a interface rest para mobile está pronta a ser usada. Endereço base: http://www.3rdblock.net/WS/SpotterService.svc exemplos de uso: http://www.3rdblock.net/WS/SpotterService.svc/RB-app1Key/9602f591-4046-4be6- bbe7-8c251fdb0d5a/Media?format=xml http://www.3rdblock.net/WS/SpotterService.svc/RB-app1Key/9602f591-4046-4be6- bbe7-8c251fdb0d5a/Media?format=json caso não consigam extrair de forma directa os links a usar, baseiem-se na interface seguinte: public interface ISpotterService { [OperationContract] [WebInvoke(BodyStyle = WebMessageBodyStyle.Wrapped, Method = "PUT", UriTemplate = "{ApplicationKey}?format=xml")] OperationStatus NewBlackSpot(BlackSpot blackSpot, String ApplicationKey); [OperationContract] [WebInvoke(RequestFormat=WebMessageFormat.Json, ResponseFormat=WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, Method = "PUT", UriTemplate = "{ApplicationKey}?format=json")] OperationStatus NewBlackSpotAsJson(BlackSpot blackSpot, String ApplicationKey); [OperationContract] [WebInvoke(Method = "DELETE", UriTemplate = "{ApplicationKey}/{uId}?format=xml")] OperationStatus DeleteBlackSpot(string uId, String ApplicationKey); [OperationContract] [WebInvoke(RequestFormat=WebMessageFormat.Json, ResponseFormat=WebMessageFormat.Json, Method = "DELETE", UriTemplate = "{ApplicationKey}/{uId}?format=json")] OperationStatus DeleteBlackSpotAsJson(string uId, String ApplicationKey); [OperationContract] [WebInvoke(Method = "PUT", UriTemplate = "{ApplicationKey}/{uId}?format=xml")] OperationStatus EditBlackSpot(string uId, BlackSpot blackSpot, String ApplicationKey); [OperationContract] [WebInvoke(RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "PUT", UriTemplate = "{ApplicationKey}/{uId}?format=json")] OperationStatus EditBlackSpotAsJson(string uId, BlackSpot blackSpot, String ApplicationKey); [OperationContract] [WebGet( UriTemplate = "{ApplicationKey}/{uId}?format=xml")] BlackSpot GetBlackSpot(string uId, String ApplicationKey); [OperationContract] [WebGet(ResponseFormat = WebMessageFormat.Json, UriTemplate = "{ApplicationKey}/{uId}?format=json")] BlackSpot GetBlackSpotAsJson(string uId, String ApplicationKey); [OperationContract] [WebGet(UriTemplate = "{ApplicationKey}?format=xml")] BlackSpot[] GetPendingBlackSpots(String ApplicationKey); [OperationContract] [WebGet(ResponseFormat = WebMessageFormat.Json, UriTemplate = "{ApplicationKey}?format=json")] BlackSpot[] GetPendingBlackSpotsAsJson(String ApplicationKey); [OperationContract] [WebInvoke(Method = "PUT", UriTemplate = "{ApplicationKey}/{uId}/Status?format=xml")] OperationStatus ChangeBlackSpotState(string uId, BlackSpotState newState, String ApplicationKey); [OperationContract] [WebInvoke(RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "PUT", UriTemplate = "{ApplicationKey}/{uId}/Status?format=json")] OperationStatus ChangeBlackSpotStateAsJson(string uId, BlackSpotState newState, String ApplicationKey); [OperationContract] [WebInvoke(BodyStyle= WebMessageBodyStyle.Wrapped, Method = "PUT", UriTemplate = "{ApplicationKey}/{uId}/Media?format=xml")] OperationStatus AddMediaObject(string uId, byte[] contents, string title, string description, string mimeType, String ApplicationKey); [OperationContract] [WebInvoke(RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, Method = "PUT", UriTemplate = "{ApplicationKey}/{uId}/Media?format=json")] OperationStatus AddMediaObjectAsJson(string uId, byte[] contents, string title, string description, string mimeType, String ApplicationKey); [OperationContract] [WebGet(UriTemplate = "{ApplicationKey}/{uId}/Media?format=xml")] MediaReader[] GetAllMediaObjects(String uId, String ApplicationKey); [OperationContract] [WebGet(ResponseFormat = WebMessageFormat.Json, UriTemplate = "{ApplicationKey}/{uId}/Media?format=json")] MediaReader[] GetAllMediaObjectsAsJson(String uId, String ApplicationKey); [OperationContract] [WebInvoke( Method = "DELETE", UriTemplate = "{ApplicationKey}/{uId}/Media?format=xml")] OperationStatus DeleteAllMediaObjects(string uId, String ApplicationKey); [OperationContract] [WebInvoke(ResponseFormat = WebMessageFormat.Json, Method = "DELETE", UriTemplate = "{ApplicationKey}/{uId}/Media?format=json")] OperationStatus DeleteAllMediaObjectsAsJson(string uId, String ApplicationKey); [OperationContract] [WebGet(UriTemplate = "{ApplicationKey}/?lat={latitude}&lon={longitude}&dist={distanceInMeters}&fo rmat=xml")] BlackSpot[] GetAllSpotsWithinDistance(double distanceInMeters, double latitude, double longitude, string ApplicationKey); [OperationContract] [WebGet(ResponseFormat = WebMessageFormat.Json, UriTemplate = "{ApplicationKey}/?lat={latitude}&lon={longitude}&dist={distanceInMeters}&fo rmat=json")] BlackSpot[] GetAllSpotsWithinDistanceAsJson(double distanceInMeters, double latitude, double longitude, string ApplicationKey); } ---------------------------------------------------------------------------- -- Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev _______________________________________________ Blackspotter-WebAPI mailing list Bla...@li... https://lists.sourceforge.net/lists/listinfo/blackspotter-webapi |