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

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

Parameter names ending with "specified" added to web service method call

Posted By:      Posted Date: September 14, 2010    Points: 0   Category :WCF
Hello,I am new to WCF. I created a wcf web service and the generated web method exposed by wcf has some additional boolean parameters with names that end with "Specified".I am trying to understand why are these additional parameters necessary and how to get rid of them. Thanks!David

View Complete Post

More Related Resource Links

Invalid web service call, missing value for parameter: \u0027prefixo\u0027 (AutoCompleteExtender)


Good afternoon.

I'm trying to put an AutoCompleteExtender working, but i'm having an error, that i discovered with Fiddler, that is the reason that the autocomplete doesn't work:

> **{"Message":"Invalid web service call,
> missing value for parameter:
> \u0027prefixo\u0027."**,"StackTrace":"
> at
> System.Web.Script.Services.WebServiceMethodData.CallMethod(Object
> target, IDictionary`2 parameters)\r\n
> at
> System.Web.Script.Services.WebServiceMethodData.CallMethodFromRawParams(Object
> target, IDictionary`2 parameters)\r\n
> at
> System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext
> context, WebServiceMethodData
> methodData, IDictionary`2
> rawParams)\r\n at
> System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext
> context, WebServiceMethodData
> methodData)","ExceptionType":"System.InvalidOperationException"}

This is the webservice code:

    Imports System.Web.Services
    Imports System.Web.Services.Protocols
    Imports System.ComponentModel
    Imports GcpBE750
    Imports ErpBS750
    Imports StdBE750
    ' To allow this Web Service to be called fro

Why request parameter added to client side code in each method while using svcutil.exe

Hi, I am using WCF services in my project and want to call WCF methods asynchronously. I am hosting WCF service programmatically in windows app as follows svc = New ServiceHost(GetType(Service1), New Uri("net.tcp://localhost:8806/")) Dim svcMDB As New ServiceMetadataBehavior svc.Description.Behaviors.Add(svcMDB) svc.AddServiceEndpoint(GetType(Service1), New NetTcpBinding(), "MyBusiness/MyBusinessService/") svc.AddServiceEndpoint(ServiceMetadataBehavior.MexContractName, MetadataExchangeBindings.CreateMexTcpBinding(), "MyBusiness/MyBusinessService/mex") svc.Open() Me.Text = "Service started...." and I am generating client side proxy using svcutil.exe as follows. svcutil /n:net.tcp://localhost:8806/MyBusiness/MyBusinessService,MyService net.tcp://localhost:8806/MyBusiness/MyBusinessService/mex /a /language:vb   The result of this command is as :   Microsoft (R) Service Model Metadata Tool [Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152] Copyright (c) Microsoft Corporation.  All rights reserved.   Attempting to download metadata from 'net.tcp://localhost:8806/MyBusiness/MyBusi nessService/mex' using WS-Metadata Exchange. This URL does not support DISCO. Generating files... D:\Prabodh\New C2k\Test Projects\DataTableToArray\MyHost\bin\Debug\MyBusinessSer vice.vb D:

Call specific web service method by matching string value to method name?

I am getting a value in string format.  Then, I call a web service and try to dynamically call the method that corresponds to the string's value.  It doesn't work.  Any ideas?              Dim methodname As String = "getquotes"                 Dim track As localhost.Tracker = New localhost.Tracker()                 'the below line is where it fails                 track.methodname(parameter)               

passing messageContract object to a WCF Service method using Soap - not as a method parameter

i want a web application to create a service reference to my WCF service, insert information to the header of the soap call and call my WCF method. my WCF supports soap operations (also there is an endpoint in the config). i read about MessageContract attribute and declared one in the interface file: [ServiceContract] public interface IBasicService { [OperationContract] [WebGet(UriTemplate = "GetData?value={value}")] // Add support for HTTP GET Requests string GetData(int value); } [MessageContract] public class BasicServiceHeader { [MessageHeader] public string myString; } the implementation of the contract : public class BasicService : IBasicService { public string GetData(int value) { return string.Format("You entered: {0}", value); } } i don't want the BasicServiceHeader to be passed as a parameter of GetData function , i want to keep the function signature as it is (without a BasicServiceHeader parameter) and to extract the BasicServiceHeader inside the function, (just like using soapHeader) can i do that ?

Spike in time requierd for method call in communicating with WCF Service


Here is my environment:

WCF Service hosted in Windows Service - all the methods in WCF Service are just skeletons; they doesn't do ANYTHING right now, for example
bool DoSomething() {
   return true;
WCF Client - WCF custom client developed by using files generated using svcutil (SDK 6A)
For Service contract - nettcpbinding
For MEX - wsHttpBinding

Both service and client  are/will be on the SAME machine

When I call methods from WCF Client in a tight loop (I am testing with 10,000 calls), for most calls time taken is 0 ms. But, after every 15/20 calls, it takes around 15-20 ms. And since service isn't doing anything, my guess is that it is time required _just_ for method call/communication.

I have also done this for WCFWindowsServiceSample example and it has same issue.

When I was using wsHttpBinding for service contract frequency of spike in method call time was much more as expected.

I am using System.Environment.Tickcount and although it may not be very accurate in determining CPU time, I am interested in total time taken so it should be okay (?)

Has anyone come across this issue? And is there a resolution to it?

If no one has come across this issue, do you have any thoughts on why and how it can be resolved?<

JQuery Autocomplete Call WCF Service Method


I am trying to use the below code to call a wcf service method for Autocomplete functionality in a TextBox.  I have written the following query:

$(document).ready(function () {
            $("#<%= txtCompany.ClientID %>").autocomplete(http://localhost/PieScore/PieScore.Application.Services/EmployeeService.svc/GetTestCompanyList, {
                dataType: 'json',
                parse: function (data) {
                    var items = data.d;
                    var parsed = [];
                    for (var i = 0; i < items.length; i++)
                        parsed[i] = {

SOAP as input parameter in a web service method


I have a webservice method which needs to accept SOAP as input parameter. I've worked webservices between .NET clients but I've never worked using raw SOAP so I don't know what to do. The format of the input like this:

<?xml version="1.0" encoding="utf-8"?>
<S:Envelope xmlns:S = "http://schemas.xmlsoap.org/soap/envelope/">
    <ns2:RemoteService xmlns:ns2 = "some.ns.url">
        <param2>Asd Qwe</param2>
        <param3 xsi:nil = "true" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"/>
    </ns2:RemoteService >

How should my method input be to accept this SOAP as parameter?

I'm using ASP.NET web services not WCF.

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();

Get Submitted SQL with Parameter Values (Not @Names)



I want to retrieve the full SQL that my Web Application generates and executes on the database. So when the INSERTED or UPDATED events are triggered on the SqlDataSource, I want to get that particular SQL Statement.

The  problem I've got there though is when I use "e.Command.CommandText" that gets the SQL statement with the paramter names NOT the paramter values. I specifically need the values.

So... how can I get it to display the full SQL statement containing submitted values!?



Call a web method in Javascript


Hi All,

I am first time working on web service and Javascript and trying to call a Web Method (web service) on a button click in Javascript.

What I want to achieve is as followed: When the button is clicked, call the web method, get the return URL value and store it to a session variable, the redirect the page to another page. However, this works only when the internet traffic is fast, it give me error when internet is slow as the Javascript is executed much faster than the web service. Is there any way to handle this?  Would be much appreciated for your help! Cheers.

Code as below:


function emailButton_onClick()


function getCurrentMapURL(getCurrentMapURLOnSuccess)
var proxy_url = 'WebService/GPSWebService.asmx/GetCurrentMap';

var response = map.print([proxy_url]);



function getCurrentMapURLOnSuccess()
emailAddress = document.getElementById('txtEmailAddress').value;

if(emailAddress != null)
alert('Do you want to send report

Parameter Data changing between DataSource_Inserting and the BLL call



I have a problem when trying to validate data on insertion (and possibly update, didnt try it yet) .

I use a formview in insert mode, linking to a custom BLL that then link to a DAL to insert data into a table. The problem is the parameter data is changing between the Datasource inserting event and when the BLL insert method is called. 2 field, that cannot be null in the database, have default value added to them. Bot sure how to explain so well so 'ill post some picture explaining :

This is the form I use, I enter only test in the textbox for the value Nom

this is the trace for my DataSource_Inserting event, as you can see, only the "Nom" value is non-null

But then, right after the event is done and the call is made to the BLL, the value for "Sexe" and "DateDeNaissance" has been changed to some default value, namely 0 and Jan 1, year 1.

This of course is causing problem because if the user does not provide value for "Sexe" and "DateDeNaissance" then I want t

Cash Drawer - Method Open threw an exception - Windows Service

Hi All, I'm getting the following exception while calling Open method of Cash Drawer object. Method Open threw an exception.  Could not read the device name key's default value, or could not convert the Programmatic ID it holds into a valid Class ID. Code:   class Class1 { CashDrawer _uniCashDrawer1 = null; DeviceInfo cashDrawerDevice1 = null; PosExplorer posExplorer = new Microsoft.PointOfService.PosExplorer();   public void ClaimCashDrawer() { cashDrawerDevice1 = posExplorer.GetDevice("CashDrawer", "testDrawer"); if (cashDrawerDevice1 != null) { _uniCashDrawer1 = posExplorer.CreateInstance(cashDrawerDevice1) as CashDrawer; if (_uniCashDrawer1 != null) { _uniCashDrawer1.StatusUpdateEvent += new StatusUpdateEventHandler(UniCashDrawer1_StatusUpdateEvent); _uniCashDrawer1.Open(); _uniCashDrawer1.Claim(0); _uniCashDrawer1.DeviceEnabled = true; } } } }   Tha above code works fine if you put the code in WindowsApplication in all POS systems. The same is working if you put the code in Windows Service in all other POS systems. The same is not working if you put the code in Windows Service in Aures Galeo POS systems.  Thanks in advance. Ramakrishnan S

Trying to call an asmx web service from a test project

I am trying to create a proxy for an asmx web service. The only thing I find in Visual Studio 2008 is a service reference. How do I call an asmx web service with a service reference? Certified Geek. Professional Data dude.

calling WCF service Method in HTTP GET by browser or ASP.NET ( like HttpWebRequest for example)

Can i call a WCF service Method using HTTP GET by browser or ASP.NET (without WCF Client)? it can be done with asmx web service.... but i can't find a way to call a WCF service Method with HTTP GET through the browser or C# ASP.NET Code... can i do that ?

Unable to call an asmx web service using windows authentication from a Service workflow

Hello, I need to use an existing asmx service from inside my service workflow and I am unable to call it. This asmx service is hosted in a web application with iis set to windows authentication, anonymous is not allowed. I need to send the authentication, only way seems too be using transport for basicHttpBindings. Every time I try to call the service I get an error saying that there is nothing listening to the url of the service generated automatically by VS when I added the Service Reference ? my web config <configuration> <configSections> </configSections> <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.serviceModel> <protocolMapping> <add scheme="http" binding="wsHttpBinding" bindingConfiguration="WindowsCreds" /> </protocolMapping> <bindings> <basicHttpBinding> <binding name="UtilitiesSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"

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

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"   /&

Passing parameter into Web Service

Hi, I'm creating a web service using C#, and wondering if it is possible to capture the parameter passed in from the URL?e.g. http://www.abc.com/webservice/service.asmx?para1=one&para2=twoIs there a function or something that can obtain the parameters like the normal Request.QueryString? Thanks in advance! Rgds
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