VB.NET to WCF: Thread was being aborted -


i having issue calling wcf service multiple times in loop vb.net application. getting called 10 times , after throws below exception,

system.threading.threadabortexception: thread being aborted. @ system.net.connectstream.writeheaders(boolean async) @ system.net.httpwebrequest.endsubmitrequest() @ system.net.httpwebrequest.checkdeferredcalldone(connectstream stream) @ system.net.httpwebrequest.getresponse() @ system.servicemodel.channels.httpchannelfactory`1.httprequestchannel.httpchannelrequest.waitforreply(timespan timeout) @ system.servicemodel.channels.requestchannel.request(message message, timespan timeout) @ system.servicemodel.dispatcher.requestchannelbinder.request(message message, timespan timeout) @ system.servicemodel.channels.servicechannel.call(string action, boolean oneway, proxyoperationruntime operation, object ins, object outs, timespan timeout) @ system.servicemodel.channels.servicechannelproxy.invokeservice(imethodcallmessage methodcall, proxyoperationruntime operation) @ system.servicemodel.channels.servicechannelproxy.invoke(imessage message) @ system.runtime.remoting.proxies.realproxy.privateinvoke(messagedata& msgdata, int32 type) @ directdebit.lib.interfaces.idirectdebitwcf.getexportdirectdebits(getexportdirectdebitsrequest request) @ webpay.exportdirectdebit.getexportdirectdebit(int32 pagenumber)  object reference not set instance of object. 

below vb.net code call wcf api,

    using factory new channelfactory(of imywcf)("*")         dim channel imywcf = factory.createchannel()         try             response = channel.getrecords(request)             dim chnl iclientchannel = directcast(channel, iclientchannel)             chnl.close()             chnl.dispose()         catch ex exception             logger.logevent("exception : " & ex.tostring(), system.diagnostics.eventlogentrytype.error)         end try     end using 

please suggest me solution or if have done wrong.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -