Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>this is sample code which communicate with a WCF Restful service the client codes must be something like this </p> <pre><code>String uri = "http://youraddress:youport/" + serviceUri + "/" + methodName; HttpPost request = new HttpPost(uri); request.setHeader("Accept", "application/json"); request.setHeader("Content-type", "application/json"); JSONStringer requestMsg = new JSONStringer(); //you must fill data to this object StringEntity msg = new StringEntity(requestMsg.toString()); msg.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE, "application/json")); msg.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json")); request.setEntity(msg); DefaultHttpClient httpClient = new DefaultHttpClient(); HttpResponse response = httpClient.execute(request); </code></pre> <p>if you use wcf services as your application server, this is a sample code</p> <pre><code> [ServiceContract(Namespace = "http://schema.abc.com/2012/01/MyServices")] public interface IMyServices{ [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "SubmitData", BodyStyle = WebMessageBodyStyle.WrappedRequest, ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)] IList&lt;CustomeClass&gt; SubmitData(CustomeClass message); } </code></pre> <p>you must implement the custom class and also the service method body,<br> and this is config file this , albeit you must satisfy details , but main pattern is this</p> <pre><code> &lt;service name="MyServices"&gt; &lt;endpoint address="" behaviorConfiguration="httpBehavior" binding="webHttpBinding" contract="IMyServices" /&gt; &lt;/service&gt; &lt;endpointBehaviors&gt; &lt;behavior name="httpBehavior"&gt; &lt;webHttp/&gt; &lt;/behavior&gt; &lt;/endpointBehaviors&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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. This table or related slice is empty.
    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