X-Application Version: 3.1.2, 3.1.1
Tamino Version : 3.1.1
Platform : Win2k,
WebContainer : Tomcat 4.0
JDK Version : 1.3.1
Hey all,
I’m having a problem while using the Java API with X-app.
The Problem occurs when I use the read() method. One of the parameters it accepts is a document string which I cannot figure out what to name as. Also the second string is an ID which is passed.
I am creating an application to help a user select a particular car, and then help him select a list of accessories using checkboxes, which we have already been able to link with the site. The next step is to compute the total cost of all the accessories that the user selects with the checkboxes and displays the results. We used the following lines of code but havea few errors creeping up.
<% SessionContext sessionContext = ServletSessionContext.getSessionContext(pageContext);
BusinessDocumentWorkspace ws = sessionContext.getWorkspace();
double sum=0;
for (int i = 0; i < values.length; i++) {
BusinessDocument doc = ws.read(“current”, “/car/accessory[ino:id=”+ values[i] + “]”);
sum += Double.parseDouble(doc.getRoot().getDescendant(“accprice”).getValue());
}
%>
I am getting the following error,
javax.servlet.ServletException: more than one element found in database: /car/accessory[ino:id=‘1’]
The structure of the XML is :
|
|
|
|
|
|
I am including all the files i am using in the project. Can someone please tell me where I am going astray?
Thanks,
Parth
#API-Management#Tamino#webMethods