Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'. http://forums.asp.net/t/988377.aspx/1?Request+format+is+unrecognized+for+URL+unexpectedly+ending+in+GetEmployees+Fri, 28 Oct 2011 13:22:22 -04009883771278431http://forums.asp.net/p/988377/1278431.aspx/1?Request+format+is+unrecognized+for+URL+unexpectedly+ending+in+GetEmployees+Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'. <p>Hello and thank you for taking a moment. Let me say that I am brand new to Web Services. Please forgive my ignorance on some of these issues. I have created a web service in VS 2005.&nbsp; When I go to run the code my web service&nbsp;description (test)&nbsp;pages come up fine.( These are the pages that give a description of the web service along with the available methods)&nbsp;I click on the name of one of the methods&nbsp;and come to the the page that lets me invoke that method. </p> <p>When I click the 'invoke' button I receive a page not displayed error and when I refresh VS then throws me the following Error:</p> <p><em>Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'.</em></p> <p>indeed the url of this page is <a href="http://localhost:1223/WebSite12/Service.asmx/GetEmployees"> http://localhost:1223/WebSite12/Service.asmx/GetEmployees</a></p> <p>I just don't know what to do in order to get the method to give me the information I want. The book I am borrowing code from says it should work. Below is my asmx and codebehind. Any help you could provide would be greatly appreciated.- Jason</p> <p>---------------------------------------------------------------------------------------------</p> <p>Service.asmx ( this is set as my start page of my project)</p> <font size="2"> <p>&lt;%</font><font color="#0000ff" size="2">@</font><font size="2"> </font><font color="#800000" size="2">WebService</font><font size="2"> </font><font color="#ff0000" size="2">Language</font><font color="#0000ff" size="2">=&quot;C#&quot;</font><font size="2"> </font><font color="#ff0000" size="2">CodeBehind</font><font color="#0000ff" size="2">=&quot;~/App_Code/Service.cs&quot;</font><font size="2"> </font><font color="#ff0000" size="2">Class</font><font color="#0000ff" size="2">=&quot;EmployeesService&quot;</font><font size="2"> %&gt;</font></p> <p><font size="2"><strong>------------------------------------------------------------------------------------------------------------</strong></font></p> <p><strong><font size="2">App_Code\Service.cs (CodeBehind)]</font></strong></p> <font color="#0000ff" size="2"> <p>using</font><font size="2"> System;</p> </font><font color="#0000ff" size="2"> <p>using</font><font size="2"> System.Web;</p> </font><font color="#0000ff" size="2"> <p>using</font><font size="2"> System.Collections;</p> </font><font color="#0000ff" size="2"> <p>using</font><font size="2"> System.Web.Services;</p> </font><font color="#0000ff" size="2"> <p>using</font><font size="2"> System.Web.Services.Protocols;</p> </font><font color="#0000ff" size="2"> <p>using</font><font size="2"> System.Data.SqlClient;</p> </font><font color="#0000ff" size="2"> <p>using</font><font size="2"> System.Data;</p> <p>&nbsp;</p> </font><font color="#808080" size="2"> <p>///</font><font color="#008000" size="2"> </font><font color="#808080" size="2">&lt;summary&gt;</p> <p>///</font><font color="#008000" size="2"> Summary description for WebService</p> </font><font color="#808080" size="2"> <p>///</font><font color="#008000" size="2"> </font><font color="#808080" size="2">&lt;/summary&gt;</p> <p>///</font><font color="#008000" size="2"> </p> <p>&nbsp;</p> <p>&nbsp;</p> </font><font size="2"> <p>[</font><font color="#008080" size="2">WebService</font><font size="2">(Name = </font><font color="#800000" size="2">&quot;Employees Service&quot;</font><font size="2">, Description = </font><font color="#800000" size="2">&quot;Retrieve the NorthWind Employees&quot;</font><font size="2">)]</p> </font><font color="#0000ff" size="2"> <p>public</font><font size="2"> </font><font color="#0000ff" size="2">class</font><font size="2"> </font><font color="#008080" size="2">EmployeesService</font><font size="2"> : System.Web.Services.</font><font color="#008080" size="2">WebService</p> </font><font size="2"> <p>{</p> <p></font><font color="#0000ff" size="2">private</font><font size="2"> </font><font color="#0000ff" size="2">string</font><font size="2"> connectionString;</p> <p></font><font color="#0000ff" size="2">public</font><font size="2"> EmployeesService()</p> <p>{</p> <p></font><font color="#0000ff" size="2">string</font><font size="2"> connectionString =</p> <p>System.Web.Configuration.</font><font color="#008080" size="2">WebConfigurationManager</font><font size="2">.ConnectionStrings[</font><font color="#800000" size="2">&quot;Northwind&quot;</font><font size="2">].ConnectionString;</p> <p>}</p> <p>[</font><font color="#008080" size="2">WebMethod</font><font size="2">(Description = </font><font color="#800000" size="2">&quot;Returns the total number of Employees.&quot;</font><font size="2">)]</p> <p></font><font color="#0000ff" size="2">public</font><font size="2"> </font><font color="#0000ff" size="2">int</font><font size="2"> GetEmployeesCount()</p> <p>{</p> <p></font><font color="#008080" size="2">SqlConnection</font><font size="2"> con = </font><font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">SqlConnection</font><font size="2">(connectionString);</p> <p></font><font color="#0000ff" size="2">string</font><font size="2"> sql = </font> <font color="#800000" size="2">&quot;Select Count(*) From Employees&quot;</font><font size="2">;</p> <p></font><font color="#008080" size="2">SqlCommand</font><font size="2"> cmd = </font> <font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">SqlCommand</font><font size="2">(sql, con);</p> <p></font><font color="#008000" size="2">//Open the connection and Get the value.</p> </font><font size="2"> <p>con.Open();</p> <p></font><font color="#0000ff" size="2">int</font><font size="2"> numEmployees = -1;</p> <p></font><font color="#0000ff" size="2">try</p> </font><font size="2"> <p>{</p> <p>numEmployees = (</font><font color="#0000ff" size="2">int</font><font size="2">)cmd.ExecuteScalar();</p> <p>}</p> <p></font><font color="#0000ff" size="2">finally</p> </font><font size="2"> <p>{</p> <p>con.Close();</p> <p>}</p> <p></font><font color="#0000ff" size="2">return</font><font size="2"> numEmployees;</p> <p>}</p> <p>[</font><font color="#008080" size="2">WebMethod</font><font size="2">(Description = </font><font color="#800000" size="2">&quot;Return full list of employees.&quot;</font><font size="2">)]</p> <p></font><font color="#0000ff" size="2">public</font><font size="2"> </font><font color="#008080" size="2">DataSet</font><font size="2"> GetEmployees()</p> <p>{</p> <p></font><font color="#008000" size="2">// Create the command and the connection.</p> </font><font size="2"> <p></font><font color="#0000ff" size="2">string</font><font size="2"> sql = </font> <font color="#800000" size="2">&quot;SELECT EmployeeID, LastName,FirstName, Title, &quot;</font><font size="2"> &#43;</p> <p></font><font color="#800000" size="2">&quot;TitleOfCourtesy,HomePhone FROM Employees&quot;</font><font size="2">;</p> <p></font><font color="#008080" size="2">SqlConnection</font><font size="2"> con = </font><font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">SqlConnection</font><font size="2">(connectionString);</p> <p></font><font color="#008080" size="2">SqlDataAdapter</font><font size="2"> da = </font><font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">SqlDataAdapter</font><font size="2">(sql, con);</p> <p></font><font color="#008080" size="2">DataSet</font><font size="2"> ds = </font> <font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">DataSet</font><font size="2">();</p> <p></font><font color="#008000" size="2">//Fill Data Set</p> </font><font size="2"> <p>da.Fill(ds, </font><font color="#800000" size="2">&quot;employees&quot;</font><font size="2">);</p> <p></font><font color="#0000ff" size="2">return</font><font size="2"> ds;</p> <p>}</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>}</p> </font> <p><strong><font size="2"></font></strong>&nbsp;</p> <p><strong><font size="2"></font></strong>&nbsp;</p> <p><font size="2"><strong></strong>&nbsp;</p> </font> 2006-05-07T04:18:51-04:001278480http://forums.asp.net/p/988377/1278480.aspx/1?Re+Request+format+is+unrecognized+for+URL+unexpectedly+ending+in+GetEmployees+Re: Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'. Note that the string you set in the constructor is not visible outside the constructor.<br> Other than that, the code works fine on ASP.NET 2.0<br> <br> The page returns XML at the link you mentioned, but to work properly it must be accompanied by form data and web service headers.&nbsp; You should expect the URL error if you just paste in the asmx/GetEmployees link.<br> <br> I assume &quot;page not displayed error&quot; was a typo?&nbsp; Tell us more about the initial error.<br> <br> Does Invoke work properly for GetEmployeesCount()?<br> 2006-05-07T08:33:18-04:001278534http://forums.asp.net/p/988377/1278534.aspx/1?Re+Request+format+is+unrecognized+for+URL+unexpectedly+ending+in+GetEmployees+Re: Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'. <p>Hello and thanks again. I am assuming the strings you are referring to are my SQL expressions. I am not 100% what you mean by &quot;visible'. Again ... I apologize for my ignorance. Do you mean that the expreesion can only be used when the particular method is called? </p> <p>You said to work properly it must be accompanied by form data and web service headers.Not really sure what this means completely. Do you mean that I have to create an aspx with a form on it? I don't really know what Web Service Headers are? </p> <p>One thing I didn't mention is that on my Invoke page for GetEmployees(). There is a message underneath my Invoke button that says this message:</p> <p><span>-----------------------------------------------------------------------------------------------------&nbsp;SOAP 1.1</p> <p>The following is a sample SOAP 1.1 request and response. The <font class="value" color="#00008b"> <strong>placeholders</strong></font> shown need to be replaced with actual values.</p> <pre>POST /WebSite12/Service.asmx HTTP/1.1 Host: localhost Content-Type: text/xml; charset=utf-8 Content-Length: <font class="value" color="#00008b"><strong>length</strong></font> SOAPAction: &quot;http://tempuri.org/GetEmployees&quot; &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;soap:Envelope xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt; &lt;soap:Body&gt; &lt;GetEmployees xmlns=&quot;http://tempuri.org/&quot; /&gt; &lt;/soap:Body&gt; &lt;/soap:Envelope&gt;</pre> <pre>HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: <font class="value" color="#00008b"><strong>length</strong></font> &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;soap:Envelope xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt; &lt;soap:Body&gt; &lt;GetEmployeesResponse xmlns=&quot;http://tempuri.org/&quot;&gt; &lt;GetEmployeesResult&gt; &lt;xsd:schema&gt;<font class="value" color="#00008b"><strong>schema</strong></font>&lt;/xsd:schema&gt;<font class="value" color="#00008b"><strong>xml</strong></font>&lt;/GetEmployeesResult&gt; &lt;/GetEmployeesResponse&gt; &lt;/soap:Body&gt; &lt;/soap:Envelope&gt;</pre> </span><span> <h3>SOAP 1.2</h3> <p>The following is a sample SOAP 1.2 request and response. The <font class="value" color="#00008b"> <strong>placeholders</strong></font> shown need to be replaced with actual values.</p> <pre>POST /WebSite12/Service.asmx HTTP/1.1 Host: localhost Content-Type: application/soap&#43;xml; charset=utf-8 Content-Length: <font class="value" color="#00008b"><strong>length</strong></font> &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;soap12:Envelope xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:soap12=&quot;http://www.w3.org/2003/05/soap-envelope&quot;&gt; &lt;soap12:Body&gt; &lt;GetEmployees xmlns=&quot;http://tempuri.org/&quot; /&gt; &lt;/soap12:Body&gt; &lt;/soap12:Envelope&gt;</pre> <pre>HTTP/1.1 200 OK Content-Type: application/soap&#43;xml; charset=utf-8 Content-Length: <font class="value" color="#00008b"><strong>length</strong></font> &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;soap12:Envelope xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:soap12=&quot;http://www.w3.org/2003/05/soap-envelope&quot;&gt; &lt;soap12:Body&gt; &lt;GetEmployeesResponse xmlns=&quot;http://tempuri.org/&quot;&gt; &lt;GetEmployeesResult&gt; &lt;xsd:schema&gt;<font class="value" color="#00008b"><strong>schema</strong></font>&lt;/xsd:schema&gt;<font class="value" color="#00008b"><strong>xml</strong></font>&lt;/GetEmployeesResult&gt; &lt;/GetEmployeesResponse&gt; &lt;/soap12:Body&gt; &lt;/soap12:Envelope&gt;</pre> </span><span> <h3>HTTP POST</h3> <p>The following is a sample HTTP POST request and response. The <font class="value" color="#00008b"> <strong>placeholders</strong></font> shown need to be replaced with actual values.</p> <pre>POST /WebSite12/Service.asmx/GetEmployees HTTP/1.1 Host: localhost Content-Type: application/x-www-form-urlencoded Content-Length: <font class="value" color="#00008b"><strong>length</strong></font> </pre> <pre>HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: <font class="value" color="#00008b"><strong>length</strong></font> &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;DataSet xmlns=&quot;http://tempuri.org/&quot;&gt; &lt;schema xmlns=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;<font class="value" color="#00008b"><strong>schema</strong></font>&lt;/schema&gt;<font class="value" color="#00008b"><strong>xml</strong></font>&lt;/DataSet&gt;</pre> <pre>-------------------------------------------------------------</pre> <pre></span><span><strong><font size="4">I don't really know if that&nbsp;&nbsp;was helpful or not....</font></strong></pre> </span> <p>When I click my invoke button I get a 'Page&nbsp;cannot be displayed'&nbsp;error. (&nbsp;HTTP 500 - Internal server error Internet Explorer Please try the following:...One of the options listed is to refresh.) I refresh this page and this when I get my Url Error.</p> <p>-----------------------------------------------------------------------------------------------------<i></i></p> <p><i>Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'.</i> </p> <p><font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "><b>Description: </b>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. <br> <br> <b>Exception Details: </b>System.InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'.</font></p> <p><font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">-----------------------------------------------------------------------------------------------------</font></p> <p><font face="Arial">Any help would be greatly appreciated and I thank you for your time and patience. - Jason<br> </font></p> 2006-05-07T13:31:06-04:001278603http://forums.asp.net/p/988377/1278603.aspx/1?Re+Request+format+is+unrecognized+for+URL+unexpectedly+ending+in+GetEmployees+Re: Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'. <font face="Arial" size="4"><b>&quot;not visible&quot;<br> </b></font>The code block:<br> <font size="2"></font> <p><font size="2">{</font><br> <font color="#0000ff" size="2">string</font><font size="2"> connectionString = System.Web.Configuration.</font><font color="#008080" size="2">WebConfigurationManager</font><font size="2">.ConnectionStrings[</font><font color="#800000" size="2">&quot;Northwind&quot;</font><font size="2">].ConnectionString;<br> }</font></p> Basically creates a NEW variable named connectionString inside those brackets (called &quot;scope&quot;).&nbsp; While &quot;in scope&quot;, it hides the one you are actually trying to set.&nbsp; Then, when you leave the code block, it is gone.&nbsp; What you probably intended was:<br> <p><font size="2">{</font><br> <font size="2">connectionString = System.Web.Configuration.</font><font color="#008080" size="2">WebConfigurationManager</font><font size="2">.ConnectionStrings[</font><font color="#800000" size="2">&quot;Northwind&quot;</font><font size="2">].ConnectionString;<br> }</font></p> <p><font size="2"><br> </font></p> <p><font face="Arial"><b><font size="4">Page <font color="#ff0000">can</font>not be displayed... Internal server error</font></b></font></p> <p>Yes, probably just indicates that the variable scope issue we've already discussed generated an exception, regarding which the server knows more about but isn't telling.&nbsp; It's <b>your</b> server, don't take that crap.&nbsp; Turn on debugging for the project.&nbsp; Also turn on in-client-browser error output for the web site.&nbsp; The place to set these two items varies depending on the version you are using.&nbsp; Turn it all back off before you put anything on the public 'net.</p> <br> <br> <p><b><font face="Arial" size="4">GetEmployeesCount()</font></b></p> <p>You still didn't tell us if this other Invoke works.&nbsp; I suspect it doesn't.<br> </p> 2006-05-07T17:34:50-04:001278635http://forums.asp.net/p/988377/1278635.aspx/1?Re+Request+format+is+unrecognized+for+URL+unexpectedly+ending+in+GetEmployees+Re: Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'. <font color="#0000ff"><font size="2">Well... I know debugging is usually set in the Web.Config. and I have</font>&nbsp;<font size="2">a</font></font><font size="2"> </font><font color="#0000ff"><font size="2">&lt;</font></font><font size="2"><font color="#800000">compilation</font><font color="#0000ff"> </font><font color="#ff0000">debug</font><font color="#0000ff">=</font>&quot;<font color="#0000ff">true</font>&quot;<font color="#0000ff">/&gt; in the Web.Config. I must admit I don't know how to turn on in-client-browser error output for the web site.I am using ASP.NET 2.0 with Visual Studio 2005. I am using Internet Explorer 6.0 as my browser. And yes you are correct,&nbsp; <font face="Arial">GetEmployeesCount() does not work, I get the same URL error when I try to invoke the Method<strong>.</strong> I took the data type string off of my ConnectionString to eliminate the scope problem but to no avail.&nbsp; Thanks again- Jason&nbsp;</font></font></font> 2006-05-07T18:40:42-04:001278681http://forums.asp.net/p/988377/1278681.aspx/1?Re+Request+format+is+unrecognized+for+URL+unexpectedly+ending+in+GetEmployees+Re: Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'. My Computer:Manage:Services and Applications:Internet Information Services:&lt;your website&gt;:Tab(ASP.NET):Button(Edit Configuration...):Tab(Custom Errors)<br> <br> SELECT: Remote Only (or Off, if you are working remotely)<br> <br> However, it actually sounds like you might be seeing Internet Explorer covering up the error.&nbsp; It sounds familiar, although I primarily use Firefox so I don't know offhand.&nbsp; Go to IE:Tools:Internet Options:Advanced:Browsing<br> <br> DESELECT: Show friendly HTTP error messages<br> <br> <br> Shannon<br> 2006-05-07T20:21:13-04:001278682http://forums.asp.net/p/988377/1278682.aspx/1?Re+Request+format+is+unrecognized+for+URL+unexpectedly+ending+in+GetEmployees+Re: Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'. Also, if you are testing the app locally, use &quot;F5&quot; to start debugging.&nbsp; Try setting a breakpoint in your application to be sure it is working.&nbsp; Focus should switch back to Visual Studio when the breakpoint is hit.<br> <br> To enable all the debugging goodies, be sure the following is set:<br> <br> Visual Web Developer Menu<br> &nbsp;&nbsp;&nbsp; Website<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Start Options<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Debuggers<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SELECT: ASP.NET<br> <br> <br> Shannon<br> 2006-05-07T20:28:30-04:001281111http://forums.asp.net/p/988377/1281111.aspx/1?Re+Request+format+is+unrecognized+for+URL+unexpectedly+ending+in+GetEmployees+Re: Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'. i am having a similar problem. i have a web service that works fine when i call it from the local machine. however, from other machines, i get the same error as in the topic title. i am calling the web service via ajax (not atlas). when i run the ajax code in the browser on my dev machine, it works great. however, from any other machine, the web service returns a 500 HTTP code, and i get the following in the windows application event log:<br> <br> <blockquote>Event code: 3005 <br> Event message: An unhandled exception has occurred. <br> Event time: 5/9/2006 4:47:53 PM <br> Event time (UTC): 5/9/2006 11:47:53 PM <br> Event ID: 9439fbe4d34a45a8823c2e860a466c7b <br> Event sequence: 311 <br> Event occurrence: 6 <br> Event detail code: 0 <br> &nbsp;<br> Application information: <br> &nbsp;&nbsp;&nbsp; Application domain: /LM/W3SVC/1/Root/porders-1-127916911407506700 <br> &nbsp;&nbsp;&nbsp; Trust level: Full <br> &nbsp;&nbsp;&nbsp; Application Virtual Path: /porders <br> &nbsp;&nbsp;&nbsp; Application Path: c:\inetpub\wwwroot\porders\ <br> &nbsp;&nbsp;&nbsp; Machine name: XXXXX<br> &nbsp;<br> Process information: <br> &nbsp;&nbsp;&nbsp; Process ID: 4424 <br> &nbsp;&nbsp;&nbsp; Process name: w3wp.exe <br> &nbsp;&nbsp;&nbsp; Account name: NT AUTHORITY\NETWORK SERVICE <br> &nbsp;<br> Exception information: <br> &nbsp;&nbsp;&nbsp; Exception type: InvalidOperationException <br> &nbsp;&nbsp;&nbsp; Exception message: Request format is unrecognized for URL unexpectedly ending in '/QueryVendp'. <br> &nbsp;<br> Request information: <br> &nbsp;&nbsp;&nbsp; Request URL: http://XXXXX/porders/WebSvc.asmx/QueryVendp <br> &nbsp;&nbsp;&nbsp; Request path: /porders/WebSvc.asmx/QueryVendp <br> &nbsp;&nbsp;&nbsp; User host address: XXXXX<br> &nbsp;&nbsp;&nbsp; User: XXXXX <br> &nbsp;&nbsp;&nbsp; Is authenticated: True <br> &nbsp;&nbsp;&nbsp; Authentication Type: Negotiate <br> &nbsp;&nbsp;&nbsp; Thread account name: NT AUTHORITY\NETWORK SERVICE <br> &nbsp;<br> Thread information: <br> &nbsp;&nbsp;&nbsp; Thread ID: 1 <br> &nbsp;&nbsp;&nbsp; Thread account name: NT AUTHORITY\NETWORK SERVICE <br> &nbsp;&nbsp;&nbsp; Is impersonating: True <br> &nbsp;&nbsp;&nbsp; Stack trace:&nbsp;&nbsp;&nbsp; at System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response)<br> &nbsp;&nbsp; at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath)<br> &nbsp;&nbsp; at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)<br> &nbsp;&nbsp; at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()<br> &nbsp;&nbsp; at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously)<br> &nbsp;<br> &nbsp;<br> Custom event details: <br> </blockquote> here is the code for the web method i'm calling:<br> <br> &nbsp;<pre class="prettyprint">[WebMethod(CacheDuration=60)] public XmlDocument QueryVendp(int iCompanyCode, string sVendorCode) { XmlDocument oXML; oXML = new XmlDocument(); try { oXML.LoadXml((string)SqlHelper.ExecuteScalar(Config.ConnStringOrders, &quot;selectVendor4XML&quot;, iCompanyCode, sVendorCode)); } catch (Exception err) { DataAccess.LogEvent(&quot;none&quot;, false, &quot;WebSvc&quot;, &quot;QueryVendp&quot;, &quot;iCompanyCode = &quot; &#43; iCompanyCode.ToString() &#43; &quot;, sVendorCode = &quot; &#43; sVendorCode &#43; &quot;; &quot; &#43; err.Message); } return oXML; }</pre>&nbsp;here's the javascript that calls the web service:<br><br>&nbsp;<pre class="prettyprint">xmlhttp.open(<span class="st">"POST"</span>, <span class="st">"WebSvc.asmx/QueryVendp?iCompanyCode=1&amp;sVendorCode=99999"</span>, <span class="kwd">true</span>);</pre>&nbsp;<br> again, this all works great on the dev machine. it only fails when accessed remotely. is this some sort of permissions or config issue? thanks.<br> 2006-05-10T00:04:01-04:001281671http://forums.asp.net/p/988377/1281671.aspx/1?Re+Request+format+is+unrecognized+for+URL+unexpectedly+ending+in+GetEmployees+Re: Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'. Could be permissions, but I think, as was the main topic in the previous post, you first have to find out what the error is.<br> <br> If you are using Internet Explorer, turn off (on the machine you see the useless error on)<br> &nbsp;&nbsp;&nbsp; Show friendly HTTP error messages<br> In tools, options, advanced.<br> <br> <br> 2006-05-10T13:07:32-04:001282161http://forums.asp.net/p/988377/1282161.aspx/1?Re+Request+format+is+unrecognized+for+URL+unexpectedly+ending+in+GetEmployees+Re: Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'. the error message is right there in my post, from the event log. since it's being called via ajax, you don't see it in the browser. <br> 2006-05-10T18:45:19-04:001282515http://forums.asp.net/p/988377/1282515.aspx/1?Re+Request+format+is+unrecognized+for+URL+unexpectedly+ending+in+GetEmployees+Re: Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'. i found the solution. i put the following in my web.config<br> <br> <br> &nbsp;<pre class="prettyprint">&lt;webServices&gt; &lt;protocols&gt; &lt;add name=&quot;HttpGet&quot;/&gt; &lt;add name=&quot;HttpPost&quot;/&gt; &lt;/protocols&gt; &lt;/webServices&gt;</pre>&nbsp; 2006-05-10T23:23:07-04:001282671http://forums.asp.net/p/988377/1282671.aspx/1?Re+Request+format+is+unrecognized+for+URL+unexpectedly+ending+in+GetEmployees+Re: Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'. oops, I think I replied to the wrong post the last time.&nbsp; lots of people posting about error 500s.&nbsp; you know, after you sign in you have to find the thread again.&nbsp; Thanks for posting your solution.<br> 2006-05-11T03:47:25-04:002260240http://forums.asp.net/p/988377/2260240.aspx/1?Re+Request+format+is+unrecognized+for+URL+unexpectedly+ending+in+GetEmployees+Re: Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'. <p>Ben74, thank you so much for posting this.&nbsp; It is very easy to forget to add this in the web.config especially if you did not start the project as a webservice project.&nbsp;The error does not even give a clue that this is the issue.&nbsp; I was pulling my hair out for a while with this error.&nbsp; Adding the above lines to the web.config fixed the error for me.</p> 2008-03-27T19:59:16-04:002308315http://forums.asp.net/p/988377/2308315.aspx/1?Re+Request+format+is+unrecognized+for+URL+unexpectedly+ending+in+GetEmployees+Re: Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'. <p></p> <blockquote><span class="icon-blockquote"></span> <h4>TwasBrillig</h4> Could be permissions, but I think, as was the main topic in the previous post, you first have to find out what the error is.<br> <br> If you are using Internet Explorer, turn off (on the machine you see the useless error on)<br> &nbsp;&nbsp;&nbsp; Show friendly HTTP error messages<br> In tools, options, advanced.<br> <br> <br> </blockquote> Thank you. It solved my problem. I am using IE7 with VS .NET 2003, opening a web service page. <p></p> 2008-04-19T09:20:34-04:002358079http://forums.asp.net/p/988377/2358079.aspx/1?Re+Request+format+is+unrecognized+for+URL+unexpectedly+ending+in+GetEmployees+Re: Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'. <p><em><font face="Times New Roman" size="3">Phew!!!!</font></em></p> <p><font face="Times New Roman" size="3">Thank you very much!&nbsp; Fixed my problem right up!</font></p> <p>&nbsp;</p> 2008-05-14T18:30:01-04:002599052http://forums.asp.net/p/988377/2599052.aspx/1?Re+Request+format+is+unrecognized+for+URL+unexpectedly+ending+in+GetEmployees+Re: Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'. <p>Awesome, that fixed my problem perfectly.</p> 2008-09-04T02:58:47-04:002909572http://forums.asp.net/p/988377/2909572.aspx/1?Re+Request+format+is+unrecognized+for+URL+unexpectedly+ending+in+GetEmployees+Re: Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'. <p>&nbsp;Thanks a ton.</p> <p>I had the same problem as error message posted above. My problem was that I was calling the webservice with a plain old http form post - which worked fine when I built and ran the web service project locally - but once I deployed it I got the error.&nbsp; </p> <p>What is with Microsoft with stuff like this? Why would they let this code run locally but not once deployed? If it works in one place it should work in the other...<br> </p> 2009-02-02T14:31:32-05:002917168http://forums.asp.net/p/988377/2917168.aspx/1?Re+Request+format+is+unrecognized+for+URL+unexpectedly+ending+in+GetEmployees+Re: Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'. <p>Likely the configuration was different between the local machine and the server you deployed to.</p> <p>This isn't specific to Microsoft. This kind of thing is endemic to computers - it was happening to me over 30 years ago, before there <em>was</em> a Microsoft. There will just naturally be differences between Development and Production. That implies that the behavior of your program could differ when it's deployed to Production. Proper QA can help ensure this does not happen in any bad way.</p> 2009-02-05T01:29:09-05:003150217http://forums.asp.net/p/988377/3150217.aspx/1?Re+Request+format+is+unrecognized+for+URL+unexpectedly+ending+in+GetEmployees+Re: Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'. could u help me in rectifying the same issue for me 2009-05-08T09:47:32-04:003172757http://forums.asp.net/p/988377/3172757.aspx/1?Re+Request+format+is+unrecognized+for+URL+unexpectedly+ending+in+GetEmployees+Re: Request format is unrecognized for URL unexpectedly ending in '/GetEmployees'. <p></p> <blockquote><span class="icon-blockquote"></span> <h4>Ben74</h4> i found the solution. i put the following in my web.config<br> <br> <br> &nbsp; <p></p> <pre class="prettyprint">&lt;webServices&gt; &lt;protocols&gt; &lt;add name=&quot;HttpGet&quot;/&gt; &lt;add name=&quot;HttpPost&quot;/&gt; &lt;/protocols&gt; &lt;/webServices&gt;</pre> <p>&nbsp;</p> </blockquote> &nbsp; <p></p> <p>Thanks a lot... that was a quick solution that made my life easy <br> </p> 2009-05-19T13:51:25-04:00