4
I have a problem with my code c#, I am trying to consume the Post Office API but the data is null. I found another tutorial on the internet that said to instantiate the class trace and grab the property rastroJSON
but my service does not own this property(rastroJSON
), being that property rastroJSON
displayed on page 7 of the Post Office documentation.
My attempt coming in the null data:
correios.rastro a = new correios.rastro();
correios.sroxml xml = new correios.sroxml();
xml = a.buscaEventos("ECT", "SRO", "", "U", "", "CODIGO");
Console.WriteLine(xml.objeto);
Console.ReadKey();
correios
is the namespace of my reference.
The object of consolewriteline
come null, I created a service reference with the address:
http://webservice.correios.com.br/service/rastro/Rastro.wsdl
I tried to follow the manual, but it didn’t work.
I created first with a service reference, soon after I tried creating a web service reference, in the advanced properties.
The User, Password I assume you have, right? Test with the call below by placing the data in the URL: As I have no user and password here to test for me returns null too. http://webservice.correios.com.br/service/rastro/Rastro.wsdl?%22usuario=9999999999&password=S@1234YWC5&type=L&result=T&lingua=101&objects=JO999999999BR
– Thiago Loureiro
I’m in this trouble too, you managed to fix it?
– James Braz