.net - Why does adding a typed dataset in a WCF service force the client to use arrays for collections? -
.net - Why does adding a typed dataset in a WCF service force the client to use arrays for collections? -
i have wcf service , wcf client. service uses methods homecoming generic lists , client's service reference collection type set generic list. works fine.
i added method wcf service returns typed dataset. first operation contract homecoming dataset. updated service reference in client , broke everything. lists converted arrays though collection type set generic list.
i thought went bad deleted service reference, reran vs, created service reference scratch , still collections have been converted arrays instead of lists.
i confirmed dataset caused because when removed new method wcf service , updated reference, collections went lists.
i need utilize dataset is. how can utilize , leave rest of lists intact? why typed dataset interfering type of rest of collections beingness used? using vs 2013 update 2 .net 4.5.1.
the reason when add together service reference via visual studio, under hood, visual studio calls svcutil.exe generate proxy. good, because screen shot shows, svcutil able interpret collections on exposed service definition wsdl list<t>
.
this works simple contracts.
now, obscure reason known microsoft, svcutil has rather fussy interpretation of xsd, means service definitions fall outside interpretation, vs fall on using old xsd.exe, happens not back upwards collections list<t>
.
generally don't notice because service definitions relatively simple , adhere rules. dumping .net dataset object service contract however, , you're service definition becomes heinously complex vs going have go using xsd.exe generate code.
and therein lies problem.
some things can try:
extract out xsd service wsdl , seek calling svcutil directly: svcutil /o:file.cs /ct:system.collections.generic.list schema.xsd
(probably won't work seek in case)
modify generated code manually, replacing arrays lists (ouch)
don't dump .net dataset service definition (this favorite)
use tool xsdarraytolist - allow re-gen gen'd code.
.net wcf visual-studio
Comments
Post a Comment