473,385 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

WebService fails inside ASP 2.0 website

In my ASP.Net 2.0 website I defined base page type in web config as follows:
<pages MaintainScrollPositionOnPostback="true" pageBaseType="base_Page" />
It all works fine for the pages.

Now I am adding webservices to the site - I use the same business objects
and authentication/authorization.

The code behind the webservice is trivial:

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class MyService : System.Web.Services.WebService
{}

The problem is that when webservice is initiated, the compiler is trying to
inherit my webservice from base_Page class - and obviously fails with the
following error:
"The MaintainScrollPositionOnPostback page directive cannot be set without
an htmlform."

The whole website compiles without any errors - I only receive this error
when I attempt to call the service...

How can I prevent my asmx webservice to attempt inheriting from base_Page
which inherits from System.Web.UI.Page - as I specifically defined my
webservice type????

Any help is greatly appreciated.
Jul 13 '07 #1
2 2172
Hi,

issue occurs when you try to open the asmx in web browser since it is the
test page which asp.net runs behind the scenes, it does not have server-side
form only but when you use HTTP POST with the test form

You'll find the file which is run by ASP.NET by looking at
DefaultWsdlHelpGenerator.aspx on
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONF IG

Simple way to get past this is to set MaintainScrollPositionOnPostBack on
page directives directly.

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net
"Sergey Poberezovskiy" <Se*****************@discussions.microsoft.comwrot e
in message news:97**********************************@microsof t.com...
In my ASP.Net 2.0 website I defined base page type in web config as
follows:
<pages MaintainScrollPositionOnPostback="true" pageBaseType="base_Page" />
It all works fine for the pages.

Now I am adding webservices to the site - I use the same business objects
and authentication/authorization.

The code behind the webservice is trivial:

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class MyService : System.Web.Services.WebService
{}

The problem is that when webservice is initiated, the compiler is trying
to
inherit my webservice from base_Page class - and obviously fails with the
following error:
"The MaintainScrollPositionOnPostback page directive cannot be set without
an htmlform."

The whole website compiles without any errors - I only receive this error
when I attempt to call the service...

How can I prevent my asmx webservice to attempt inheriting from base_Page
which inherits from System.Web.UI.Page - as I specifically defined my
webservice type????

Any help is greatly appreciated.

Jul 13 '07 #2
Thank you Teemu - it was it - it also occurs when I try to (web) reference
the service from another project.
As per your other post, I had to remove page-specific code from the site
web.config - and them I could reference the service.

"Teemu Keiski" wrote:
Hi,

issue occurs when you try to open the asmx in web browser since it is the
test page which asp.net runs behind the scenes, it does not have server-side
form only but when you use HTTP POST with the test form

You'll find the file which is run by ASP.NET by looking at
DefaultWsdlHelpGenerator.aspx on
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONF IG

Simple way to get past this is to set MaintainScrollPositionOnPostBack on
page directives directly.

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net
"Sergey Poberezovskiy" <Se*****************@discussions.microsoft.comwrot e
in message news:97**********************************@microsof t.com...
In my ASP.Net 2.0 website I defined base page type in web config as
follows:
<pages MaintainScrollPositionOnPostback="true" pageBaseType="base_Page" />
It all works fine for the pages.

Now I am adding webservices to the site - I use the same business objects
and authentication/authorization.

The code behind the webservice is trivial:

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class MyService : System.Web.Services.WebService
{}

The problem is that when webservice is initiated, the compiler is trying
to
inherit my webservice from base_Page class - and obviously fails with the
following error:
"The MaintainScrollPositionOnPostback page directive cannot be set without
an htmlform."

The whole website compiles without any errors - I only receive this error
when I attempt to call the service...

How can I prevent my asmx webservice to attempt inheriting from base_Page
which inherits from System.Web.UI.Page - as I specifically defined my
webservice type????

Any help is greatly appreciated.


Jul 16 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sathya | last post by:
Hi Am using an ASP.NET website. i have an excel template stored in a folder in the server. the excel template already has some data inside. i need to add some more data to the excel sheet...
1
by: Nalaka | last post by:
Hi, I am testing with Visual studio 2005, web projects. Situation: I have one solution with two web projects, created as file system projects. (I am tesing using the built in server, not IIS)...
2
by: elora_c | last post by:
I'm making a call to a webservice from my ASP.NET page. The web application has anonymous access turned off and Integrated Windows auth turned on. The web.config has <identity impersonate=true>. ...
2
by: Colin Young | last post by:
I am creating some code that runs in Excel using VSTO. I am trying to get some xml from a webservice, using the following code: GBWPipeline.PipelineService pipeline = new...
3
by: Merav Orion via .NET 247 | last post by:
I have a problem calling webservice from client side javascript. The javascript call the settimeout() method. when the user press submit button it ignore the press and keep refreshing the page. it...
6
by: kenneth fleckenstein nielsen | last post by:
Hi guru's It runs ok on my developmaschine, and on the test server that i've set up. but fails after installing on the customers server. I made a XML webservice that does these steps: a) access a...
1
by: jens Jensen | last post by:
Hello , i'm calling a webservice generated with oracle webservice java tools. I'm not able to add a web reference to a .net client the usual way with visual studio 2005. I was therefore...
3
by: pranesh.nayak | last post by:
I'm facing an error:"String was not recognized as a valid DateTime" whille accessing DateTime from webservice. And when I try to set DateTime to the same webservice it fails with error:"Date...
0
by: sirmoreno | last post by:
Hi, In my web site I have some long tasks that I want to call without delaying the page rendering - without making the thread that handels the page request wait for the long task to end. I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.