Solved

WCF Service and Data Contract generation against WSDL and XML files

Posted on 2014-02-26
9
1,578 Views
Last Modified: 2014-02-27
Hi experts!
Please follow the instructions in the attached image file. I tried to upload zipped xml schema files, but it's not allowed.
Question:
Is it possible to generate WCF service and data contracts with those schema files?
The schema files are used to generate standard XML Web Services that follow the rules of a government agency here in Brazil called ANS.
I tried to use svcutil with no success. It seams like there is a problem with digital signature schema dependencies, it's not clear...
I also need to know if the generated code would allow me to create WCF services that are compatible with the required standards.
If you need more information about my development needs and usage scenario, please contact me.
Thanks for helping!

Schema download page:
http://www.ans.gov.br/espaco-dos-prestadores/tiss/1759-padrao-tiss-versao-30100
download-page-and-link.png
0
Comment
Question by:andrepires
  • 5
  • 4
9 Comments
 
LVL 19

Expert Comment

by:Melih SARICA
ID: 39888504
check the link below for "Contract Generation from WSDL/XML Schema - DataContractSerializer vs. XmlSerializer"

http://blogs.msdn.com/b/sonuarora/archive/2007/06/16/contract-generation-from-wsdl-xml-schema-datacontractserializer-vs-xmlserializer.aspx
0
 
LVL 2

Author Comment

by:andrepires
ID: 39888572
Hi non_zero!
Thanks for helping!
In my research I've got to that link.
After reading that, I got to a "not so sure if it gives me an answer" kind of feeling...
As I said, the xml schemas that I have to use are generated by a brazilian government agency, not by me.
They are used as a pattern for message exchanging between health ensurance companies and hospitals, doctors and clinics.
As far as I know, I cannot modify the schemas (as sugested in the link you told me about). The truth is that no one (be it the agency or other developers) could give me the ultimate answer to that question.
The point is: Can I modify the schemas in order to use the datacontract serializer/svcutil to generate WCF code and still be in accordance with the agency/schemas requirements/definitions?

Thank you!
0
 
LVL 19

Expert Comment

by:Melih SARICA
ID: 39888588
u dont ave to modify the schema .. what u need is an wsdl file to generate the proxy..

Schema is used to obey the rules of the application.  so u must not change the given definition. Normally schemas  have to be validated before its processed by the application to avoid app crashes.


and what u do with svcutil is to create a proxy for the wsdl to use as .net dll function set
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 2

Author Comment

by:andrepires
ID: 39888636
non_zero,
Did you take a look at the schema files?
The wsdl schemas are there, but svcutil crashes when generating c# code for them.
0
 
LVL 19

Expert Comment

by:Melih SARICA
ID: 39889078
i try to find it but can find the rite files(no spanish).. It would be great for me to guide the correct files)
0
 
LVL 2

Author Comment

by:andrepires
ID: 39889207
Hi non-zero.
The attached image points to the download link.
The file's xml structure is in portuguese, but it doesn't matter because the xml metadata is standard.
If you need any help, please tell me.
0
 
LVL 2

Author Comment

by:andrepires
ID: 39889218
In order to generate the datacontracts you should use the file called tissV3_01_00
In order to generate the service contracts you should use the file called tissWebServicesV3_01_00

Both files point to their dependencies.
Both work fine with xsd.exe generation.
0
 
LVL 19

Accepted Solution

by:
Melih SARICA earned 500 total points
ID: 39889926
C:\tst>svcutil .\ff\tissWebServicesV3_01_00.xsd .\ff\tissV3_01_00.xsd /language:c# /dconly /importXMLTypes

this works for me .. and generates some code.. try this
0
 
LVL 2

Author Comment

by:andrepires
ID: 39891663
Ok. I tried that.
It generates the code very similar to what xsd.exe does, with a couple of warnings.
I will use the code and check if it works.
Thanks for helping.
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Test Spring Web services... 3 50
web services wcf 2 116
Please explain "Multi-Tenant Services" 5 82
IIs Windows 2008 HTTPS no access 4 29
When coding a Webservice to provide data, the normal way is to create a method that returns a Dataset object.   But a Dataset cannot be used easily from another platform, such as PHP,  FLAS (FLEX) , etc. Solution : Return a XML Document instea…
For some reason Google Apps has decided to reserve 'www' for your new domain which results in an error when trying to map the web address 'www' to a certain site in your Google Sites. The error is 'this address is already being used' and after some …
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now