asp.net - WCF, SOAP, Plain Old XML -
i'm confused things in web service world, , hoping explain me.
here's want: want httppost xml document https://www.whatever.com/myservice(.???). in service, want xml doc, stuff, respond xml doc ultra simple -- "<xml....><success>true</success>"
i can't soap or json or else. must conform exists. there hundreds of different companies sending data in format described, , adding requirement enclose in soap isn't possible.
when using wcf web service, appears request me has sent this:
<s:envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:body><getdata xmlns="http://tempuri.org/"><value>3</value></getdata></s:body></s:envelope> when using .asmx page, response sent xml document namespace (http://tempuri, or if change it, whatever change to). unneeded , break existing code.
when using generic handler (.ashx), can control gets returned back, i've been told stay away .ashx pages because carry full asp.net session type code , slower.
what use solve issue , have code fast possible?
edit: in case cares, 10,000 requests per hour issue our peak traffic during year. handle 50-60k incoming requests per day on average, during december can reach 10,000 requests per hour. , hope grow, that, i'll add load balancer , more machines in rackspace.
our current provider of service overwhelmed during these times , miss out on lot of money because of this. so, proxy 1 of our basic checks on front side (duplicate check against database updated hourly) , weed out 75% of traffic have send our current provider. current provider underwriting of these leads us, , not replacing that, merely adding gatekeeper reduce stress on servers.
thanks of help. i've asked series of web service questions lately on stackoverflow trying head around many of issues i'll facing.
what talking pox service -- known plain old xml.
whoever told ihttphandlers carry session code wrong -- don't unless explicitly enable session state. now, have asp.net pipeline overhead, unless using lunatic fringe lightweight web socket server doesn't matter form of iis hosted service have similar overhead. and, if public-facing internet service, iis neat things you might want. things ssl, request logging , integration other stuff operations using watch things.
as how there, since you've got defined format asmx , wcf default (soap) behaviors out definition. flexibility, actual logic of service should implemented separately leaving external bits responsible taking requests, translating xml , sending response formatted xml.
this leaves few options:
probably simplest, if bolting onto existing .net site, custom ihttphandler. you'll have around bit lower down stack in other places if taking 1 set of xml in , spitting response work isn't insurmountable. 1 big advantage have finite control on output side, if you've got long-running task can can stream responses pretty easily.
asp.net mvc web service perhaps simpler ihttphandler inasmuch won't have dive post variables , makes sense if bolting onto mvc site.
wcf webhttp bindings work if xml formatted in manner doesn't mind. have stack boogeymen slay wcf, in experience, never wants fit sort of xml see on wire.
something alternative, such openrasta, work here. meant these sorts of pox style scenarios , let use xml formats, etc.
insofar speed, real question answer not "is fastest be" rather "is fast enough?" considering nature of http , remote communications means that, in cases, server-side efficiencies might able create don't matter because takes hundreds of times longer request transit across wire processed. if have relatively clean implementation of service logic, you'll in position switch communications stacks until find 1 works best you.
Comments
Post a Comment