Skip to Content.
Sympa Menu

perfsonar-dev - Re: [pS-dev] [Fwd: RE: LS Functional tests]

Subject: perfsonar development work

List archive

Re: [pS-dev] [Fwd: RE: LS Functional tests]


Chronological Thread 
  • From: Jason Zurawski <>
  • To: Maciej Glowiak <>
  • Cc: Martin Swany <>, Perfsonar Development List <>, Michael Michalis <>
  • Subject: Re: [pS-dev] [Fwd: RE: LS Functional tests]
  • Date: Mon, 23 Oct 2006 10:05:36 -0400

Maciej & Michael;


I have found something else that seems weird to me. I have deliberately
malformed a request adding the serviceDescription element directly as a
child of the metadata element. I was expecting the response to return with
an error result code but it returned ok. Isn't this a violation of the
schema?

Technically no, the schema allows for the adding of 'anonymous' elements in certain parts of the document, for example in the metadata, data, and datum elements. From the schema document:

Metadata =
element nmwg:metadata {
(
Identifier &
MetadataIdentifierRef? &
MetadataContent
),
anyElement*
}

'anyElement' in this case can be just that, any XML element. In the Java classes we will add anything that resolves to an 'Element' into the childMap (From Metadata.java):

else if(!(newChild.getLocalName().equals(""))) { setChild((Element)newChild);
}
We originally allowed this to not be so rigid when it comes to accepting different messages that are not explicitly defined by a schema.

Or the handler doesn't worry about extra or misplaced elements
inside the metadata element, or any element?

So the answer to that is 'yes', the handler is not really concerned with 'misplaced' elements. If we did add schema verification to the process we could probably catch something like this. What did happen to the LS when you ran this test? You said you expected an error code, but did the LS behave as 'normal'?

This the 'wrong' part of the
request :

<nmwg:metadata id="serviceLookupInfo0">
<psservice:serviceDescription>A testing MA</psservice:serviceDescription>
- <perfsonar:subject id="commonParameters">
- <psservice:service id="serviceParameters">
<psservice:serviceName>My_MA</psservice:serviceName>

<psservice:accessPoint>http://register_request_2_1_0.net:8080/axis/services/
MA</psservice:accessPoint>
<psservice:serviceType>MA</psservice:serviceType>
</psservice:service>
</perfsonar:subject>
</nmwg:metadata>

As you can see the serviceDescription is a direct child of the metadata
element.



-jason





Archive powered by MHonArc 2.6.16.

Top of Page