Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Webmethod's and XSD

Posted on 2011-05-11
2
Medium Priority
?
370 Views
Last Modified: 2012-05-11
I'll attempt to do my best to describe my situation, as I'm fairly new to the topic:

I would like to create a webservice that exposes a webmethod that accepts xml as a parameter [I've provided sample method signatures in the code section]; however, the problem I'm seeing is the ?WSDL on the webservice outlines the datatype that was specified [see below], and what I would like to know is if it is possible to create an .xsd that outlines schema and rules for the expected xml and have that information display when the ?WSDL is viewed?

I'm using 3.5 Framework and Webservices.   Any help greatly appreciated

<s:element name="GetXmlDocument1">
- <s:complexType>
- <s:sequence>
- <s:element minOccurs="0" maxOccurs="1" name="xmlInput">
- <s:complexType mixed="true">
- <s:sequence>
  <s:any /> 
  </s:sequence>
  </s:complexType>
  </s:element>
  </s:sequence>
  </s:complexType>
  </s:element>

- <s:element name="GetXmlDocument2">
- <s:complexType>
- <s:sequence>
  <s:element minOccurs="0" maxOccurs="1" name="xmlInput" type="s:string" /> 
  </s:sequence>
  </s:complexType>
  </s:element>

Open in new window

[WebMethod]
        public string GetXmlDocument(XmlDocument xmlInput)
        {
            return string.Empty;
        }

        [WebMethod]
        public string GetXmlDocument(string xmlInput)
        {

        }

Open in new window

0
Comment
Question by:escheider
2 Comments
 
LVL 41

Accepted Solution

by:
graye earned 1000 total points
ID: 35746436
The WSDL standard has a "documentation" element which can contain anything you want.  In your case I'd recommend that you add some text and a hyperlink to download the XSD file (rather than just dumping the XSD on the screen)
0
 
LVL 4

Author Closing Comment

by:escheider
ID: 35841919
So sorry for the delayed response.   This solution will provide exactly what I need ..  thank you very much.
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

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

Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
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…
Loops Section Overview
Suggested Courses
Course of the Month10 days, 10 hours left to enroll

571 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