Skip to Content

Update ItemCode using B1WS

Hello,

I am using the B1WS (https://archive.sap.com/documents/docs/DOC-28658) with SAP Business One version 9.2 with a SQL Server 2016 back-end database. I have not had a problem updating most fields on Items using the ItemsService WSDL generated by "wsdl service generator" and the "http handler" endpoint.

I am able to update ItemCode values in SAP Business One on the Item Master Data form, but if I attempt to update the ItemCode through the Update web service, I receive a fault:

<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
   <env:Body>
      <env:Fault>
         <env:Code>
            <env:Value>env:Sender</env:Value>
            <env:Subcode>
               <env:Value>env:-1</env:Value>
            </env:Subcode>
         </env:Code>
         <env:Detail>
            <Service>ItemsService</Service>
            <Command>Update</Command>
            <SessionID>350B8EE5-BC41-4862-9996-5DFBFBC134A2</SessionID>
         </env:Detail>
      </env:Fault>
   </env:Body>
</env:Envelope>

I am guessing ItemCode is used as the unique identifier in the Update service. Is there any way to work around this using the B1WS, such as making some modification to the WSDL file? Or does the Interact method of the SBODI_Server.Node object from the SBODI_Server.dll allow for anything to be specified in the XML string that would allow the ItemCode to be updated?

I do not understand what exactly is happening when I update an ItemCode on the Item Master Data form, but I am hoping to be able to replicate that process through web service calls in an ASP.NET application.

Since the DI Server is an extension of the DI API, I am wanting to do something like below, but I need to interact with the DI Server more directly for performance reasons.

'after connecting to company

Dim myItem As SAPbobsCOM.Items
myItem = SAPCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems)
myItem.GetByKey("P000001")
myItem.ItemCode = "P000002" 'assuming this is a new unique ItemCode
myItem.Update()

Any help is appreciated.

Thanks!

Lucas

Add a comment
10|10000 characters needed characters exceeded

Related questions

0 Answers

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.