Solved

Example of a Service Contract in XML format

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

751 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