.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

How to set and map a Method in the Service file with endpoint elements and binding elements

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :WCF
Hi all, I have created a service file like OSService.svc in that i have two methods like one is FileUpload and FileDownload for e.g :- [WebInvoke(UriTemplate = "/fileupload/{fileName}" , Method = "POST" )]         [OperationContract]         void FileUpload(string fileName, Stream fileContents); same as Filedownload also. People you may know these methods are inside the interface of service file what you are using i'e i have created a interface as IOSService.cs. So, what i need now is i want to write separate endpoint for FileUpload and Filedownload.Because i want to set separate value for receiveTimeout  and openTimeout for the Fileupload and FileDownload process in binding section in the web.config file itself. The below code was i'm using right now but still i'm not able to the set separate value of endpoint elements in the bindings. EndPoint Section:- <endpoint name = "endPoint1"  address  = "localhost:8000/OSService.svc/" bindingConfiguration = "TransactionalTCP"   binding  = "netTcpBinding"          contract = "IOSService"/> Binding Section:-  <binding name = "TransactionalTCP"  transactionFlow = "true"   /&

View Complete Post

More Related Resource Links

How to update JavaScript in SharePoint Ribbon Elements.xml file?


I created Elements.xml file that added button to Ribbon of Web Part page.
I created <CommandUIHandler tag and put JavaScript into CommandAction.
Everything works.

I inserted changes to JavaScript and built and deployed project in VS2010.
The button function was not changed the previous JavaScript was used. I uninstalled feature and rebuilt and redeployed project. The button functionality was not changed again.

What I have to do that JavaScript changes work in CommandAction?

Thank you in advance for any help.

Boris Nossov

WCF client for axis2 web service (same element names for different elements in different complex typ



we want to consume a axis2 web wervice. We can't influence the web service definition.

the wsdl looks like:

<?xml version="1.0" encoding="utf-8"?>
        <xs:element name="BAPI_COMPANYCODE_GETLIST">
            <xs:element minOccurs="0" maxOccurs="1" name="OUTPUT">
                  <xs:element minOccurs="0" maxOccurs="1" name="RETURN" type="psi:BAPIRETURN">

WCF interoperability with Java SOAP service - sign elements order, force wsu id value



I need to consume a SOAP web service created in Java from a WCF client. By intensively searching this on the web in general and on this forum in particular, I've seen that quite a lot of people have problems in this area, however I never found the answer to the questions I will post on this thread.

The service I have to consume has the following constraints:

  • needs transport level security by communicating over HTTPS 
  • needs signatures on the body (soap:body element) and a custom header of each request. The signature is done using a client certificate and complies with http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0.pdf. The signature is required only on requests. Service responses are not signed.

After an intensive amount of work I managed  to make my request messages look like (intercepted with fiddler):

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u<

binding usercontrol elements properties


I am desperatly trying to understand bindings in WPF, I would like to understand how I can bind the elements of 2 Usercontrols to each other, so that if I change the value of the slider the circle strokethickness changes and if I change the circle strokethickness the slider changes. I have some code that hopefully explains what I want to understand better. TIA Mike

<Window x:Class="WpfDependencyTest.MainWindow"






  Title="MainWindow" Height="350" Width="525">


  <local:UcCircleText ></local:UcCircleText>

  <StackPanel Height="Auto" HorizontalAlignment="Right" x:Name="stackPanel1" VerticalAlignment="Bottom" Width="Auto" Background="Aqua">

   <local:UcSlider Height="150" Width="150"></local:UcSlider>



Export from Visual Studio 2005 CSV File with all elements double quoted

How can I get double quotes around all fields in a csv file?  Export creates file with no quotes.

how to call a session variable in Web service Method in Default.cs file



I have used a web service method in my Application. And as per the requirement using one user. I am searching for a list of schools to a particular area. When one person logged with the credentials , search criteria works fine when another person logs in there the problem like session variable is getting overriden . This is a issue which I am facing and as per its very urgent to solve the problem. Please help me and solve the Issue.

Please repond Immediately, as I am unable to sleep at nights.

I am also sending the code of a sample example 


using System;
using System.Configuration;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;

public partial class _Default : System.Web.UI.Page
    //public string str;
   // SharedPersonalizationStateInfo string str;
    static string str1;
    static string strName;
    static  string strSqlquery;
    protected void Page_Load(object sender, EventArgs e)

        if (!IsPostBack)
            strName = Session["ID"].ToString();
            str1 = Session["FriendID"].ToString();

How to use getElementById to get the elements in a form

There are many ways of accessing form elements, of which the easiest is by using the cross-browser W3C DOM document.getElementById method. Before we learn more about this method, it would be useful to know something about the Document Object Model (DOM), the concept of HTML nodes or elements, and the concept of containers.

Each time you load an HTML page, the web browser generates an internal representation of the page in the form of an inverted tree structure. Let us look at a simple form. We will use this form later to demonstrate the use of the getElementById method.

Command Management: Use Design Patterns to Simplify the Relationship Between Menus and Form Elements


In Windows Forms applications, similar commands, such as those in a menu and their counterparts on a toolbar, are not automatically related. They don't fire the same event or run the same handler routine. Yet code that allows the same or similar user commands to fire the same code simplifies development.This article describes the principles of command management and why it's important to have functional commands that are not exclusive to any one UI element. In order to provide an MFC-like command management infrastructure, a design pattern is developed and applied as a series of C# classes.

Michael Foster and Gilberto Araya

MSDN Magazine October 2002

Sharepoint Site Web Config elements Gets Deleted automatically


see i used to have a security filter settings in web config
security><requestFiltering><requestLimits maxAllowedContentLength="104857600"/></requestFiltering></security>
 but it gets deleted automatically after  i dont know why 
we tried to install something in our server yesterday it didn't worked and reverted it back to yesterdays stage( But i had updated the config files 3 weeks ago) 
but today i check the config files  these elements are  not there.

My system is 64 bit windows server 2008 with IIS 7 and MOSS 2007 SP2

Calling parameterized method from aspx file


Hi all,
I have following method
 public string GetYoutubeVideo (string code)
        return "asasdasfa"

(MVC & jQuery) Can't Add Datepicker to List of form elements



I'm still relatively new to jQuery (mostly finding things I need online and making simple changes). I have the following piece of code in my MVC app to render a partial view

<% int i = 0;
   foreach (var item in Model) { %>

        <td valign="top" style="border: none;">
            <%= Html.TextBox("MeetingList[" + i + "].Start", String.Format("{0:MM/dd/yyyy HH:mm}", item.Start), new { @style = "width: 120px;", @class="start" })%>
        <td valign="top" style="border: none;">
            <%= Html.TextBox("MeetingList[" + i + "].End", String.Format("{0:MM/dd/yyyy HH:mm}", item.End), new { @style = "width: 120px;", @class = "end" })%>

And I've tried the following to grab each of those 'MeetingList[...' items and add a datepicker to them,

        $(".start").each(function(index) {
            var $temp = $('#MeetingList[' + index + '].Start');
}); });


Video: Capabilities and Elements in Sandboxed Solutions in SharePoint 2010

This demonstration illustrates some of the allowed and disallowed operations in sandboxed Web Parts. (Length: 8:46)

config.web httpHandlers add and remove elements for ajax


I'm using an autocomplete contol of ajax toolkit. Yesterday a user found that it had stopped working (it wasn't generating the list as you type letters in the textbox). After hours of troubleshooting, I found that in web.config <httpHandlers>, this line -- <remove verb="*" path="*.asmx" /> was placed after the <add> line like this:

<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
<remove verb="*" path="*.asmx"/>

I fixed the problem by removing the <remove> line, but it seems I can also fix the problem by placing the <remove> line b

Error Consuming Web Service - Unable to import binding xxx from namespace ...


In VS2008 / C# / ASP.NET 3.5, I wrote a test web service app. Here is an extract from the code:

namespace emed.MathWebService
    /// <summary>
    /// Sample Math Services For Learning Web Services Deployment
    /// </summary>
    [WebService(Namespace = " http://localhost/MathService")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class MathService
        public float Add(float a, float b)
            return a + b;


I have published this to an IIS virtual directory named MathService, and when I try to launch it with the URL http://localhost/mathservice/MathService.asmx is works fine and displays all the operations (Add, Subtract etc) in the service.

I then created a test web application in VS2008 (named WebSvcTe

why I can not upload file to web by using WebClient.UploadFile method?



I am using WebClient.UploadFile method to upload a file to a web page.

The code is like this:

WebClient client = new WebClient(); 
byte[] responseBinary = client.UploadFile(url, fileName); 
string response = Encoding.UTF8.GetString(responseBinary);

But I can not upload it to server.

I used fiddler to see what happens, and it shows me the following information:

http status code: 302, request headers: POST /testing/upload/default.aspx HTTP/1.1

http status code: 302, request headers: GET /testing/upload/default.aspx?AspxAutoDetectCookieSupport=1 HTTP/1.1

http status code: 200, request headers: GET /(X(1)S(22pynhvxd3eqsb455pudx145))/testing/upload/default.aspx?AspxAutoDetectCookieSupport=1 HTTP/1.1

I would like to know, why I get 302 code, and why it redirect me to the strange url with (X(1)S(22pynhvxd3eqsb455pudx145)) ?

By the way, the web page is ok to upload file by using web explorer.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend