Note that there are some explanatory texts on larger screens.

plurals
  1. POSAP Web Service from .NET via WCF
    text
    copied!<p>I'm trying to consume a SAP Web Service from .NET via WCF. I've generated the proxy and I have configured the app.config file. </p> <p>Here is my test code:</p> <pre><code>WebServiceSAP.ZTEST_RFCClient myWCFService = new WebServiceSAP.ZTEST_RFCClient("MyEndPoint"); myWCFService.ClientCredentials.UserName.UserName = "&lt;UserName&gt;"; myWCFService.ClientCredentials.UserName.Password = "&lt;Password&gt;"; WebServiceSAP.ZTestRfc parameter = new WebServiceSAP.ZTestRfc(); parameter.TestInput = "This is a simple test"; WebServiceSAP.ZTestRfcResponse response = myWCFService.ZTestRfc(parameter); Console.WriteLine(reponse.TestOutput); Console.ReadLine(); </code></pre> <p>The ZTestRFC SAP method is a very simple function that accepts an input string, and outputs: <code>"Result: &lt;the input string&gt;"</code></p> <p>When I call ZTestRFC method, I got a null value in variable response. But SOAP messages seem to be fine.</p> <p><strong>SOAP Request</strong></p> <pre><code>&lt;MessageLogTraceRecord&gt; &lt;HttpRequest xmlns="http://schemas.microsoft.com/2004/06/ServiceModel/Management/MessageTrace"&gt; &lt;Method&gt;POST&lt;/Method&gt; &lt;QueryString&gt;&lt;/QueryString&gt; &lt;WebHeaders&gt; &lt;VsDebuggerCausalityData&gt;uIDPoxJmI5NcDatNiPM/wFAr52kAAAAAtqHAVnNWjEeMpMExOyr/vN7OXwCJZltNnikldpg5migACQAA&lt;/VsDebuggerCausalityData&gt; &lt;/WebHeaders&gt; &lt;/HttpRequest&gt; &lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;s:Header&gt; &lt;Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none"&gt;urn:sap-com:document:sap:soap:functions:mc-style:ZTEST_RFC:ZTestRfcRequest&lt;/Action&gt; &lt;/s:Header&gt; &lt;s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; &lt;ZTestRfc xmlns="urn:sap-com:document:sap:soap:functions:mc-style"&gt; &lt;TestInput xmlns=""&gt;This is a simple test&lt;/TestInput&gt; &lt;/ZTestRfc&gt; &lt;/s:Body&gt; &lt;/s:Envelope&gt; &lt;/MessageLogTraceRecord&gt; </code></pre> <p><strong>SOAP Response</strong></p> <pre><code>&lt;MessageLogTraceRecord&gt; &lt;HttpResponse xmlns="http://schemas.microsoft.com/2004/06/ServiceModel/Management/MessageTrace"&gt; &lt;StatusCode&gt;OK&lt;/StatusCode&gt; &lt;StatusDescription&gt;OK&lt;/StatusDescription&gt; &lt;WebHeaders&gt; &lt;Content-Length&gt;359&lt;/Content-Length&gt; &lt;Content-Type&gt;text/xml; charset=utf-8&lt;/Content-Type&gt; &lt;Set-Cookie&gt;MYSAPSSO2=AjExMDABAAxQMDEwMDA1MSAgICACAAMwNDADAAhEMTEgICAgIAQADDIwMTAxMTEwMTIwOQUABAAAAAgGAAFYCQABU%2f8A9jCB8wYJKoZIhvcNAQcCoIHlMIHiAgEBMQswCQYFKw4DAhoFADALBgkqhkiG9w0BBwExgcIwgb8CAQEwEzAOMQwwCgYDVQQDEwNQMTECAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTEwMTExMDEyMDk0OFowIwYJKoZIhvcNAQkEMRYEFJC%2fNFLVBnu1ZAodWTlPApEs8sApMAkGByqGSM44BAMEMDAuAhUBS844BOB%2f8NgEGuepMgLaKbVEGGUCFQFLs6HiI%21BWT1MejMqvABd3%2fJFVMw%3d%3d; path=/; domain=.&lt;domain ... &gt;&lt;/Set-Cookie&gt; &lt;Server&gt;SAP NetWeaver Application Server / ABAP 700&lt;/Server&gt; &lt;/WebHeaders&gt; &lt;/HttpResponse&gt; &lt;SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;s:Header xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;/s:Header&gt; &lt;SOAP-ENV:Body&gt; &lt;rfc:ZTestRfcResult xmlns:rfc="urn:sap-com:document:sap:soap:functions:mc-style"&gt; &lt;TestOutput xmlns=""&gt;Result:&lt;/TestOutput&gt; &lt;/rfc:ZTestRfcResult&gt; &lt;/SOAP-ENV:Body&gt; &lt;/SOAP-ENV:Envelope&gt; &lt;/MessageLogTraceRecord&gt; </code></pre> <p>I don't know what could be happening. Any ideas?</p> <p>Thanks in advance</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload