Request format is unrecognized for URL unexpectedly ending in '/mex'
Locked
- I've created a Web Service via VS 2008 and have it deployed to my web server (web site with SSL).
I've created a VS 2008 Test Project to test out my web service. I have no problems adding the service reference to the project. In fact the code returns "True" - which indicates the service was successfully executed. My consumer code is:
1 Try 2 3 4 Dim EmailService As New EmailWebServices.EMailWebServiceSoapClient 5 Dim Result As Boolean = False 6 Result = EmailService.RequestPassword("somebogustokenvalue", EmailWebServices.Applications.DRM, "validEmailaddress@msn.com") 7 8 Me.Label1.Text = CStr(Result) 9 10 Catch ex As Exception 11 12 MessageBox.Show(ex.Message) 13 14 End Try 15 The EmailService doesn't do what it supposed to do, send the Email. So I RDP to my web server and check the Event Log and find this error under Applications ASP.NET:
Trust level: Full Application Virtual Path: /WebServices Application Path: C:\Inetpub\wwwroot\MyWebSite\WebServices\ Machine name: SERVER-S1 Process information: Process ID: 4260 Process name: w3wp.exe Account name: NT AUTHORITY\NETWORK SERVICE Exception information: Exception type: InvalidOperationException Exception message: Request format is unrecognized for URL unexpectedly ending in '/mex'. Request information: Request URL: https://www.mywebsite.com:443/webservices/emailservices.asmx/mex Where is /mex coming from?? I have no idea what this is, where it is, or even where to go look from here. Any suggestions?
I've tried the suggestion of adding to my web.config for my .asmx, but that didn't help:<protocols> <add name="HttpGet"/> <add name="HttpPost"/> </protocols>
Thanks, Rob.
Answers
A Service Reference is for WCF. WCF uses the /mex (Metadata EXchange) protocol to do the equivalent of ?WSDL. If that's the issue here, then the "/mex" error may not be the reason why your service fails.
In any case, you can still use web references. Click the Advanced button on the Add Service Reference page, then click Add Web Reference at the bottom. Try your test with a web reference and see what happens.
Use File->New Project to create Web Service Projects- Marked As Answer byAmadeo Casas - MSFTModeratorThursday, November 05, 2009 4:35 PM
All Replies
A Service Reference is for WCF. WCF uses the /mex (Metadata EXchange) protocol to do the equivalent of ?WSDL. If that's the issue here, then the "/mex" error may not be the reason why your service fails.
In any case, you can still use web references. Click the Advanced button on the Add Service Reference page, then click Add Web Reference at the bottom. Try your test with a web reference and see what happens.
Use File->New Project to create Web Service Projects- Marked As Answer byAmadeo Casas - MSFTModeratorThursday, November 05, 2009 4:35 PM
- Hi, did you solve your problem? I have the same error.
Thanks - Please start a new thread, and provide detail. In this case, there does not appear to have been an actual problem.
John Saunders
WCF is Web Services. They are not two separate things.
Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
Use File->New Project to create Web Service Projects


