SAP Web Service from .NET via WCF -


i'm trying consume sap web service .net via wcf. i've generated proxy , have configured app.config file.

here test code:

webservicesap.ztest_rfcclient mywcfservice = new webservicesap.ztest_rfcclient("myendpoint");  mywcfservice.clientcredentials.username.username = "<username>"; mywcfservice.clientcredentials.username.password = "<password>";  webservicesap.ztestrfc parameter = new webservicesap.ztestrfc(); parameter.testinput = "this simple test";  webservicesap.ztestrfcresponse response = mywcfservice.ztestrfc(parameter);  console.writeline(reponse.testoutput); console.readline();             

the ztestrfc sap method simple function accepts input string, , outputs: "result: <the input string>"

when call ztestrfc method, got null value in variable response. soap messages seem fine.

soap request

<messagelogtracerecord> <httprequest xmlns="http://schemas.microsoft.com/2004/06/servicemodel/management/messagetrace"> <method>post</method> <querystring></querystring> <webheaders> <vsdebuggercausalitydata>uidpoxjmi5ncdatnipm/wfar52kaaaaatqhavnnwjeempmexoyr/vn7oxwcjzltnnikldpg5migacqaa</vsdebuggercausalitydata> </webheaders> </httprequest> <s:envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:header> <action s:mustunderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">urn:sap-com:document:sap:soap:functions:mc-style:ztest_rfc:ztestrfcrequest</action> </s:header> <s:body xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> <ztestrfc xmlns="urn:sap-com:document:sap:soap:functions:mc-style"> <testinput xmlns="">this simple test</testinput> </ztestrfc> </s:body> </s:envelope> </messagelogtracerecord> 

soap response

<messagelogtracerecord> <httpresponse xmlns="http://schemas.microsoft.com/2004/06/servicemodel/management/messagetrace"> <statuscode>ok</statuscode> <statusdescription>ok</statusdescription> <webheaders> <content-length>359</content-length> <content-type>text/xml; charset=utf-8</content-type> <set-cookie>mysapsso2=ajexmdabaaxqmdewmda1msagicacaamwndadaahemtegicagiaqaddiwmtaxmtewmtiwoquabaaaaaggaafycqabu%2f8a9jcb8wyjkozihvcnaqccoihlmihiagebmqswcqyfkw4dahofadalbgkqhkig9w0bbwexgciwgb8caqewezaomqwwcgydvqqdewnqmtecaqawcqyfkw4dahofakbdmbggcsqgsib3dqejazelbgkqhkig9w0bbwewhayjkozihvcnaqkfmq8xdtewmtexmdeymdk0ofowiwyjkozihvcnaqkemryefjc%2fnflvbnu1zaodwtlpapes8sapmakgbyqgsm44bamemdauahubs844bob%2f8ngeguepmglakbveggucfqfls6hii%21bwt1mejmqvabd3%2fjfvmw%3d%3d; path=/; domain=.<domain ... ></set-cookie> <server>sap netweaver application server / abap 700</server> </webheaders> </httpresponse> <soap-env:envelope xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> <s:header xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"></s:header> <soap-env:body> <rfc:ztestrfcresult xmlns:rfc="urn:sap-com:document:sap:soap:functions:mc-style"> <testoutput xmlns="">result:</testoutput> </rfc:ztestrfcresult> </soap-env:body> </soap-env:envelope> </messagelogtracerecord> 

i don't know happening. ideas?

thanks in advance

offhand, looks when created proxy (btw, technique did use that?), sap told .net parameter , response in namespace, you're sending parameter in empty namespace (""). may why sap service returning "result:". may getting null response because proxy may expecting testoutput element in different namespace.

look @ generated proxy classes , see namespaces expected.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -