SOAP API Acton timeout

This is sort of a duplicate of this post here, but I don’t think it was ever resolved really.

I’m having an issue getting the end time to work. I was able to figure out the start time, just not end time. I did find it odd that the “settings” node has to be in an order. I put in HasStartTime after StartDateTimeLocalOffset originally, and it came back with an error. but when I flipped it, it worked fine. I have played with flipping things around before and after others in Settings and haven’t found anything that works. Here’s the XML I’m trying to post. It works without the end time.

<BES>
<SourcedFixletAction>
	<SourceFixlet>
		<Sitename>BES Servers</Sitename>
		<FixletID>62278</FixletID>
		<Action>Action1</Action>
	</SourceFixlet>
	<Target><ComputerName>myserver</ComputerName></Target>
	<Parameter Name="_file_name">JSONTEST.tar</Parameter>
	<Settings>
		<HasEndTime>true</HasEndTime>
		<EndDateTimeOffset>P4DT15H</EndDateTimeOffset>
		<HasStartTime>true</HasStartTime>
		<StartDateTimeLocalOffset>P0DT2H36M00S</StartDateTimeLocalOffset>
		<PreActionCacheDownload>true</PreActionCacheDownload>
	</Settings>
</SourcedFixletAction>
</BES>

When ever I put in HasEndTime with EndDateTimeOffset, I get the below json return.

{"format":"Unexpected server error: {message}","arguments":["XML parsing error: element \u0027HasStartTime\u0027 is not allowed for content model \u0027(HasMessage?,Message?,ActionUITitle?,PreActionShowUI?,PreAction?,HasRunningMessage?,RunningMessage?,HasTimeRange?,TimeRange?,HasStartTime?,(StartDateTimeOffset?|StartDateTimeLocalOffset?),HasEndTime?,(EndDateTimeOffset?|EndDateTimeLocalOffset?),HasDayOfWeekConstraint?,DayOfWeekConstraint?,UseUTCTime?,ActiveUserRequirement?,ActiveUserType?,UIGroupConstraints?,HasWhose?,Whose?,PreActionCacheDownload?,Reapply?,HasReapplyLimit?,ReapplyLimit?,HasReapplyInterval?,ReapplyInterval?,HasRetry?,RetryCount?,RetryWait?,HasTemporalDistribution?,TemporalDistribution?,ContinueOnErrors?,PostActionBehavior?,IsOffer?,AnnounceOffer?,OfferCategory?,OfferDescriptionHTML?)\u0027 Line 2, Character 615"]}

I’m not quite sure what “element \u0027 HasStartTime \u0027 is not allowed for content model” means. Where do I get such a model?

Thanks in advance!

You have the order wrong.

 <Settings>
   <HasStartTime>true</HasStartTime>
   <StartDateTimeLocalOffset>P0D</StartDateTimeLocalOffset>
   <HasEndTime>true</HasEndTime>
   <EndDateTimeLocalOffset>P31D</EndDateTimeLocalOffset>
 </Settings>

For some reason the order matters.

Oh yea, I did figure that out… I’m bad, should have posted my findings.

https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/BES.xsd

This xml (for whatever reason) has to be in an order, took me a big to figure how to read that xsd, but it’s all there.

<xs:element name=“HasStartTime” type=“xs:boolean” minOccurs=“0” />

xs:choice
<xs:element name=“StartDateTimeOffset” type=“TimeInterval” minOccurs=“0” />
<xs:element name=“StartDateTimeLocalOffset” type=“TimeInterval” minOccurs=“0” />
</xs:choice>

The other pain about that was you have to add the the start time to the end time. So if you actually want it to start in a day, but last for 2 days:

<Settings>
   <HasStartTime>true</HasStartTime>
   <StartDateTimeLocalOffset>P1D</StartDateTimeLocalOffset>
   <HasEndTime>true</HasEndTime>
   <EndDateTimeLocalOffset>P3D</EndDateTimeLocalOffset>
 </Settings>
2 Likes

It definitely took me a while to figure things out from the XSD as well, but I have worked with XSDs in the past so I wasn’t completely lost.

It is odd that with BigFix order in XML matters sometimes more than others.