Changes via ERP SOAP are not persistent

Hi there,

I’m using the ERP SOAP interface to communicate with OXID (PE) using my Java client. I want to change a particular attribute for an article. I get the article using OXERPGetArticle, and then update it using OXERPSetArticle. The changes are not stored in the database however, even though the result of the operation is positive (biResult == true).

Here is a quick mockup:

[I]OXERPType articleBefore = service.OXERPGetArticle(sessionID, articleID);
getFieldValue(articleBefore, “OXDESC”); // “old description”

OXERPType opResult = service.OXERPSetArticle(sessionID,
new OXERPType[] { new OXERPType(new String[][] {{ “OXID”, articleID }, { “OXDESC”, “new description” } }, true, null) })[0];

opResult.isBlResult(); // true

OXERPType articleAfter = service.OXERPGetArticle(sessionID, articleID);
getFieldValue(articleAfter, “OXDESC”); // “old description” again, but should be “new description”[/I]

I’ve tried changing other attributes and objects as well (Category, User) but the changes are never stored. I’m running out of ideas and I need some help. Please advice.

Hi kgc,

actually, there’s no field like OXDESC, maybe this is already the reason. Please see the PHP script attached as an example how to handle OXSHORTDESC updates. Hope that helps :wink:

Regards

here you can check an (slightly outdated) Excel-file with the database-fields

http://wiki.oxidforge.org/File:Oxid_ce43x_mysql_admin_nomenklatur.xls

Hello,

Thank you for reply.

Actually, I used the field OXDESC just for the example. I’ve tried to change other fields also (including OXSHORTDESC), so this doesn’t seem to be the reason.

I’ve checked your PHP script and it worked, which confuses me even more since I don’t see any difference in my Java client.

From what I can tell, the OXERPSetArticle creates a new empty (!) article, instead of updating the existing one.

I may need to try some different WebService client (currently it is Apache Axis).

Best regards

Hello,

I just want to post an update since I have found the root of the problem.

The Java client is producing an invalid XML for the server. I’ve compared the messages generated by your script and my client and the there is a difference on how the OXERPType is being serialized:

PHP script:
<ns1:OXERPType>
<ns1:aResult>
<ns1:ArrayOfString>
<ns1:string>OXID</ns1:string>
<ns1:string>1221100</ns1:string>
</ns1:ArrayOfString>
<ns1:ArrayOfString>
</ns1:aResult>
<ns1:blResult>true</ns1:blResult>
<ns1:sMessage></ns1:sMessage>
</ns1:OXERPType>

Java Axis 1.3 client:
<OXERPType>
<aResult>
<ArrayOfString>
<ArrayOfString>OXID</ArrayOfString>
<ArrayOfString>1221100</ArrayOfString>
</ArrayOfString>
</aResult>
<blResult>true</blResult>
<sMessage></sMessage>
</OXERPType>

As you can see, the members in the list are named ArrayOfString instead of “string” and server ignores them.

This is a bug in Axis 1.3 and it is still unresolved.

Best regards.

Thanks for your feed back.

Regards