How to publish ASMX to website server

Posted on 2011-10-06
Last Modified: 2012-05-12
Using VS2005 I created a web project, asmx & default.aspx file.
Works great on the design pc.
Now I want to publish it to my public website, on an external server.

If I do a straight VS05 publish, the code contains reference to the asmx file on my design pc.
That is the wrong asmx file. It should be the asmx file on the external server.
If I do an FTP copy of the asmx file, then try to add a "Web Reference" in my project, I get an error.....probably because the asmx file was just "copied" and not compiled.

What steps do I need to take to get the project published?
Question by:MikeCombe
    LVL 12

    Expert Comment

    both ways for copying manually and using the publish wizard should work. AND using the asmx directly shpould work fine, too, you dont HAVE to compile in order to use the web service.
    the web service iacts as a web-site on the server, so copy the whole folder structure (web.config file, app data, and appcode folders etc...), and make a web-site out of them in iis on the server
    after that you can create the web-reference you need in the other application
    ask if you need more specifics

    Author Comment

    Thanks erez,

    That's what I thought. all works great on my design pc.....but not when I do the FTP upload.

    Using a web browser to look at my ASMX file, gets this error....
    Exception Details: System.InvalidOperationException: Request format is unrecognized.

    Using a web browser to look at my default.ASPX file, gets this error....
    Compiler Error Message: BC30002: Type ABC.Test' is not defined.

    I am missing something....

    LVL 12

    Expert Comment

    open the asmx file in a web browser ON THE SERVER (in rdp, if you have access) so you'll see the actual error, or add some try-catch and save the exact error
    do you have access to the iis on the server?
    are you using a user-defined type? this caused me some trouble before,.. if so, try using a standard type instead, and "directcast" it to whatever you want on each end

    Author Comment

    it's on a shared direct access by me.
    I can put a try-catch & get the error
    LVL 12

    Expert Comment

    you do have the codefile.vb or cs file in appcode folder, right?
    could you send some code of your web service?

    Author Comment

    I started all over with just a plain test.
    only has "Hello World"
    The VS05 project only shows a test1.asmx
    However, when I go to my FTP client, I see test1.asmx and test1.asmx.vb
    no bin folder in the project.
    Shouldn't I just have to upload the test1.asmx file?
    LVL 12

    Accepted Solution

    the asmx file is the "front gate" showing the world the service, but the actual things you write (incuding "hello world" that is automatically created for you) and "happen" by the service are all in the vb file
    if you have experience with aspx pages, it's the same with their code-behind vb files
    and their place is in the appcode folder on the server

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    User art_snob ( encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
    The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API ( has made its way into the popular lexicon of the English language.  A few years ago, …
    The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
    This video is a brief demonstration on how to use security groups and Network Access Control Lists (ACLs) in Amazon Web Services.  Security groups and Network ACLs are mechanisms you can use in AWS to control network traffic.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now