MROverclock Posted March 26, 2015 at 02:28 PM Report Share #580258 Posted March 26, 2015 at 02:28 PM Boas, Já estou há 2 ou 3 dias a partir pedra e não consigo obter sucesso neste problema! Estou a desenvolver uma app para Windows phone 8.1 em c# e tenho de a conseguir fazer comunicar com um webservice já existente. Pelo que percebi só é possível comunicar com este WebService usando POST e SOAP. Entretanto já consegui alguma comunicação mas o webservice devolve-me sempre o erro "400 - Bar Request". Alguém me consegue dar uma ajuda? Link to comment Share on other sites More sharing options...
Ozz Posted March 26, 2015 at 02:42 PM Report Share #580260 Posted March 26, 2015 at 02:42 PM Boas! que tipo de binding estás a utilizar? no endpoint..? Link to comment Share on other sites More sharing options...
MROverclock Posted March 26, 2015 at 06:30 PM Author Report Share #580274 Posted March 26, 2015 at 06:30 PM O webservice não é meu, mas tenho acesso ao código. Pelo que me parece: binding="webHttpBinding" Entretanto já consegui comunicar e ele devolve-me os dados em formato JSON. O meu problema agora é outro, que é: Como extrair daqui os dados. Link to comment Share on other sites More sharing options...
bioshock Posted March 26, 2015 at 07:40 PM Report Share #580277 Posted March 26, 2015 at 07:40 PM Podes utilizar a library Newtonsoft.Json. Link to comment Share on other sites More sharing options...
Guest Posted March 26, 2015 at 07:52 PM Report Share #580279 Posted March 26, 2015 at 07:52 PM (edited) Boas! Dependendo da estrutura, podes usar este código para extrair os teus valores. string json = "conteudo_json"; var obj = JObject.Parse(json); var tokenItem = (string)obj.SelectToken("o_teu_token"); Mais info aqui. Edited March 26, 2015 at 07:55 PM by Guest Link to comment Share on other sites More sharing options...
MROverclock Posted March 27, 2015 at 10:35 AM Author Report Share #580305 Posted March 27, 2015 at 10:35 AM Obrigado pelas respostas, vou analisar! Link to comment Share on other sites More sharing options...
MROverclock Posted March 27, 2015 at 03:58 PM Author Report Share #580350 Posted March 27, 2015 at 03:58 PM Consegui através do Newtonsoft.Json. Muito obrigado pela ajuda! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now