Problem with WCF client calling one-way operation

后端 未结 5 1184
不知归路
不知归路 2021-02-04 01:43

I have run into a problem when calling web service on a SAP PI bus from my WCF client. The operation is defined as one-way, and the method on my proxy operation contract is deco

相关标签:
5条回答
  • 2021-02-04 01:50

    I believe that this particular problem can be fixed by adding the following attribute declaration to the operation in the client porxy:

    [WebInvoke(BodyStyle = WebMessageBodyStyle.Wrapped)]

    0 讨论(0)
  • 2021-02-04 02:04

    It looks like SAP PI incorrectly sends an empty SOAP envelope and .NET incorrectly interprets that envelope.

    Some options from this thread:

    • alter the generated proxy and remove OneWay=true (or add OneWay=false) to the method definition
    • catch the Protocol Violation in an exception handler and ignore it
    • use a 2.0 style webreference to call the service
    • apply SAP patch Note 1459995 - Soap Sender Adapter HTTP 202 and add &responsecode202=true to the url

    The first and last options both worked for me. Further discussion on this sap.com thread.

    0 讨论(0)
  • 2021-02-04 02:06

    I would take a look at this article as well by Gerben van Loon here. One way operation might not really be one way according to the standards.

    0 讨论(0)
  • 2021-02-04 02:10

    Check this SAP thread out for the complete discussion: http://scn.sap.com/thread/1627368

    @Brian Low has answered this question correctly and very thoroughly (is should get marked as the answer).

    I would also like to add that this is a known error in which the SOAP Adapter does not comply with the aforementioned WS-I Basic Profile 1.1 (R2750) and WCF does not comply with (R2750). The result... Hours of wasted time and teeth gnashing....

    0 讨论(0)
  • 2021-02-04 02:10

    Without seeing what the signature of the method looks like, my best guess is that your method defined to return something other than "void". Since the operation is one-way, the method can only be defined using "void" (has no return). Anything else, and the operation is NOT one-way.

    0 讨论(0)
提交回复
热议问题