C# - Methods With Nullable Types Not Working In ASMX Web Service Using GET

Mar 14, 2011

I have an ASMX Web Service set up to use the HTTP GET method. Simple methods which take basic String and Int parameters are working ok, and I can call MyService.asmx/MethodName?Param=Value and get a response back in XML.

However, when I have a method which has a nullable Int (i.e. int?), I get this error:

< Method Name > Web Service method name is not valid.

The error message is confusing, as the method does exist, just not in the GET scope. I presume this is because a nullable type is too complex to be passed via the URL, but I can't find any documentation or SO posts on this.

I appreciate that complex types like Lists or custom classes etc will not work using GET, but I would have assumed that a simple nullable int or nullable datetime could be handled natively, simply by detecting whether it was omitted from the URL. Guess it's not that simple!

View 1 Replies


Similar Messages:

How To Write Extension Methods For Both Nullable And Not Nullable

Nov 10, 2010

I've written the following Extension Method

<Extension()>
Public Function ToUtcIso8601(ByVal dt As Date) As String
Return String.Format("{0:s}Z", dt)
End Function

But I also need a Nullable version of the same method... how exactly do I do this?

This is what I was thinking, but I'm not sure if this is the right way

[code]....

View 1 Replies

WCF / ASMX :: Regarding Web Service Return Types?

Jun 24, 2010

i have 10 employee objects.I want to return these 10 object from a web method to web service client.

View 6 Replies

WCF / ASMX :: Authenticate Web Methods In A Web Service?

Apr 1, 2011

What is the best way for authenticating web methods in a web service? Is it right having authentication for every web method and verify user name and password for each web method? Is there a way to authenticate just once not for every web method? something like using sessions and etc?

View 2 Replies

How To Suppress Error Messages When Access Non-existent Web Methods On A .asmx Web Service

Dec 15, 2010

We have a customer who are using HP Web Inspect to test for vulnerabilities in our software.

The web inspect tool is complaining about about error messages being returned when a request such as the following is made [URL].

The ASP.Net framework returns a page with the following text content and a 500 status code.

System.IndexOutOfRangeException: Index was outside the bounds of the array.

[code]....

but the error seems not be an unhandled error and so neither 500 page is shown.

View 1 Replies

WCF / ASMX :: Web Service Is Not Working On Production Server

Sep 14, 2010

i am calling the webservice from acrobat javascript. it works very well in development server. but when i put the same code in production server, it doesnt call the webservice.

View 3 Replies

WCF / ASMX :: Data Service Skiptoken Not Working

Jan 17, 2011

I created a WCF data service and i've set the service config params like;

config.SetEntitySetAccessRule("PROFILEs", EntitySetRights.All);

config.SetEntitySetPageSize("*", 100);

So, in the returned xml feed, the link to goto next page is: <link rel="next" href="http://localhost:4760/oData.svc/PROFILEs?$skiptoken=4105" />

However, if I browse to that url I get an HTTP 404 error "The resource cannot be found."

Also, none of the URI querystrings seem to work.

View 2 Replies

ASMX :: Optional Parameter Is Not Working At WCF Service

Jul 27, 2010

I was expecting a parameter will become a empty string value if the parameter is missing, but it turn out to be null. have I done it wrong for the optional parameter?

[Code]....

View 3 Replies

WCF / ASMX :: Working On A Web Service Program But Is Stuck?

Jan 18, 2011



I am working on a web service program but is stuck. i dont know what to do after I use the foreach statement to retreive my data.


using System;
using System.Collections;
using System.Collections.Generic; [code]....

View 5 Replies

How To Pass Reference Types To Methods

May 24, 2010

I have this very simple test program that illustrates my question. I am not sure why this returns a null for the 'customer' variable. I would have thought that since the method MyTestMethod created a new Customer object that the value of 'customer' wouldnot be a null.

[Code]....

View 5 Replies

WCF / ASMX :: Getting 403 Then 404 Error On Web Service That Was Working On Prior Server?

Mar 2, 2011

I have a web service that was running on Server 2003, IIS6. The service required an SSL connection. The service expects 4 parameters; a User ID, Password, Record ID and the "type" of data requested (one of 5 options). The service validates the user then simply performs a select of the record ID from a table determined by the type specified. This service was up and running for a couple of years. I installed a couple of new servers a couple of months ago. The users that makes use of this service just tried it and couldn't get a response. I checked the server and I hadn't copied the service over. The service is located in a virtual directory under the primary web site.

