cancel
Showing results for 
Search instead for 
Did you mean: 

.NET Connector XML naming conflict problem

Former Member
0 Kudos

The error I am getting seems to be a similar type to the error patched in OSS Note 506603 ( I have installed this patch already, as I was having XML naming conflict problems ). After installing the patch there are still some naming problems.

I create a proxy with three methods:

Bapi_Alm_Notif_Create

Bapi_Alm_Notif_Save

Bapi_Transaction_Commit

I create the proxy using:

SAPProxy1 proxy = new SAPProxy1(connectionString);

and I get the following error ( due to a naming conflict )

System.InvalidOperationException: Method SAPClient.CommitWork can not be reflected. ---> System.InvalidOperationException: The XML element named 'BAPI_TRANSACTION_COMMIT' from namespace 'urn:sap-com:document:sap:rfc:functions' references a method and a type. Change the method's message name using WebMethodAttribute or change the type's root element using the XmlRootAttribute.

NOTE: I can workaround this issue by changing the following lines in the SAPProxy1.cs file ( adding _RENAMED)

RequestElementName = "BAPI_TRANSACTION_COMMIT_RENAMED",

ResponseNamespace = "urn:sap-com:document:sap:rfc:functions",

ResponseElementName = "BAPI_TRANSACTION_COMMIT.Response_RENAMED")]

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Great!

Many thanks for this advice, I had the same problem.

Just one note, the posted correction contains an error, the correct strings are:

RequestElementName:="BAPI_TRANSACTION_COMMIT_RENAMED", _ ResponseNamespace:="urn:sap-com:document:sap:rfc:functions", _ ResponseElementName:="<b>BAPI_TRANSACTION_COMMIT_RENAMED.Response</b>")> _

reiner_hille-doering
Active Contributor
0 Kudos

Let me just mention that you shouldn't add BAPI_TRANSACTION_COMMIT to your poxy but use the builtin CommitWork() instead. That the builtin version doesn't have the Wait parameter is by intention (see the corresponding discussions).

The workarround mentioned only works for RFC and not for Soap.

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks, Reiner.

The only reason I was calling BAPI_TRANSACTION_COMMIT was that I ported my code from DCOM to the .NET connector. I was unaware that CommitWork was the method to use to replace

BAPI_TRANSACTION_COMMIT.

Former Member
0 Kudos

The CommitWork method will only be good if you are not trying to commit multiple transactions simultaneously. That is, if you are making multiple updates without a commit because you only want to commit if all updates are successful, then you can't reliably use the CommitWork method.