IIS Won't allow Visual Studio to add my Service Reference

foozball3000

Executive Member
Joined
Oct 28, 2008
Messages
5,945
Reaction score
1,777
Location
Kyalami
Hi Guys,

I'm having trouble adding a webservice reference on our web project. Here's the setup:

We have a web service on the server that exposes all the login and other functionality that our website accesses.
When it was hosted on our Server01, it worked 100%. Then we had to migrate it to our Development server... and that's where the trouble started.

They run the same windows version and the same IIS version (6).
The web service was set up exactly the same way as I did it on Server01. But there were a couple of issues that I've resolved. Anyway, now I can access the .svc file from my browser (Still using the internal network) but if I add the http path into Visual Studio, it gives me the following error:

Metadata contains a reference that cannot be resolved: 'http://developmentserver.xxdomain.local:xx/xxLibrary.xxService.svc?wsdl'.
The WSDL document contains links that could not be resolved.
There was an error downloading 'http://developmentserver.xxdomain.local:xx/xxLibrary.xxService.svc?xsd=xsd0'.
The underlying connection was closed: An unexpected error occurred on a receive.
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
An existing connection was forcibly closed by the remote host
Metadata contains a reference that cannot be resolved: 'http://developmentserver:xx/xxLibrary.xxService.svc'.
Content Type application/soap+xml; charset=utf-8 was not supported by service http://developmentserver:xx/xxLibrary.xxService.svc. The client and service bindings may be mismatched.
The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'..
If the service is defined in the current solution, try building the solution and adding the service reference again.

This doesn't make any sense, because all the solutions I find online refer to modifying our .config files. But the same code works 100% on Server01, and now on the Live Server...
I've checked the settings between the two servers side by side but I can't find anything different in the settings that can explain why my browser can access the .svc file, but Visual Studio can't (When adding a Service Reference)

I get the feeling that I'm missing something simple... please advise.

Software in use:
My PC : Win 7, Visual Studio 2010, .Net framework 4
Server(s) : Windows Server 2003 R2, .Net framework 4, IIS 6
 
These settings?
<system.serviceModel>
<diagnostics>
<messageLogging logEntireMessage="true" logMalformedMessages="true"
logMessagesAtServiceLevel="true" />
</diagnostics>
<services>
<service behaviorConfiguration="xxLibrary.xxServiceBehavior"
name="xxLibrary.xxService">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration=""
name="" contract="xxLibrary.IxxService" />
<endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
name="" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://developmentserver.xxdomain.local:xx/xxService/" />
</baseAddresses>
</host>
</service>
<service behaviorConfiguration="xxLibrary.xxLoginService"
name="xxLibrary.xxLoginService">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration=""
name="" contract="xxLibrary.IxxLoginService" />
<endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
name="" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://developmentserver.xxdomain.local:xx/xxLoginService/" />
</baseAddresses>
</host>
</service>
</services>

The binding is just standard Visual Studio > Add Service Reference, that's where I get the error.

(Sorry for the late reply, had to finish the service before the deadline. I just hosted the service on our live server and it worked, but I still need to set up (this) development server)
 
Looks like there's an error in your webservice. That is what it has been for me in the past. Could very well be you have set it up incorrectly on the dev
 
Top
Sign up to the MyBroadband newsletter
X