WCF / ASMX :: Test Client Doesn't Allow Null Values
Mar 11, 2011
I've created a WCF Service that Performs Insert User, What it does is, it'l get user name, age,gender,address,phone no and inserts these values into SQL database.
Problem is :
These things are working fine, if i give all the values in the WCF Test Client, It's Not working when i din't enter value for Address and click "Invoke" Button, It's throwing an Exception Procedure or Function "Insert_User" Expects
ADDRESS' Which was not supplied. I've created the SQL table Which allow Null Values for Address.
I've did the same Operaion in WebService also, there it's working fine, if i din't enter any value for tha Allow Null Colums, it's accepting the Null value and inserting into Database.
Why this Problem comes in WCF Test client, Guide me to Get rid of this Problem.
I have a simple WCF service that returns the time from the server. I've confirmed that data is being sent by checking with Fiddler. Here's the result object xml that my service sends according to fiddler.
[Code]....
Literally the only difference is the namespaces within the application. But still the values being returned are null, empty or a .NET default.
I have a typical gridview/formview master control setup. When I try to update or insert I don't get any errors but it also doesn't work. When I try to insert data all I get are null values and when I update, none of the values are updated. The formview looks like its working, but just doesn't. The primary key is an identity and it auto-increments by one.
I have three working webservices and one I am trying to do. The new one is very similar to a working one. I'm not sure how to test the webservice. I can open it and get the two input boxes for knownCategoryValues and category. What do I enter in these textboxes?
The working method uses 2 sql parameters, but I'm not sure how I enter these in the textboxes. In my example I want to enter the following values: Dept="sales" and StaffNo="abc"Here is method, but what do I enter to test it?
<WebMethod()> _ Public Function GetGrades(ByVal knownCategoryValues As String, ByVal category As String) As CascadingDropDownNameValue() Dim strConnection As String = DBConnectionString[code].....
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.
I am using httpcontext.Current in one my action method and i created the ms test method for testing this action and also i created the Mock object for httpcontect,but when i am trying to run the MS test script i am getting null reference exception from the line which i am using httpcontext.current in the action method.
var query = from emp in dbEmp.Employees join dept in dbEmp.Departments on emp.DeptID equals dept.DeptID where dept.DepartmentName.Contains(this.TextBox1.Text) select new { EmpID = emp.EmpID, EmpName = emp.EmpName, Age = emp.Age, Address = emp.Address, DeptName = dept.DepartmentName };
if (query==null) Label1.Text = "no results match your search";
Everything works in the right way, but the label doesn't show the message when query result returns null. The label can show without condition(querry==null). So how to test if a var query result returns nothing?
Maybe I am overthinking this a bit but I have a set of SSL enabled third party web services that I want to test. The url for the web service is essentially [URL]
Do I need to have a certificate setup on my test ASPX page to fully encrypt this connection or am I OK. with simply a simple ASPX page, create my objects from the WSDL and have at it?
We just re-worked about a dozen pages in a website we created - changing the masterpage - adding lots more CSS - changes to images and so on.
The production webserver runs this page using HTTPS:
What do I have to do in IIS to create another "website" that can be accessed? Doesn't the certificate refer to the specific site that's named in that cert?
I am writting a client applicatin that acesses a webservice written by another company. I need to test against this webservice but since it is live I need another place to test with. I don't have access to the code from the webservice but have added a reference to my project. I would like to create a test platform using C# which will run on IIS and not Java. I have created a basic webserive using both the NetBeans platform and the VS/C# platform. The problem I am having is if I dynamically change the web address from one to the other my client application complains that the webservice is invalid. I have verified all the calls are the same.
Are there any setting with VS/C# that allow me to configure it to behave more like the Java webservice? I don't have the server support to host the Java application for full testing along with other problems using the Java version. I have run both services in the "WCF Test Client" and can see where the WCF service uses the varibles for request and the Java uses body/request but can't get the WCF to follow that format. I read somewhere about changing the OperationContract with SoapRpcMethod but then the mentod is not longer exposed. I also tried a Web Service in .NET 3.5 instead of a WCF server but that seems to be more trouble and does not help.
Error message:
The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).
My web.config is set up so that I don't have to change anything between deploy from UAT and Production. I can determine what machine it is running on and then programatically pick the correct connection string etc from the web.config based on the name.
Now we are adding a call to a web service which now causes us to have to make a change at deploy time. We set a "Region" flag in the web.config and then in coded an IF statement to call the appropriate webservice based on the flag so all we'd have to change is the "T" to a "P" when moving to production. But then hardcoding a web service in the application is not what we want to do. Nor do we want to change the web service address in the web.config.
Is there any way we can do something like the following to be able to not have to change the web.config at deploy?
It would be something like:
1. Grab current Machine name
2. Look in web.config for corresponding machine name web service reference (like we do for connection strings etc)
I created a simple web service in VS2010 (C# - XP Professional SP3 development computer -- running .Net 3.5/4.0) that just does the basic "Hello World" and changes Temperatues from Farenhet to Celcius functions and ran fine in VS2010. I then created a directory in C:Inetpubwwwrootwebsvcvs10a (of the same development computer). In the localhost IIS I converted this to an application directory (properties/create application). I tried to deploy my web service here using the publish wizard of VS2010 but was getting errors stating that the URL was not in the correct format, so I decided to just copy myService1.asmx, Web.Config, and the bin folder (which contains the compiled assembly) directly to C:Inetpubwwwrootwebsvcvs10a. Then from the localhost IIS I tried to browse myService1.asmx and received the following error:
Configuration Error Description:An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3618
--I tried changing the targetFramework to 3.5 in web.config, but that did not fix the problem. I then removed the targetFramework attribute from web.config and then got this error message:
Could not load file or assembly 'myVS2010Websvc' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
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.BadImageFormatException: Could not load file or assembly 'myVS2010Websvc' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
What can I / should I do to resolve this problem so that I can deploy this web service project to localhost -- don't I already have .Net 4.0 runtime on this machine? It is the same machine that is running VS2010.
i am using a gridview in my web page,i used to bind the database records to the gridview..my columns are name,empid,company name,pl leave,sl leave,total leave taken here total leave taken is not a database fields,in the page i want to fill the records once loaded pl leave and sl leave is added and display in the total leave taken column..it working properly when all pl ans sl columns fill with numbers,if some pl and sl leave having blank values.it showing an error like input sting was not in correct format..this is my code
I have the below stored procedure witch has an error I cann't figure out.
What I want: Gets rankOrder. If rankOrder doesn't have a value (= null) the @num should be insertet as 1 as value. If there is a row and a rankOrder is should set the @num to insert the value + 1. The last one works perfect. But when the row I select is emty = null value the value is set to null in the insert command.
iam using webservice for create customer.by using WSDL(webservice) Url iam able to create customer Successsfully using Createcustomer request class. but in responce iam unable to get Unique ID the reponce object should generate as per SOAP functioanly iam unable to see the result set it is always null. How can i do this i need to capture that Unique ID after creating customer. it's Async mode. In below responce e.result set containning NULL values evn i customercreated in database.how to get my UniqueId in responce. my code:
{ Customer customer = new Customer(); PersonName pn = new PersonName(); pn.FirstName = txtFname.Text; pn.LastName = txtLname.Text; pn.MiddleName = txtMname.Text; pn.Salutation = "Mr."; customer.PersonName = pn; CreateCustomerRequest ccr = new CreateCustomerRequest(); ccr.CreateCustomer = customer; RSWS rsws = new RSWS(); rsws.CreateCustomerCompleted += new CreateCustomerCompletedEventHandler(rsws_CreateCustomerCompleted); rsws.CreateCustomerAsync(ccr); } void rsws_CreateCustomerCompleted(object sender, CreateCustomerCompletedEventArgs e) { CreateCustomerResponse ccresp = e.Result; Page.RegisterStartupScript("inspa", "<script>alert('customer created successfully')</script>"); }
I'm currently stuck with a problem with MVC2 RC and validation on a dropdownlist :
I have a page with some fields and a dropdownlist. The dropdownlist is not a mandatory field so I would like to save a null value into my property.
Unfortunately, I can't validate my page with a null selected value, because when I look into the modelstate just on the first line of my action, I've already an error telling me I must choose an item.
Is it normal working of dropdownlist validation or is it a bug ?
I have a ASP.NET webservice which is called by a Java client. The client sends a SOAP message as input but the problem is that it never reaches my webservice method. I always get null as input. I used TraceListener and saw this warning which may cause the problem:
The element was not expected in this context: <ListenerInput>..</ListenerInput>. Expected elements: http://client.ns.url/:ListenerInput.
I have managed to expose the MEX endpoint of my WCF service and I can access it with the address like [URL] (example) and get the WDSL. So no problem there.
However, my WCF test page shows the address wrongly by using the server's name instead of the DNS name. And if I click on the link on the test page it won't work (can't get WSDL).
The WCF test page looks like this:
MyService Service
You have created a service.
To test this service, you will need to create a client and use it to call the service.
[URL]
The WCF service is hosted in IIS6. I would like to have a test page with the correct WSDL address so users can see the WSDL quickly in the browser just by clicking on the WSDL address.
In short: How can I change the MyServerName to inter.mycompany.com on the WCF test page? Can this be specified somewhere in the Web.config?
I'm trying to make filters on gridview. Gridview is bound to SqlDataSourceControl.
The problem is when there is NULL value in DB.
Parameters
Code:
[code]....
Select Statement
Code:
SELECT Name, Phone, email FROM suragch WHERE (firstname LIKE @firstname + '%') AND (phone LIKE @phone + '%') AND (email LIKE @email + '%')
Above example works fine if there is no NULL.
When users want to find email they leave phone field empty and enters the firstname. But my example doesn't displaying email of given user if phone is NULL in db.