Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>WCF will only ever transmit data - you <strong>cannot</strong> expose a "method" via WCF. </p> <p>WCF is a <strong>serialized messaging</strong> system - only serialized data travels between client and server - there is <strong>no other connection</strong> (no "remote object" or something like that) going on.</p> <p>But both <code>string</code> and <code>int</code> should be handled no problem.... </p> <p>Maybe you are stumbling over this behavior?? I don't fully understand where your problem is, too - what are you expecting, and what are you seeing instead?? What does your service method actually do in its implementation??</p> <p><strong>Update:</strong> when I do the same thing as you have, and then use <a href="http://msdn.microsoft.com/en-us/library/ms733025.aspx" rel="nofollow">WCF Tracing</a> to see what's happening, this is the request going into the service:</p> <pre><code>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;s:Header&gt; &lt;To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none"&gt;http://localhost:8433/Services/GetStuff&lt;/To&gt; &lt;Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none"&gt;http://tempuri.org/IGetStuffService/GetStuff&lt;/Action&gt; &lt;/s:Header&gt; &lt;s:Body&gt; &lt;GetStuff xmlns="http://tempuri.org/"&gt; &lt;data xmlns:a="http://schemas.datacontract.org/2004/07/wcf_test" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt; &lt;a:P_Integer&gt;5&lt;/a:P_Integer&gt; &lt;a:P_String&gt;Where to go for holidays...&lt;/a:P_String&gt; &lt;/data&gt; &lt;/GetStuff&gt; &lt;/s:Body&gt; &lt;/s:Envelope&gt; </code></pre> <p>So what is it you're not seeing that should be there??..... I clearly see both the integer and the string value in that SOAP message - as expected.</p> <p>Could it be you're not seeing your value of <code>1</code> because that's hidden away in the byte stream somewhere?? Try specifying some other value, like <code>4711067</code> or something - that won't get lost in your message....</p> <p>To enable WCF tracing, put these two sections into your <code>web.config</code> or <code>app.config</code> of your WCF service:</p> <pre><code>&lt;system.diagnostics&gt; &lt;sources&gt; &lt;source name="UserTraceSource" switchValue="Warning, ActivityTracing" &gt; &lt;listeners&gt; &lt;add name="xml" type="System.Diagnostics.XmlWriterTraceListener" initializeData="C:\logs\UserTraces.svclog" /&gt; &lt;/listeners&gt; &lt;/source&gt; &lt;/sources&gt; &lt;trace autoflush="true" /&gt; &lt;/system.diagnostics&gt; </code></pre> <p>(make sure the <code>C:\logs</code> directory exists before hand!!), and </p> <pre><code>&lt;system.serviceModel&gt; &lt;diagnostics&gt; &lt;messageLogging maxMessagesToLog="30000" logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="false" logMessagesAtTransportLevel="true"&gt; &lt;filters&gt; &lt;clear/&gt; &lt;/filters&gt; &lt;/messageLogging&gt; &lt;/diagnostics&gt; &lt;/system.serviceModel&gt; </code></pre> <p>Now you'll get <code>*.svclog</code> files in <code>C:\logs</code> - open Windows Explorer, double-click on them, and you should be taken into the <a href="http://msdn.microsoft.com/en-us/library/ms732023.aspx" rel="nofollow">WCF Trace Viewer</a> for analysis.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

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