• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Web Service
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Web Service


  • Subject: Re: Web Service
  • From: Jacky Gagnon <email@hidden>
  • Date: Fri, 8 Apr 2005 15:43:03 -0400

Hi Jeff,

If your list is static, maybe the PropertyList (plist) format is your answer; with developer tools you can find "Property List Editor" for editing these files.

More info :
http://developer.apple.com/documentation/WebObjects/Reference/API/com/webobjects/foundation/NSPropertyListSerialization.html

An example for reading plist :

Object objetSerial = null;//ex: can be NSArray or NSDictionary


Application application = (Application) WOApplication.application();
WOResourceManager resourceManager = application.resourceManager();
InputStream inputStream = resourceManager.inputStreamForResourceNamed(nom, null, null);


try {
NSData data = new NSData(inputStream, inputStream.available());
objetSerial = NSPropertyListSerialization.propertyListFromData(data, _NSUtilities.UTF8StringEncoding);
}catch (Exception exception) {
....
}


return objetSerial;


Jacky


On 05-04-08, at 15:15, Jeff Pearson wrote:

Forgive the beginner question.

I am a Java Developer trying to migrate to using WebObjects.

What I would like to create is a simple web service.

I have an xml file with info for US States. Sample follows:

<state>
<abbreviation>AL</abbreviation>
<capitalcity>Montgomery</capitalcity>
<dateofstatehood>1819.12.14</dateofstatehood>
<name>Alabama</name>
</state>
<state>
<abbreviation></abbreviation>
<capitalcity>Juneau</capitalcity>
<dateofstatehood>1959.1.3</dateofstatehood>
<name>Alaska</name>
</state>

I would like to use this xml file as a data source for the web service. For example, I would like an application to connect to this web service to get a list of the state names and their abbreviations for populating a drop down list.

I had in mind that I could use the EOModeler to build the state objects directly from the xml file. But I dno't really see anyone else doing this. It seems a waste to use a full db engine for a static list (as in the values would NEVER change) such as this.

In my novice ignorance:

1) CAN you use an xml file directly as the datasource for EOModeler?
2) If so, can someone point me to some examples so I can get moving on this learning curve.....

Any help is greatly appreciated.

Jeff Pearson

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Web Service (From: Jeff Pearson <email@hidden>)

  • Prev by Date: Web Service
  • Next by Date: WebObjects Developer Opportunity
  • Previous by thread: Web Service
  • Next by thread: WebObjects Developer Opportunity
  • Index(es):
    • Date
    • Thread