c# - Generation of proxy works fine in one environment but not in the other? -
i have simple webserivce (wcf) hosted in windows service(selfhost). declaration of service looks :
<service behaviorconfiguration="myapp.serviceimplementation.myappintegration_behavior" name="myapp.serviceimplementation.myappintegration"> <endpoint binding="basichttpbinding" bindingconfiguration="basicmyappintegration" bindingnamespace="myapp.serviceimplementation" contract="myapp.servicecontracts.imyappintegration"/> <endpoint address="mex" binding="mexhttpbinding" contract="imetadataexchange"/> <host> <baseaddresses> <add baseaddress="http://localhost:8008/myappserviceutv/integration"/> </baseaddresses> </host> </service> i can brows wsdl url :
http://localhost:8008/myappserviceutv/integration?wsdl when adding service reference in visual studio 2012 exception :
exception
the document understood, not processed.
- the wsdl document contains links not resolved.
- there error downloading '
http://localhost:8008/myappserviceutv/integration?xsd=xsd0'. - unable connect remote server
metadata contains reference cannot resolved: 'http://mycomputer:8008/myappserviceutv/integration?wsdl'. content type application/soap+xml; charset=utf-8 not supported service http://mycomputer:8008/myappserviceutv/integration?wsdl. client , service bindings may mismatched. remote server returned error: (415) cannot process message because content type 'application/soap+xml; charset=utf-8' not expected type 'text/xml; charset=utf-8'.. if service defined in current solution, try building solution , adding service reference again.
moving dev environment
when moving service dev computer works great? why whould above problems in 1 environment? due strong security restrictions?
it sounds vs2012 instance off box service host machine. try changing config this...
<service behaviorconfiguration="myapp.serviceimplementation.myappintegration_behavior" name="myapp.serviceimplementation.myappintegration"> <endpoint binding="basichttpbinding" bindingconfiguration="basicmyappintegration" bindingnamespace="myapp.serviceimplementation" contract="myapp.servicecontracts.imyappintegration"/> <endpoint address="mex" binding="mexhttpbinding" contract="imetadataexchange"/> <host> <baseaddresses> <add baseaddress="http://{my qualified domain name}:8008/myappserviceutv/integration"/> </baseaddresses> </host> </service> okay. have confirmed problem...an explanation. .net 4.0 or less wcf produces multi-file wsdl files. base wsdl file links various files. link in wdsl file links other files using absolute uris opposed relative uris. when visual studio tries find other wdsl files fails find on "localhost".
with .net 4.5 wcf can generate single file wsdl solve problem. overall in opinion wcf 4.0 broken when dealing wsdl proxy generation.
Comments
Post a Comment