Solved

Example of a Service Contract in XML format

Posted on 2006-06-28
2
301 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SHA2 certs for IIS AND Java? 2 122
hibernate example using maven 12 77
maven disable workspace resolution 1 38
Java class and jar 3 42
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
In this post we will learn different types of Android Layout and some basics of an Android App.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

749 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