473,666 Members | 2,539 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validating XML in a WebMethod parameter

Hi,
I've set up a SoapExtension class and XSD schema in order to validate the
parameters of a webservice method call. However, I'm having a problem with
one of the parameters - it's a string which accepts an XML fragment and I
can't get it to validate using the schema. I need to go back to basics with
this I think - can anyone point me to examples/articles of this technique?

i.e. How do I define a webmethod parameter in the XSD schema that will
validate an XML fragment? It's very simple XML too :-) e.g.

<nodea>
<nodeb id="..." />
<nodeb id="...">
<nodec>abc</nodec>
</nodeb>
</nodea>

Thanks.
Bill
Jun 19 '06 #1
1 2084
Hi Bill,

Do you need to validate it with a webservice method or directly in the
schema? If using a method, you can define the parameter as an XmlFragment.
If it loads corrects, it is validate. If there is any misunderstandin g
here, please feel free to let me know.

Kevin Yu
Microsoft Online Community Support

=============== =============== =============== =============== =============== =
=============== ===========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =============== =============== =
=============== ===========

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jun 20 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5723
by: Alin Popovici | last post by:
Hi! I have this problem. I am sending as a parameter for a webmethod a string containing '\r\n' sequences. For some reason, when I debug my webmethod, the paramter is received with the carriage return characters ('\r') stripped. Can someone try this by creating a simple webmethod that takes a string as a parameter and returns the same string back. On the client, create a proxy, call the webmethod and pass: "bla\r\nbla". If you put a...
24
2268
by: Joseph Geretz | last post by:
Up to this point, our application has been using Windows File Sharing to transfer files to and from our application document repository. This approach does not lend itself toward a secure environment and so we are in the process of imposing a WebService gateway between our application client and the repository. (As a starting point, the WebService won't be a richly featured application server; business rules are still implemented in the...
0
2688
by: Ramil Domingo | last post by:
Is there a way to describe a web method in a more structured way like describing the parameters in the web method in a multi-line approach? An example would be. <WebMethod(Description:= "My Web Method! Param1: Parameter 1 Param2: Parameter 2 Return: String")> Then the output in the browser would be
5
10365
by: LS | last post by:
Can a WebMethod return an Interface type? Can we pass an interface parameter ? Example : public interface IEntity { long Id { get; set; } string Name { get; set; } }
2
2840
by: Peter McEvoy | last post by:
Folks, I've been building a Webservice API for a contract that will be exposed to the internet at large. There are two endpoints, and each endpoint contains a number of webmethods. Every webmethod returns a returncode which indicates the level of success in performing the operation (as well as the actual results of the call in an "out" parameter) They have a requirement that when they want to perform maintenance on the backend system,...
2
6837
by: MrDotNet | last post by:
Hi I want pass NameValueCollection as parameter in webmethod. I try it but that give me error. Here is Error. You must implement the Add(System.String) method on System.Collections.Specialized.NameValueCollection because it inherits from ICollection. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in...
5
1630
by: John | last post by:
Hi Is it possible to pass a whole record to a webmethod? How? Thanks Regards
1
649
by: Cesar | last post by:
Hello, I've developed a .NET C# web service; which has one method named, let's say, upload_your_data. This method has one parameter ( string your_data). The value that this parameter will actually have is the content of a XML document. This data will be processed and check for a well-formed xml document and will be validated against a XSD. Before putting my code, let me go on and explain the whole situation. This web method is invoked...
0
455
by: BillAtWork | last post by:
Hi, I've set up a SoapExtension class and XSD schema in order to validate the parameters of a webservice method call. However, I'm having a problem with one of the parameters - it's a string which accepts an XML fragment and I can't get it to validate using the schema. I need to go back to basics with this I think - can anyone point me to examples/articles of this technique? i.e. How do I define a webmethod parameter in the XSD schema...
1
2018
by: chaitanya02 | last post by:
Hello All, Can anyone help me in passing a Datetime parameter to a webmethod, please? *declaration datetime datetime1; webmethod(out string datetime1); is it the right way of declaring a datetime variable..
0
8883
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8787
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8561
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8645
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7389
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4200
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2776
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2013
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.