cancel
Showing results for 
Search instead for 
Did you mean: 

How to send empty tags via SOAP webservice from ByDesign?

georgk
Participant
0 Kudos

Dear community,

we have an integration between ByDesign and Cloud for Customer based on their standard SOAP-webservice interfaces. Creating and Updating business objects is done by using the Manage-webservices (e.g. ManageCustomerIn).

Unfortunately, we are experiencing problems with deleting values of fields via the webservice interfaces due to the SOAP-clients that are generated by ByD and C4C.

When building the SOAP-request in ABSL we set every field, although the field might be empty in order to synchronize the deletion of field values.

Example:

The name of an organisation covers two fields:

1) Customer.CurrentCommon.Organisation.Name.FirstLineName = "ABC Company"

2) Customer.CurrentCommon.Organisation.Name.SecondLineName = "Manchester Store"

Some time after these fields were both set in ByD and C4C a user decides to delete the SecondLineName in ByD.

The generated ABSL-client of the C4C ManageCustomerIn SOAP service produces the following request, which lacks the tag for the SecondLineName:

<Customer actionCode="04" listCompleteTransmissionIndicator are omitted>

  <InternalID>1000482</InternalID>

    <Organisation>

      <FirstLineName>ABC Test 20151006-01</FirstLineName>

   </Organisation>

</Customer>

As the SecondLineName is empty in ByD, the request does not include the SecondLineName.

However, in order to delete the value "Manchester Store" in the SecondLineName the request should actually include an empty tag for this field:


<Customer actionCode="04" listCompleteTransmissionIndicator are omitted>

  <InternalID>1000482</InternalID>

    <Organisation>

      <FirstLineName>ABC Test 20151006-01</FirstLineName>

      <SecondLineName></SecondLineName>

    </Organisation>

</Customer>

Is there a way to force the ABSL-client to generate this empty tag?

I already tried setting the Request-variable to a space (" ") and an empty string ("") - neither worked.

Thanks for your help!

Best regards,

Georg

Accepted Solutions (1)

Accepted Solutions (1)

georgk
Participant

Dear community,

after some trial and error runs we were able to find a solution to this problem which I would like to share with you here:

To understand why ByD and C4C are behaving as they behave, we need to take a look at the SOAP-clients that are generated in the studio.

When consuming external SOAP webservices, the cloud application studio does not activate the Extended XML Handling. Because of this feature being inactive empty XML tags are not part of the actual submitted payload of SOAP calls. Therefore deleting a field value by submitting an empty xml-tag is not possible as the soap message simply does not include the xml-tag at all. This means the receiving side does not receive an update on this field and hence does not delete the value. The original value of the field remains.

The resolve this you have mainly two options:

1) Use "delete" strings

Instead of trying to send an empty xml-tag you change your client implementation to fill an agreed upon delete string (e.g. "[del]") as actual field value via SOAP and delete this value in the AfterModify/BeforeSave of the affected business object.

We tried this and were successful, however, this approach is not working for certain field types (e.g. CodeLists).

2) Change the cardinality of the fields in the WSDL file

By adapting the cardinality of the fields in the WSDL file to "1" by setting the attribute "minOccurs" (minOccurs="1"). This forces the soap-client to submit the tag even if it is empty. This produces the correct deleting functionality.

The downside is that whenever there's a change in the WSDL you have to adapt it, but I consider it to be the preferred solution over the usage of delete strings.

Thanks to Knut Heusermann who helped us in getting to the bottom of this problem!

If you have any questions don't hesitate to reach out to me.

Best regards,

Georg

Answers (1)

Answers (1)

knutheusermann
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Georg,

empty fields are not returned by ByD query and read web services and there is unfortunately no way to change that - sorry.

The ByD OData interface return empty fields, but I think for your scenario using web services is the by far better fit.

Maybe it would solve your requirement to agree on a well-defined list of fields that shall be synchronized and delete a field value in the target system, if the query/read response returns no data for this field.

Best regards,

Knut

georgk
Participant
0 Kudos

Hi Knut,

thanks for the help! It is very unfortunate to see that there is no way to change that.

Do you have any expierence regarding the performance impact of additional query and read operations?

We have continuous performance issues in the system of this customer and hence are very cautious with our integration....

Another solution we are currently evaluating is to use "delete"-strings as field values. When building the integration we check a defined field-list for empty values and place a delete-string in the SOAP request. In the receiving BO we have if-statements evaluating these fields and clearing the delete-strings.

Based on the tests we did in debugging mode this seems to be quite fast. However, we run into a huge configuration effort as the customer also wants to synchronize delete value for lists and adding a "delete" option to every code-list does not seem like a very handy solution. Do you maybe have an idea on how to handle this for code-lists?

Thanks and best regards,

Georg

knutheusermann
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Georg,

I would suggest to use web service ManageCustomerIn.MaintainBundle with empty elements to delete field values.

Example:

The maintain bundle request xml

deletes the value of field SecondLineName. All other fields, that are not part of the web service request xml will not be updated (for example the FirstLineName)

The ByD web service runtime processes write access web service requests as follows:

  • If a xml tag is missing in the web service request xml => no update on the corresponding field.
  • If a xml tag is part of the request xml, but empty => delete the value of the corresponding field respectively update the field with its initial value.

The web service request above takes less that 300 ms incl. network time and server time. Of cause the web service response time increases if you update customer sub-nodes or if you have a custom add-on in place.

Summarized:

  • Query and read services do not return empty elements.
  • Write services distinguish between non-existing and empty elements such that you can delete field values.

You find more details on SAP Help: Web Services

Best regards,

Knut

georgk
Participant
0 Kudos

Hi Knut,

Thanks for reply! I am not quite sure I understand what you are recommending...

In our scenario ByD is calling the ManageCustomerIn.MaintainBundle of C4C (and C4C is calling ByD as we have a bi-directional interface implementation).

Please note that:

  • ByD is the client of the C4C ManageCustomerIn webservice
  • C4C is the client of the ByD ManageCustomerIn webservice

The webservices were added as external SOAP webservices via the application studio in ByD and C4C.

The problem described above is that when ByD and C4C are calling the ManageCustomerIn webservices of the other system the empty fields are not transmitted as empty tags. Based on our observations empty fields are omitted (not part of the actual payload generated by ByD/C4C) and hence are not feasible with your suggestion to use "empty elements to delete field values".

Is this correct?

A possible solution you suggested was that we could use Query/Read services to find out if tags are missing in the response. Then we could also delete these in the BeforeSave after a ManageCustomerIn call of the affected objects. However, I'm not quite sure how the overall system performance (as this would run in the background without user interaction) would be affected by this.

Thanks and best regards,

Georg