For example, the site is: [URL] Service virtual directory is "GetITSData" The call to the service has been: [URL] param1, param2, param3, param4 and the service would return the appropriate data. I "assumed" that when I copied the actual contents of the directory over, that the service would then begin functioning again (since it was empty). All IIS snap-in manager items for the virtual directory match the previous settings on the old server (I still have that server available in my office). The main site requires SSL and uses forms authentication. When I create a dummy site in VS2008 and try to add a service reference, I get the following: There was an error downloading [URL]. The request failed with HTTP status 403: Forbidden. Metadata contains a reference that cannot be resolved: [URL]. The remote server returned an unexpected response: (405) Method Not Allowed. The remote server returned an error: (405) Method Not Allowed. If the service is defined in the current solution, try building the solution and adding the service reference again.

View 2 Replies

WCF / ASMX :: Generating Service From Wsdl (SvcUtil Not Working)?

Mar 30, 2011

Im trying to generate a service based on the wsdls ive been given hitting svcutil directly.. try as I might I cannot get it to export everything correctly.. it ends up not including chunks of info from the wsdl files..

svcutil /n:"*, TestProject.Web" CreateApplication_Responder.2.3.0r2.wsdl DeclareDetermination_Responder.2.3.0r2.wsdl ..ivmdeclareDetermination*.xsd ..ivmcreateApplication*.xsd ..ivss*.xsd ..ivcore*.xsd ..ivdtqdt*.xsd /mc /ser:Auto
/importXmlTypes /tcv:Version35 /s

View 1 Replies

WCF / ASMX :: Simple Web Service Not Working With Standard JQuery Call

Jan 3, 2011

I have a simple web service that isn't working with a standard jQuery call. The code is below. The jQuery will execute and succeed, but on debugging, the service argument is always null. I've had it separated as 4 string params in a json string and that didn't work either. I must be missing something on the config side, but I can tell what it is.

[Code]....

View 2 Replies

How To Pass Null To A Nullable Parameter Of A .NET Web Service Method Via Javascript

Aug 24, 2010

[System.Web.Script.Services.ScriptService]
public class Quotes : System.Web.Services.WebService
{
ebMethod]
public void Calculate(int param1, int? param2)

View 2 Replies

WCF / ASMX :: Finding Information About Data Types

Aug 26, 2010

Well i am just trying to test interoperability between ASP.net And Java web services, wanted to know what are the INTEROPERABILITY issues concering DATA TYPES that are there between the 2?

View 3 Replies

WCF / ASMX :: Custom Object Types And Empty WSDL

Dec 28, 2010

Using C#, ODP.NET and ASP.NET Web Services:

ClassA is a custom class generated from a "type" in oracle database.
ClassB is a custom class generated from a "table of type ClassA" in Oracle database.

The exposed service includes a login procedure which gets a username as input parameter and returns object B. Debugging the login procedure I can see that the data is retrieved from the database but not printed in the wsdl..

[Code]....

My ClassB definition is as follows:

[XmlInclude(typeof(ClassB))]
public class ClassB : INullable, IOracleCustomType, IXmlSerializable
...

similar definition holds for ClassA as well. the generated wsdl is :

<? xml version="1.0" encoding="utf-8" ?>
<ClassB xmlns="http://tempuri/org" />

and no data printed out. What may be the problem?

View 3 Replies

WCF / ASMX :: Overloading Web Methods

Jan 6, 2011

I was trying to overload two web methods by adding the MessagName descriptor.

[WebMethod(MessageName =
"GetFiles")]
public
[Code]....

But I am getting the following Server Error

Server Error in '/Test.Service' Application.

Service 'TestService' does not conform to WS-I Basic Profile v1.1. Please examine each of the normative statement violations below. To turn off conformance check set the ConformanceClaims property on corresponding WebServiceBinding attribute to WsiClaims.None.R2304: Operation name overloading in a wsdl:portType is disallowed by the Profile. A wsdl:portType in a DESCRIPTION MUST have operations with distinct values for their name attributes. Note that this requirement applies only to the wsdl:operations within a given wsdl:portType. A wsdl:portType may have wsdl:operations with names that are the same as those found in other wsdl:portTypes.

- Operation 'GetFiles' on portType 'TestServiceSoap' from namespace 'http://www.Test.com'.

Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Service 'TestService' does not conform to WS-I Basic Profile v1.1. Please examine each of the normative statement violations below. To turn off conformance check set the ConformanceClaims property on corresponding WebServiceBinding attribute to WsiClaims.None.R2304: Operation name overloading in a wsdl:portType is disallowed by the Profile. A wsdl:portType in a DESCRIPTION MUST have operations with distinct values for their name attributes. Note that this requirement applies only to the wsdl:operations within a given wsdl:portType. A wsdl:portType may have wsdl:operations with names that are the same as those found in other wsdl:portTypes.

- Operation 'GetnFiles' on portType 'TestServiceSoap' from namespace 'http://www.test.com'.

To make service conformant please make sure that all web methods belonging to the same binding have unique names.

Source Error:

[Code]....
Stack Trace:
[Code]....

View 3 Replies

WCF / ASMX :: Use Asynchonous Web Methods?

Dec 23, 2010

I have an ASP.NET 3.5 web application that uses ASMX web services that are called synchronously. I want to see if I can call them asynchronously because some of the web methods take a long time to process and I'm concerned that this is affecting scalability.

I found this article that explains how to use Asychronous web methods, from 2002: http://msdn.microsoft.com/en-us/library/aa480516.aspx. It says:

For asynchronous requests, during reflection the ASMX handler looks for Web methods with a certain kind of signature that it recognizes as being asynchronous. In particular, it looks for a pair of methods that have the following rules:

There is a BeginXXX and EndXXX Web method where XXX is any string that represents the name of the method you want to expose. The BeginXXX function returns an IAsyncResult interface and takes as its last two input parameters an AsyncCallback, and an object respectively. The EndXXX function takes as its only parameter an IAsyncResult interface. Both must be flagged with the WebMethod attribute. When I create the reference to my web service, I don't see any BeginXXX and EndXXX methods. I only see a XXXAsynch method and the article doesn't mention that method. I've done further research and every other article I've found also mentions the BeginXXX and EndXXX web methods.

View 4 Replies

WCF / ASMX :: Create Web Service - How To Web Page Call Sales_Services.asmx

May 5, 2010

if i have the web application with many pages like add order page, edit order page, and delete order page actually they also interact with the Sql Server 2008 and i also create web service page call Sales_Service.asmx. i know just i need to put something like query into Web Method in Sales_Service.asmx but i have a lot of queries, i don't know which query i should put into it and how the web page call the Sales_Services.asmx

View 2 Replies

WCF / ASMX :: IIS Memory Increasing For Each Client Request In Asmx Web Service?

Nov 8, 2010

A customer reported that our asmx web service is continually increasing in memory (mem usage as well as private bytes). We are able to reproduce the problem in our lab with Windows 2003 Server SP2 (fully patched) on some of the machines. The customer is using Windows 2008.

We created a Hello World web service targeting the 2.0 framework built under VS2005 SP1 and a test client that continues to call it. The memory increases steadily - approximately 40K per client request. If the test app is paused, the memory remains the same. When it is closed, the memory drops. Explicit calling of GC.Collect does not drop the memory.

We have run the memory profiler on the service and the leak is all native memory. We have uninstalled/re-installed the Framework on one of the machines but no difference. To our knowledge all of the security and IIS settings are not modified. We have compared app pool, default web site and virtual directory properties to machines that have no problem and they are identical.

View 11 Replies

Asmx Not Allowing To Invoke Ws Methods?

Apr 1, 2011

On my local machine with the default ASP web server I am able to browse my web service's methods, which have with prompts and an invoke button.But when I deploy this same code to an IIS server and I browse the asmx page I just get a descritpion of the methods.

The web server is running windows 7 and IIS 6.

View 3 Replies

WCF / ASMX :: How To Get The List Of Methods Programatically

Nov 11, 2010

I am using GetMethods() method to get the list of all the available methods in WCF. But it returns everything, how can I only show the methods that I exposed to client.

[Code]....

How can I filter the methods only to WCF Servicecontracts?

View 3 Replies

Use Reflection In C# To List The Methods Of An .asmx?

Jul 8, 2010

given a url that references an asmx how would i go about displaying all of their method names? if assembly="http://.../something/something.asmx" and i was trying to display the method names of that service what should i do now that i have gotten myself this far? i cant seem to find a solution among the hundreds of examples ive looked at

public TestReflection(string assembly)
{
Assembly testAssembly = Assembly.LoadFrom(assembly);[code]....

View 6 Replies

AJAX :: Use Web Methods Without Using .asmx Files?

Feb 2, 2010

[WebMethod(EnableSession = true)]

View 5 Replies

WCF / ASMX :: Allow Web Methods To Be Call From Javascript

Jan 8, 2011

i have created a simple WCF webserivce and it is running at http://localhost:2699/WCFServiceClient/myService.svc

with method

[Code]....

i have tested it from a wcftestclient it is working fine.

but when i try to call this method from jquery, it doesn't response.

my jquery code

$.ajax({ type: "POST", url: "http://localhost:2699/WCFServiceClient/myService.svc/GetData", data: { 'value': 5 }, contentType: "application/json; charset=utf-8", dataType: "text/xml; charset=utf-8",
success: function (msg) { alert$(msg.d); }, error: function (e) { alert("Unavailable"); } }); }

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved