c# - Generating DataContracts with exact namespace as in XSD -


we have integrate our project end oracle platform. , integration via various webservices. have wsdls , xsds these integrations. , need generate datacontracts these wsdls & xsds.
problem is, of these integration shares common data types. , want reuse them.
e.g,

 integration1: oracle/common/commondatatypes.xsd               oracle/integration1/somexsd.xsd               oracle/ebo/basetypes.xsd integration2: oracle/common/commondatatypes.xsd               oracle/integration2/somexsd.xsd               oracle/ebo/basetypes.xsd integration3: oracle/commondatatypes.xsd               oracle/integration2/somexsd.xsd               oracle/ebo/basetypes.xsd 

in case, want reuse oracle.common.commondatatypes between integration1 & 2.
far have tried wscf.blue & wscf. these tools generating code in single folder(and single namespace) , not following namespaces.
want generate classes under namespaces oracle, oracle.commondata, oracle.integration1, oracle.ebo etc. way generated datacontracts follows exact namespace notation xsds have?

there no tool i'm afraid. or none know of. best way acheive want is:

  1. extract data contracts integration 1 using /dconly flag on svcutil. need include schema names in call svcutil. generate class file types.

  2. go file , manually hack around until classes in right namespaces. compile assembly.

  3. then go integration 1 service , generate proxy code using /r flag in svcutil reference assembly containing common types want reuse. create class file containing proxy should reference common types.

  4. you can same integration 2 , 3.

however, approach based on svcutil using datacontractserializer work, /r flag not available xmlserializer. , work if schemas exposed on oracle services adhere rather strict dcs rules (can found here: http://msdn.microsoft.com/en-us/library/ms733112.aspx). if these rules not adhered svcutil fall using xmlserializer not support reuse of types.

hope helps.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -