.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

New public class in namespace (web service, asmx)

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :ASP.Net


I have a working web service written in C#.NET that was set up by my predecessor, and have been able to successfully modify it in the past. It works without problems in production.

Basically, the service takes XML code and sends it to a postURL with an outside vendor API. They send back an XML document that we then parse out.

My issue is that I need to connect to another vendor API concurrently with the existing one.

Method 1) Should I create an entirely new Web Service for the new vendor? I tried this but there seemed to be an issue with the ports, having them run at the same time. Should I try again? Any port secrets?

Getting stuck on Method 1, I'm on to Method 2 now....

Method 2) Modifying the exiting web service by adding a new public class to the namespace. I also modified the wsdl, disco and discomap files for the new service. It did compile, but something is missing.

Service1 = exisiting, working web service

https://servername/Service1.asmx - works beautifully and lists all my API calls

https://servername/Service1.aspm?wsdl - shows my wsdl file

Service2 = new, copied web service

View Complete Post

More Related Resource Links

Service Station: All About ASMX 2.0, WSE 3.0, and WCF


The release of the Microsoft® . NET Framework 2. 0 reshapes the Web services landscape in several interesting, and perhaps confusing, ways. So this month I'm going to field some of the most common questions related to ASP.

Aaron Skonnard

MSDN Magazine January 2006

Service Station: Run ASMX Without IIS


When the Microsoft® . NET Framework first shipped, it introduced a breakthrough Web services framework known as ASMX. The motivation behind the ASMX design was to simplify the process of developing Web services as much as possible so that even if you're not an XML expert, you can get a Web service up and running.

Aaron Skonnard

MSDN Magazine December 2004

Class Templates: Bring the Power of Templates to Your .NET Applications with the CodeDOM Namespace


In the .NET Framework, the CodeDOM object model can represent code in a variety of languages. This article examines how source code templates written with the Framework's System.CodeDom and System.CodeDom.Compiler namespaces allow developers to create reusable boilerplate source code that can be shared between projects. Components designed via templates improve productivity and shorten development time.Here C++-style classes and templates are simulated and code is generated in multiple languages through the creation of CodeDOM object graphs. Compiling object graphs and formatting output code are also explained.

Adam J. Steinert

MSDN Magazine February 2003

How do I find the file path from a namespace.class name?


I'm programatically looking ito a .aspx file and getting the file class name declared in its CodeBehind. For example, when analyzing myFile.aspx I read in its Page Directive and found its CodeBehind equals "myApplication\myPage.aspx.vb". Then I use the code below:


Dim Assm As System.Reflection.Assembly = System.Reflection.Assembly.LoadFrom("myApplication\bin\myApplication.dll")
Dim ClassType As Type = Assm.GetType("myApplication\myPage.aspx.vb")
' myBaseType = "myApplication.Forms.BasePage"
Dim myBaseType As System.Type = ClassType.BaseType


Now I want to read the BaseFile (class = myApplication.Forms.BasePage). However, to read in this file, I need I need to get its full path instead of its namespace.class hiearchy. In this case, the BasePage is wrapped in a different namespace declaration thus I cannot just change the '.' to '\' in order to get the path.

How can I get the path of BasePage so I can read it? Thank you - Frank

VS2005 calling VS2010 asmx service returns empty string


Anyone have any experience with this?

We are using VS 2005 for the front end, and vs 2010 for the web services part (asmx), not wcf yet.


Web service works just like the vs2005 when run locally, no problems.


Connecting to it from a test app returns an empty string. Connecting to a 2005 app doesn't!

Anyone run into this before or have a suggestion? Surely vs 2005 can connect to web services from a later version?






How do consume an ASMX service?



I need to consume and ASMX service on my website.

This service has to be authenticated and results would be displayed on my website.

Can you please give be step by step instructions on how do i do it?

I am using VS 2008 VB or C# is fine by me.

I had checked on various forums and its not really giving me the required steps (baby steps here)

Thanks a lot


Web Service and Base Class Sub Routines



I have several Web Services that I call using jQuery, they are all <WebMethod()> _    Public Function and return either a boolean or string, depending on the function.

I have some Web Service functions, where I would like to call sub routines I have in my base class, they are Public Sub's.

When I add a call of a sub routine in the Web Service function, I get a blue line that says 'Object reference not set to an instance of an object'.  If I change the sub routine to Public Shared Sub, then the blue line and error go away, but I get other errors from the calls I was successfully making to the base class routines before.

Is there a way to get these two to work together?

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

How to update row using Domain Service Class programmatically?

How to update row using Domain Service Class programmatically in Silverlight without bind to any datagrid and other control? Please help.chanmm

How to update row using Domain Service Class programmatically?

How to update row using Domain Service Class programmatically in silverlight without binding to any datagrid and so? Please help.  chanmm

All data in class properties disappear across WCF service

Hi, I have a class that i share betwee silverlight client and wcf service. I populate properties of the class with real data from the client, to be used in the server. I use debugger to step through the code when the call gets to the server, all the data ara gone and are replaced with null. All DateTime value change to 1/1/1001. But if pass primitive types such as int, string, no problem. This is happening only on one machine, but not on ther machine. Can someone tell me what is going on here? Thanks in advance

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.

Error Build: Type or namespace could not be found, when referencing a web service

Hello, I'm new in writing C# application in Visual Studio 2008. I'm currently writing a web application for CRM 4.0 Reporting Service rendering. I reference my web application to our Reporting Service web service http://reportservername /ReportServer/ReportExecution2005.asmx and name it 'RSWebReference'. Then I want to reference it in my code: Using RSWebReference; Not sure why, but I cannot build my solution, saying "The type or namespace name 'RSWebReference' could not be found (are you missing a using directive or an assembly reference?)". I read this thread in http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/74f70e30-83e8-4817-b5e0-7729450730a1 that the website probably is using .net 1.1, and I should change it to .net 2.0. However, I think the website is already using 2.0. Is it probably because I'm using VS 2008? How can I tell and change if the website is using 1.1 or 2.0? Or could I be doing something wrong? Thanks in advanced for your help! -Elizabeth K.

jQuery calls asmx web service

I have a jQuery method that calls a .asmx web service.  the jquery method only executes one time but the web serivce executes multiple times.  Is there a way this could happen or ways to debug this beyond breakpoints in the c# code and alerts in the jQuery.

Lifetime of asmx web service/IIS application

Hi I have a web service (asmx). I want to add a functionality where in I have to do polling for data on a URL. I added a timer and in the timer elapsed event handler I am checking for the data. (Is it a good design? Is there something better than timer for this in ASP.NET?) But what I observed is that, after some time, if the web service is ideal (no request are sent to the service), the timer event doesn't fire. Is this something by design or I have some configuration issues here. Is it very standard that if web site is ideal then the objects in that site are destroyed? I have few static objects maintaining the state should I not keep them there? Is there any configuration that allowes the service to stay alive dispite of the request sent to it or not? When web site is ideal, its only the website which goes in ideal state or IIS goes in ideal state? I mean my timer stopped is it because nobody called by web service or its because nobody called the IIS on that machine (any other web service or web application deployed on IIS)?

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"

Problem With SharePoint Designer 2010 and the Search.asmx Web Service

I've created a web service datasource on a 2010 site using SharePoint Designer. When I try to make use of the datasource on a page I get the "The server returned a non-specific error when trying to get data from the data source..." message. The datasource connects to _vti_bin/search.asmx. I am using the QueryServiceSoap port and operation QueryX. I've tried various queryXml strings, including site & people searches using both SQL and keyword syntax. eg <?xml version="1.0" encoding="utf-8" ?><QueryPacket xmlns="urn:Microsoft.Search.Query" Revision="1000"><Query domain="QDomain"> <SupportedFormats><Format>urn:Microsoft.Search.Response.Document.Document</Format></SupportedFormats> <Context>   <QueryText language="en-US" type="MSSQLFT"><![CDATA[ SELECT Size, Rank, Path, Title, Description, Write, Filename, Description, Author FROM scope() WHERE CONTAINS ('"Lorum"') AND  ( ("SCOPE" = 'All Sites') )   ORDER BY "Rank" DESC ]]></QueryText> </Context> <Range><StartAt>1</StartAt><Count>20</Count></Range> <EnableStemming>false</EnableStemming> <TrimDuplicates>true</TrimDuplicates> <IgnoreAllNoiseQuery>true&l
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