LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-13-2007, 10:11 AM   #1
true_atlantis
Member
 
Registered: Oct 2003
Distribution: fedora cor 5 x86_64
Posts: 639

Rep: Reputation: 30
Java XML client from xsd


So, I am pretty new to XML in general, and am confused about the whole style sheet concept. First, I have been using 'org.apache.xmlrpc.client.XmlRpcClient' to send XML requests, but have been given specific XML functions with the arguments that the XML functions are expecting. Now, all I have are many XML style sheets and am trying to get a feel for how to understand the format of the xsd. For example, I have:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:include schemaLocation="archer.xsd"/>
	<xs:element name="CreateNDTicket">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="Request">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="RequestHeader" type="RequestHeaderType"/>
							<xs:element name="RequestBody">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="CreateCriteria">
											<xs:complexType>
												<xs:sequence>
													<xs:element name="SystemId" type="xs:string"/>
													<xs:element name="IndicatorCity" type="xs:string"/>
													<xs:element name="IndicatorState" type="xs:string"/>
													<xs:element name="AlarmStart" type="DateTimeType"/>
													<xs:element name="AttributeList" type="AttributeListType"/>
													<xs:element name="ContactInformation" type="ContactInformationType"/>
													<xs:element name="NextAction" type="xs:string" minOccurs="0"/>
													<xs:element name="ProblemCode" type="xs:string"/>
													<xs:element name="Source" type="xs:string"/>
													<xs:element name="SourceReference" type="xs:string"/>
													<xs:element name="ServiceAffected" type="xs:boolean"/>
													<xs:element name="Worklog" type="WorklogType" minOccurs="0"/>
												</xs:sequence>
											</xs:complexType>
										</xs:element>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:element name="Response" minOccurs="0">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="ResponseHeader" type="ResponseHeaderType"/>
							<xs:element name="ResponseBody" minOccurs="0">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="TicketId" type="xs:string"/>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>

Does this mean there is a function called CreateNDTicket that is expecting the arguments SystemId, IndicatorCity, ... , Worklog (variable types defined by xs:string/boolean etc)? Or does it mean there is a function called CreateNDTicket that is expecting an array that starts with 'Request' and contains another array with 'RequestHeader' which contains another array 'RequestBody' etc? Or, am I way off?

I know that types like 'DateTimeType' are defined in the included archer.xsd file.

Thanks.

Last edited by true_atlantis; 09-13-2007 at 10:27 AM.
 
Old 09-13-2007, 06:25 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

Basically, you're way off.

XML involves a whole, big alphabet soup of different things. XSL and XSLT ("Style sheets") have to do with translating an XML document into something else (for example, into a .pdf or an .html document; or into another, different XML document). That's not what you're doing here.

XSD (XSchema Definition) has to do with defining structured data. Your "CreateNDTicket" is a *record*. It happens to define a SOAP message that you happen to be using in a web service - but it's still "data", not a "function".

It sounds like you're trying to familiarize yourself with Web Services. I'd suggest picking any one API that's convenient (for example, Microsoft C# or ASP.Net, or Java Glassfish - whatever works best for you), start with some simple "hello world" web services, and work your way out from there:

https://glassfish.dev.java.net//

'Hope that helps .. PSM

Last edited by paulsm4; 09-13-2007 at 06:27 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Review: Java and XML LXer Syndicated Linux News 0 01-19-2007 01:24 AM
Java code to compare XML like ExamXML alapick Programming 1 06-29-2006 05:43 AM
java - verifying XSD 0raven0 Programming 1 03-08-2006 12:02 PM
java and xml infected Programming 2 11-26-2004 02:28 AM
Javascript/XML client side coding on Linux mkrathi Programming 0 10-04-2004 08:13 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration