This is link which is explaining in detail, the problem i am facing right now.
I am getting a frequent exception whenever a call made to my web services. It returns appropriate results but still complaining about URL format.:-
Request format is unrecognized for URL
unexpectedly ending in
/WebServiceMethod
So what do you suggest guys?
Thanks.
There is quite a common issue that causes this error, that can easily be fixed by adding
<configuration>
<system.web>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
</system.web>
</configuration>
...to web.config. Hopefully that fixes it for you.
Related
Intermittently we see on a server the error
Request format is unrecognized for URL unexpectedly ending in /methodname
All solutions I have found for this error gives the same answer, which is what is answered in i.e. this question: Request format is unrecognized for URL unexpectedly ending in
The big problem for me here is that my web.config file already includes the necessary info:
<system.web>
<webServices>
<protocols>
<add name="HttpGet" />
<add name="HttpPost" />
</protocols>
</webServices>
</system.web>
And it obviously works as the webservice can be called just fine, until it suddenly fails for no apparent reason.
Restarting the webservice (by forcing a web.config change) or even restarting the computer always brings the service back up, until it fails again a day or two later.
What can cause this error, appart from the HttpGet/HttpPost settings?
I have a content management application in the root of my website, and I'm trying to use a different app (a billing application) under a sub-folder. Unfortunately, the web.config of the root site is interfering with the sub-app.
Is there a way to just disable web.config inheritance for a sub-folder?
Update:
As linked by Stephen Burris, using the <location> tag can prevent inheritance for part of the web config, as follows:
<?xml version="1.0"?>
<configuration>
<configSections>
....
</configSections>
<location path="." inheritInChildApplications="false">
<appSettings>
....
</appSettings>
<connectionStrings/>
<system.web>
....
</system.web>
<system.codedom>
....
</system.codedom>
<system.webServer>
....
</system.webServer>
</location>
<runtime>
....
</runtime>
</configuration>
The <configSections> and <runtime> sections will not accept being enclosed in the tag...so I guess this only does most of the job. Anybody know how to do it better?
There is an attribute that you can use in the root web.config file to cause it not to have its contents become inherited by child applications.
inheritInChildApplications
Blog about inheritInChildApplications
MSDN article on ASP.NET Configuration File Hierarcy and Inheritance
Put the part of the config that is not for inheritance inside
<location inheritInChildApplications="false">
<NotInheritedConfigPart/>
</location>
Config sections seem to be impossible to not inherit, but other parts of configuration can be "commented" out like this and don't get inherited.
If you can use 2 separate application pools, you can completely stop inheritance by using an attibute enableConfigurationOverride="false" in the applicationHost.config file as I described in this question: “Entry has already been added” - Two Separate App Pools
<add name="MyAppPool" enableConfigurationOverride="false" autoStart="true" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" >
<processModel identityType="NetworkService" />
</add>
In my opinion every time I've struggled with this the answer ends up being effectively NO - and I'm leaving this here for my future self to find so he doesn't waste any more time on it.
I've found this to be a huge problem when you just want to add something as a virtual directory inside an existing site. With a complex web.config files I've always just ended up giving up and moving it to a different application altogether.
I would explicitly define all of the settings required - never assume that any setting is still set to the default value.
For example, if you're defining a connectionString include a <clear /> tag before the <add name=... />, etc. For Membership define all of the attributes, including the cookie name. And so on.
It may make the file a bit bigger but it will definitely help you avoid the "but it worked on my box" scenario too :-)
I have faced this situation a few times. It seems that the parent poster's instincts are in the ball park. I have found that adding two entries seem to have solved it—both a <location> entry.
Find your <system.web>…</system.web>. Wrap it with a <location path="." inheritInChildApplications="false">.
Now check the parent site and make sure it still works.
Check the child: does it work or give an error?
If you still have an error, do the same thing with <system.webserver>; wrap the same <location> tag around it.
In summary - in the PARENT:
<location path="." inheritInChildApplications="false">
<system.web>
...
</system.web>
</location>
and maybe:
<location path="." inheritInChildApplications="false">
<system.webserver>
...
</system.webserver>
</location>
My .asmx web services is accessible to outside. So anybody can see methods by access url. Is there anyway to hide those methods to see outside, but accessible to project?
suggestions please.
To disable the documentation protocol ( hide The operations that are supported , The parameters that each operation accepts, The type of data that should be passed in those parameters ) for Web services follow any one of these 2 steps
add this in ur web.config
<system.web>
<webServices>
<wsdlHelpGenerator href="helpPage.aspx"></wsdlHelpGenerator>
</webServices>
</system.web>
Use following in web.config
<system.web>
<webServices>
<protocols>
<remove name="HttpPost" />
<remove name="HttpGet" />
<remove name="Documentation"/>
</protocols>
</webServices>
</system.web>
SOURCE - http://forums.asp.net/t/1185735.aspx
I am trying to build a desktop application that uses client application services to authenticate users through an ASP.Net MVC web app. The trouble is I can't seem to get the value for "Authentication service location" correct. It has something to do with the fact that I cannot find Authentication_JSON_AppService.axd when I browse to the default URL which is http://localhost55555/Authentication_JSON_AppService.axd.
Please can somebody help me implement this correctly.
Add this to your web.config:
<system.web.extensions>
<scripting>
<webServices>
<authenticationService enabled="true" requireSSL="false"/>
</webServices>
</scripting>
</system.web.extensions>
Also check your web.config for:
<httpHandlers>
....
<add verb="*" path="*_AppService.axd" validate=...
....
I have a webservice # http://recpushdata.cyndigo.com/Jobs.asmx but I'm not able to access it though I am adding it as a WebReference properly.
Any Help would be great.
AFAI can see, the asmx page has server errors, so you will not be able to access it.
Contact the admin of the web service to fix the errors.
Do you mean you are getting the "The test form is only available for requests from the local machine." error when accessing a method?
If so, you need to add the following into your <system.web> part of your web.config
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
This enables you to access the method from the local machine