Solved

Example of a Service Contract in XML format

Posted on 2006-06-28
2
310 Views
Last Modified: 2013-11-19
Can someone provide an example of a Service Contract in XML format?  Any example would be great that provides detail about a particular service and how to use it.


thanks
0
Comment
Question by:jhughes4
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 17007401
A service contract is nothing else than a common interface to exchange information, basically a common format or request/reply. You initiate a request based on specific format and you receive an answer, again, on specific format. An XML service contract is nothing else than an XSD file that XML will comply to. Have a look here: http://www.w3schools.com/schema/default.asp for an XSD tutorial.
0
 
LVL 10

Accepted Solution

by:
mukundha_expert earned 500 total points
ID: 17008403
>>Any example would be great that provides detail about a particular service and how to use it.
Consider the schema for the Customer XML,
it defines the rules for (schema ) your Customer XML,

for e.g,

the root element is the customer,

the customer can have name,age,ID among which name,ID shoould occur and age may occur

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema targetNamespace="http://tempuri.org/XMLSchema.xsd" elementFormDefault="qualified"
      xmlns="http://tempuri.org/XMLSchema.xsd" xmlns:mstns="http://tempuri.org/XMLSchema.xsd"
      xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="Customer">
            <xs:complexType>
                  <xs:sequence>
                        <xs:element name="name" minOccurs = "1" maxOccurs = "1" type="xs:string" />
                        <xs:element name="age" minOccurs = "0" maxOccurs = "1"  type="xs:integer" />
                        <xs:element name="ID" minOccurs = "1" maxOccurs = "1" type="xs:string" />
                  </xs:sequence>
            </xs:complexType>
      </xs:element>
</xs:schema>



<Customer>
<name> name </name>
<age>10</age>
<ID>1</ID>
</Customer>

<Customer>
<name> name </name>
<ID>1</ID>
</Customer>

above two are valid,

but

<Customer>
<age>10</age>
<ID>1</ID>
</Customer>

<Customer>
<name> name </name>
<age>10</age>
</Customer>

<Customer>
<age>10</age>
</Customer>
are invalid or do not follow the rule

if you are using a validating parser , it will analyse the xml whether it is adhering to the rules
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to dynamically set the form action using jQuery.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

622 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