c# - .net micro framework contacting WCF generates IO Exception -
i developing application runs on fez spider board communicate wcf hosted on pc. have followed this example, instead of using wcfservicehost, i've hosted wcf service in iis.
the problem when i'm contacting wcf service, application raises io exception.
here code of simple gadgeteer application tests wcf connection.
using system; using system.collections; using system.threading; using microsoft.spot; using microsoft.spot.presentation; using microsoft.spot.presentation.controls; using microsoft.spot.presentation.media; using microsoft.spot.presentation.shapes; using microsoft.spot.touch; using gadgeteer.networking; using gt = gadgeteer; using gtm = gadgeteer.modules; using gadgeteer.modules.ghielectronics; using tempuri.org; using schemas.datacontract.org.wcfservicetest; using ws.services.binding; using ws.services; namespace gadgeteerclient { public partial class program { private bool networkup = false; private iservice1clientproxy proxy; //***** // todo: change ip address of machine running wcf service //***** string hostrunningwcfservice = "169.254.65.183"; // method run when mainboard powered or reset. void programstarted() { /******************************************************************************************* modules added in program.gadgeteer designer view used typing name followed period, e.g. button. or camera. many modules generate useful events. type +=<tab><tab> add handler event, e.g.: button.buttonpressed +=<tab><tab> if want periodically, use gt.timer , handle tick event, e.g.: gt.timer timer = new gt.timer(1000); // every second (1000ms) timer.tick +=<tab><tab> timer.start(); *******************************************************************************************/ // use debug.print show messages in visual studio's "output" window during debugging. debug.print("program started"); // use updateclientproxy.cmd create proxy classes ethernetj11d.networkup += ethernetj11d_networkup; ethernetj11d.usethisnetworkinterface(); ethernetj11d.usestaticip("169.254.141.168", "255.255.0.0", hostrunningwcfservice); button.buttonpressed += button_buttonpressed; } void ethernetj11d_networkup(gtm.module.networkmodule sender, gtm.module.networkmodule.networkstate state) { debug.print("network up!"); networkup = true; proxy = new iservice1clientproxy(new ws2007httpbinding(), new protocolversion11()); // note: endpoint needs match endpoint of servicehost proxy.endpointaddress = "http://" + hostrunningwcfservice + "/service1"; } void button_buttonpressed(button sender, button.buttonstate state) { if (!networkup) return; button.turnledon(); try { getdata data = new getdata(); data.value = 123; // call test string result = proxy.getdata(data).getdataresult; // should print 123, io exception instead generated debug.print("received: " + result); displayte35.simplegraphics.displaytext(result, resources.getfont(resources.fontresources.ninab), gt.color.gray, 30, 30); } catch (system.io.ioexception ex) { debug.print("error making wcf call"); debug.print(ex.tostring()); } { button.turnledoff(); } } } }
how solve issue?
edit: details exception are:
exception thrown: system.io.ioexception
there no inner exception , stack trace is:
ws.services.binding.httptransportbindingelement::onprocessinputmessage ws.services.binding.bindingelement::processinputmessage ws.services.binding.bindingelement::processinputmessage ws.services.binding.requestchannel::receivemessage ws.services.binding.requestchannel::request tempuri.org.iservice1clientproxy::getdata gadgeteerclient.program::button_buttonpressed gadgeteer.modules.ghielectronics.button::onbuttonevent system.reflection.methodbase::invoke gadgeteer.program::dooperation microsoft.spot.dispatcher::pushframeimpl microsoft.spot.dispatcher::pushframe microsoft.spot.dispatcher::run gadgeteer.program::run
Comments
Post a Comment