Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How is an .ASMX Generated by VB.NET?

Posted on 2010-11-10
7
Medium Priority
?
703 Views
Last Modified: 2012-08-14
Here is what I so far know:

1- add this code to each web service class:

Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols

' <System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class AdminBudget
    Inherits System.Web.Services.WebService

2-set-up web service methods like so:

    <WebMethod()> _
    Public Function PositionPerPositionCD(ByVal strPositionsCD As String) As String()

3- create a .ASMX using the class name:

VB.NET genrates this:
<%@ WebService Language="VB" Class="AdminBudget" %>

On-line help states it should be this:
<%@ WebService Language="VB" Codebehind="AdminBudget.asmx.vb" Class="AdminBudget" %>

(not certain of which is correct)

As far as I was informed by a co-worker, all that is left is building the project. However, the .ASMX file remains empty outside of the above directive.

What am I missing? My co-worker is not here and I need to finish this by this coming Monday (11-15). Any help will be appreciated. Thank you.

-Bob
0
Comment
Question by:bobcann
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 34111942
What I would suggest is to create a new "Hello World" web service from the project template, and look at what the template generates, and compare to what you need for your web service.
0
 
LVL 21

Assisted Solution

by:Craig Wagner
Craig Wagner earned 600 total points
ID: 34111947
The ASMX file should be empty outside of that directive. The code goes in the code-behind file.

The directive from the on-line help is correct.

Rather than creating these files from scratch, why don't you just right-click on the project in Solution Explorer, Add->New Item->Web->Web Service and let it generate all the stub files? If, for some reason, that option isn't available, as an alternative you could use File->New Project->Web->ASP.NET Web Service Application and then copy the generated stub files into your project. Hand-crafting these files isn't necessary when Visual Studio will generate them for you.
0
 

Author Comment

by:bobcann
ID: 34121875
Hi Guys,

This is what is in the VB generated .asmx file.

<%@ WebService Language="VB" Codebehind="AdminBudget.vb" Class="AdminBudget" %>

It did not work. The file name was changed from "Codebehind="AdminBudget.vb" to "Codebehind="AdminBudget.asmx.vb" altering it to ".asmx.vb"

<%@ WebService Language="VB" Codebehind="AdminBudget.asmx.vb" Class="AdminBudget" %>

When I build the project the asmx files are not populated with code as my co-worker explained (not at work today).

What am I missing. Thanks again for your help!

-Bob
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 96

Expert Comment

by:Bob Learned
ID: 34122457
Are you able to attach a screen cast of your problem?
0
 

Author Comment

by:bobcann
ID: 34123871
TheLearnedOne, as I was creating a Screncast, I believe I found my error. It was explained by my co-worker that by simply Building the project would create the appropriate Service files. Out of ingnorance, I did so.

However, this time I selected Build > Publish Web Site and it asked for a directory to place the files in. It all seemed to work just fine.

One last question, the .asmx files only contain the directive:

<%@ WebService Language="VB" Codebehind="AdminBudget.asmx.vb" Class="AdminBudget" %>

Is this correct that it only contains this single line of code?

The client programmer will not be in until Monday and he is needed to test the function of the completed Web Service.

Again, thank you for the help.

-Bob
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1400 total points
ID: 34127834
All the heavy lifting, in a web service, is in the code-behind, so the .asmx file only needs to declare that class for the ASP.NET parser.
0
 

Author Closing Comment

by:bobcann
ID: 34138482
Thanks for the help.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

688 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