11/22/2024 9:55:45 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss general external development topic (related or not to SalesLogix development). View the code of conduct for posting guidelines.
|
|
|
|
Posting to SDATA from Java fails
Posted: 23 Jan 09 6:26 AM
|
Hi all. I consume a webservice via a URI. I'm able to get the xml and change the element text. However, when I PUT the changed data to the server, the server response code is 200 but the data on the server never changed.
The server logs say: Event Type: Information Event Source: Services Event Category: None Event ID: 0 Date: 2009/01/23 Time: 14:05:14 User: N/A Computer: xxx Description: 2009-01-23 14:05:14,250 [10] DEBUG Sage.SalesLogix.Orm.EntityBase [(null)] - OnBeforeLoad, Type=AccountSummary, ID=A6UJ9A000036 For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp
and
Event Type: Information Event Source: Services Event Category: None Event ID: 0 Date: 2009/01/23 Time: 14:05:14 User: N/A Computer: xxx Description: 2009-01-23 14:05:14,250 [10] DEBUG Sage.SalesLogix.Orm.EntityBase [(null)] - OnBeforeLoad, Type=Account, ID=A6UJ9A000036 For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp
and one for every element that I'm trying to post.
Does anyone have any idea what these error messages mean? How do I fix this. Your help will be appreciated.
|
|
|
|
Re: Posting to SDATA from Java fails
Posted: 28 Jan 09 8:41 AM
|
So an exception is being thrown in the OnBeforeLoad of the web application. I would look at the rule and see what is it is trying to do. Maybe there is a piece of information required that is not supplied.
Good Luck on it. |
|
|
|
Re: Posting to SDATA from Java fails
Posted: 28 Jan 09 11:21 AM
|
Thank you for the reply, Mark. You are correct in your diagnosis that information was missing. I was having a hard time making up the correct SAX document to pass back to the slx server. I solved this by downloading the xml from a known working URI. I parsed that xml from the file to see if it posted. It did. Then I started stripping elements until I came down to the minimum xml needed to PUT to the server.
My procedure was: 1) Download the xml from the URI using jdom and a xerces parser (the default one with jdom). 2) Extract the root and child elements and add to an ArrayList 3)Manipulate the data 4) Compose a string from this data in the format deduced from experimenting with the file mentioned in the first paragraph. 5) Parse this string with jdom into a SAX document and PUT to the server. Voila.
Some observations: 1) omit the prologue (delete it) if you're parsing with jdom. Jdom adds its own prologue when parsing into a SAX/DOM document. 2) If you are PUTting elements to the server and you omit one, that field will be updated on the server with a null value. |
|
|
| |
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|