c# - Returning response message from self hosted web service and is it soap? -
currently have small client:
static void main(string[] args) { myservice.calculatorclient ws = new myservice.calculatorclient(); ws.open(); console.readline(); ws.xml("<document></document>"); ws.close(); console.readline(); }
which works fine sends string web service , generate xml , store somewhere.
i response though, if use wcftestclient.exe see response.
<s:envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"> <s:header> <a:action s:mustunderstand="1">http://microsoft.servicemodel.samples/icalculator/xmlresponse</a:action> <a:relatesto>urn:uuid:325d2f97-c1f0-4b66-912a-d9b3a6b097a7</a:relatesto> </s:header> <s:body> <xmlresponse xmlns="http://microsoft.servicemodel.samples"> <xmlresult>success</xmlresult> </xmlresponse> </s:body> </s:envelope>
i return client console app , display it. however, having hard time getting display. made string public @ web service not able return it.
my other question is...if soap xml web service soap service haven't declared defines being soap or how turn soap. here app.config:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.servicemodel> <services> <!-- section optional new configuration model introduced in .net framework 4. --> <service name="microsoft.servicemodel.samples.calculatorservice" behaviorconfiguration="calculatorservicebehavior"> <host> <baseaddresses> <add baseaddress="http://localhost:8000/servicemodelsamples/service"/> </baseaddresses> </host> <!-- endpoint exposed @ base address provided host: http://localhost:8000/servicemodelsamples/service --> <endpoint address="" binding="wshttpbinding" contract="microsoft.servicemodel.samples.icalculator" bindingconfiguration="custombinding" /> <!-- mex endpoint exposed @ http://localhost:8000/servicemodelsamples/service/mex --> <endpoint address="mex" binding="mexhttpbinding" contract="imetadataexchange" /> </service> </services> <bindings> <wshttpbinding> <binding name="custombinding" closetimeout="00:02:00" opentimeout="00:02:00" receivetimeout="00:10:00" sendtimeout="00:02:00"> <security mode="none"> <message establishsecuritycontext="false"/> <transport clientcredentialtype="none"/> </security> </binding> </wshttpbinding> </bindings> <behaviors> <servicebehaviors> <behavior name="calculatorservicebehavior"> <servicemetadata httpgetenabled="true"/> <servicedebug includeexceptiondetailinfaults="true"/> </behavior> </servicebehaviors> </behaviors> </system.servicemodel> </configuration>
soap mentioned in beginning of response, mean soap connection though didn't establish or configure be?
thanks appreciated.
Comments
Post a Comment