2016-03-21 31 views
0

Sorun: Dağıtılmış WCF hizmetimi aradığımda, tarayıcı boş bir svc dosyasını indirir ve bana hizmet xml dosyası içeren sayfayı göstermez.WCF servis çağrısı boş dosyayı döndürür/sayfa

Bağlam: WCF hizmetini barındıran web sunucusunu yeni bir sunucuya taşımak zorundayım. Bu hizmet, IIS çalıştıran eski sunucuda çalışıyordu. Yeni sunucuda 2 web sunucusu çalışıyor. IIS 8.5 ve WAMP 2.5, çünkü sunucu bir Php uygulamasını ve Jira'yı barındırır.

kurulumu: WAMP sunucu 80 bağlantı noktasına dinler ve sonra gerekirse, belirli bir bağlantı noktasına, IIS yönlendirir . Bu, kurulum için bir örnektir.

wamp yapılandırma (https-vhosts.confg):

<VirtualHost *:80>  
ServerName site.de 
ServerAlias www.site.de 
<Proxy *> 
    Require all granted 
</Proxy> 

ProxyRequests   Off 
ProxyPreserveHost  On 
ProxyPass    /  http://localhost:9050/ 
ProxyPassReverse  /  http://localhost:9050/ 

hizmet URL: https://www.site.de/folder/service.svc

Servis yapılandırma:

<system.serviceModel> 
<bindings> 
    <basicHttpBinding> 
    <binding name="someBinding" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="52428899"> 
     <readerQuotas maxDepth="64" maxStringContentLength="81920" maxArrayLength="163840" maxBytesPerRead="40960" maxNameTableCharCount="163840" /> 
     <security mode="Transport"> 
     <transport clientCredentialType="None" /> 
     </security> 
    </binding> 
    </basicHttpBinding> 
</bindings> 
<behaviors> 

    <serviceBehaviors> 
    <behavior name="LargeServiceBehavior"> 
     <serviceMetadata httpsGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="true" /> 
     <dataContractSerializer maxItemsInObjectGraph="2147483647" /> 
     <useRequestHeadersForMetadataAddress /> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" /> 

<services> 
    <service name="ExampleServices.ExampleService" behaviorConfiguration="LargeServiceBehavior"> 
    <endpoint address="http://www.site.de/folder/service.svc" 
    binding="basicHttpBinding" 
    bindingConfiguration="someBinding" 
    contract="ExampleServiceModels.IExampleService" /> 
    </service> 
</services> 

Daha önce hiç rampa ile çalışmadım. Ayrıca WCF ayarlarında da fazla tecrübem yok. Herhangi bir fikir veya ipucu çok takdir edilecektir.

DÜZENLEME wcf testi istemcisi kullanarak i bu olsun:

Error: Cannot obtain Metadata from http://www.site.de/folder/ExampleService.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: http://www.site.de/folder/ExampleService.svc Metadata contains a reference that cannot be resolved: 'http://www.site.de/folder/ExampleService.svc'. The requested service, 'http://www.site.de/folder/ExampleService.svc' could not be activated. See the server's diagnostic trace logs for more information.HTTP GET Error URI: http://www.site.de/folder/ExampleService.svc The document at the url http://www.site.de/folder/ExampleService.svc was not recognized as a known document type.The error message from each known type may help you fix the problem:- Report from 'XML Schema' is 'Root element is missing.'.- Report from 'DISCO Document' is 'Root element is missing.'.- Report from 'WSDL Document' is 'There is an error in XML document (0, 0).'. - Root element is missing.

cevap

0

kişinin size WSDL maruz bağlayıcı bir MEX (meta veri alışverişi) belirtmek gerekir. Örnek (adres "mex" bakabilirsiniz):

<service name="ExampleServices.ExampleService" behaviorConfiguration="LargeServiceBehavior"> 
    <endpoint address="http://www.site.de/folder/service.svc" binding="basicHttpBinding" 
     bindingConfiguration="someBinding" 
    contract="ExampleServiceModels.IExampleService" /> 
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
</service> 

tarayıcıda wsdl türü almak için: https://www.site.de/folder/service.svc?wsdl

+0

Cevabınız için teşekkür ederiz. Bunu ekledim, hiçbir şey yapmıyor. – VictorB