Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 4. Web services > Configuring a Web service to update a record

Configuring a Web service to update a record

This recipe describes the steps required to configure a Web service to update a record in a table using the generic API, updateData&;.

How to do it...

  1. Log in to ADempiere using GardenUser/GardenUser with the GardenWorld User role.

  2. Go to the Web Service Security window.

  3. Click on the New Record and enter the following, as shown in the next screenshot:

    • Search Key: UpdateBP&;artner (choose your text)

    • Name: Update B&;Partner (choose your text)

    • Web Service: Model Oriented Web Services

    • Web Service Method: Update Data_Model Oriented Web Services

    • Table: C_BPartner_Business Partner

    • Description: <your description of service>

    • Comment/Help: <your text>

  4. Go to the Web Service Parameter tab and create the following parameters, as shown in the next screenshot:

    • TableName: Set this to C_BPartner

    • RecordID:&; The value for this will be passed from the Web service request

    • Action: S&;et this to Update

  5. Go to the Web Service Field Input tab and enter the following Columns, as shown in the next screenshot:

    • Name2_Name 2

  6. Go to the soapUI client and run the following SOAP request:

    <soapenv:&;Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:adin="http://3e.pl/ADInterface">
    <soapenv:Header/>
    <soapenv:Body>
    <adin:updateData>
    <adin:ModelCRUDRequest>
    <adin:ModelCRUD>
    <adin:serviceType>UpdateBPartner</adin:serviceType>
    <adin:TableName>C_BPartner</adin:TableName>
    <adin:RecordID>1000003</adin:RecordID>
    <adin:Action>Update</adin:Action>
    <!--Optional:-->
    <adin:DataRow>
    <!--Zero or more repetitions:-->
    <adin:field column="Name2">
    <adin:val>UIT Bank</adin:val>
    <!--Optional:-->
    </adin:field>
    </adin:DataRow>
    </adin:ModelCRUD>
    <adin:ADLoginRequest>
    <adin:user>GardenUser</adin:user>
    <adin:pass>GardenUser</adin:pass>
    <adin:lang>192</adin:lang>
    <adin:ClientID>11</adin:ClientID>
    <adin:RoleID>103</adin:RoleID>
    <adin:OrgID>11</adin:OrgID>
    <adin:WarehouseID>103</adin:WarehouseID>
    <adin:stage>0</adin:stage>
    </adin:ADLoginRequest>
    </adin:ModelCRUDRequest>
    </adin:updateData>
    </soapenv:Body>
    </soapenv:Envelope>
    
    
    					  

    In the preceding request, 1000003 is the RecordID returned as part of the CreateBPartner service calls.

    The following is the response you will receive, indicating that the business partner has been updated in the system:

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soap:Body>
    <ns1:updateDataResponse xmlns:ns1="http://3e.pl/ADInterface">
    <StandardResponse RecordID="1000003" xmlns="http://3e.pl/ADInterface"/>
    </ns1:updateDataResponse>
    </soap:Body>
    </soap:Envelope>
    
    
    					  
  7. Go to the Business Partner window and verify that the Name 2 field is updated.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint