0

I'm trying this example code: http://www.dotnetcurry.com/ShowArticle.aspx?ID=624

Everything seems to be ok but when it tries to call the async method from the WCF it shows this exception (sorry it's just in spanish):

Se ha producido un error al intentar realizar una solicitud al URI 'https://samsung/WCF40_SSL_Service/Service.svc'. Puede deberse a un intento de acceso a un servicio de configuración entre dominios sin una política entre dominios adecuada en contexto o una política no apropiada para servicios SOAP. Es posible que necesite ponerse en contacto con el propietario del servicio para publicar un archivo de política entre dominios y para asegurarse de que permite enviar encabezados HTTP relacionados con SOAP. Este error también puede deberse al uso de tipos internos en el proxy de servicios web sin utilizar el atributo InternalsVisibleToAttribute. Para obtener más información, consulte la excepción interna.

English translation from freetranslation.com (not sure it helps:)

An error has been produced upon trying to carry out a request to the URI 'https://samsung/WCF40_SSL_Service/Service.svc'. Due to an intent of access to a service of configuration among controls without a politics among adequate controls in context or a not appropriate politics for services SOAP. It is possible that need to be put in contact with the owner of the service to publish a file of politics between controls and to be assured that permits to send headlines HTTP related to SOAP. This error also due to the use of internal types in the proxy of services web without utilizing the attribute InternalsVisibleToAttribute. To obtain more information, consult the internal exception.

This seems to me like a "clientaccesspolicy.xml" problem but I'm pretty sure it's ok and it's been placed in the root path, in application path, its parent...

<?xml version="1.0" encoding="utf-8"?>
<access-policy>
    <cross-domain-access>
        <policy>
            <allow-from http-request-headers="*">
                <domain uri="*"/>
            </allow-from>
            <grant-to>
                <resource path="/" include-subpaths="true"/>
            </grant-to>
        </policy>
    </cross-domain-access>
</access-policy>

I tried to see in fiddler if the application was sending the clientaccesspolicy.xml request but it isn't!!! It doesn't try to even find the file...

I think I must be missing something trivial but I can't realize what... Any idea??

Thanks in advance!!!

Server config:

<?xml version="1.0"?>
<configuration>
    <connectionStrings>
        <add  name="SqlSecureConnection" connectionString="Data Source=.;
              Initial Catalog=aspnetdb;Integrated Security=SSPI"/>
    </connectionStrings>
    <system.web>
        <roleManager enabled="true" />
        <authentication mode="Forms" />
        <compilation debug="true" targetFramework="4.0" />

        <membership defaultProvider="MySqlMembershipProvider"  
                    userIsOnlineTimeWindow="15">
            <providers>
                <clear />
                <add
                  name="MySqlMembershipProvider"
                  type="System.Web.Security.SqlMembershipProvider"
                  connectionStringName="SqlSecureConnection"
                  applicationName="/"
                  enablePasswordRetrieval="false"
                  enablePasswordReset="false"
                  requiresQuestionAndAnswer="false"
                  requiresUniqueEmail="true"
                  passwordFormat="Hashed" />
            </providers>
        </membership>
    </system.web>
    <system.serviceModel>
        <services>
            <service name="WCF_SecureService.Service" 
                     behaviorConfiguration="ServBehave">
                <endpoint
                   address=""
                    binding="customBinding"
                    bindingConfiguration="custBind"
                    contract="WCF_SecureService.IService">
                </endpoint>
            </service>
        </services>
        <bindings>
      <customBinding>
        <binding name="custBind">
          <security authenticationMode="UserNameOverTransport"></security>
          <httpsTransport></httpsTransport>
        </binding>
      </customBinding>
        </bindings>
        <behaviors>
            <serviceBehaviors>
                <behavior  name="ServBehave">
                    <serviceMetadata  httpsGetEnabled="True"/>
                    <serviceDebug includeExceptionDetailInFaults="true"/>
                    <serviceCredentials>
                        <userNameAuthentication
                           userNamePasswordValidationMode="MembershipProvider" 
                    membershipProviderName="MySqlMembershipProvider"/>
                    </serviceCredentials>
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    </system.serviceModel>
    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
    </system.webServer>  
</configuration>

Client config:

<configuration>
<system.serviceModel>
<bindings>
    <customBinding>
        <binding name="CustomBinding_IService">
            <security authenticationMode="UserNameOverTransport" 
                        includeTimestamp="true">
                <secureConversationBootstrap />
            </security>
            <textMessageEncoding messageVersion="Default" 
                                    writeEncoding="utf-8" />
            <httpsTransport maxReceivedMessageSize="2147483647" 
                            maxBufferSize="2147483647" />
        </binding>
    </customBinding>
</bindings>
<client>
    <endpoint 
        address="https://samsung/WCF40_SSL_Service/Service.svc"
        binding="customBinding" bindingConfiguration="CustomBinding_IService"
        contract="MyRef.IService" name="CustomBinding_IService" />
</client>

</system.serviceModel>

</configuration>
iCollect.it Ltd
  • 92,391
  • 25
  • 181
  • 202
zapico
  • 2,396
  • 1
  • 21
  • 45

2 Answers2

2

One possibility is that it is related to the SSL certificate.

It looks like you are running https against a development machine. The possible problems here are:

  • You have not installed a SSL certificate
  • You have installed a self signed SSL certificate but the client does not trust it
Shiraz Bhaiji
  • 64,065
  • 34
  • 143
  • 252
  • Thank you very much for your answer!!! As you said, I'm using my own development machine to try this example and it has a self-signed SSL certificate. Do you know how to force my client to trust the certificate?? – zapico Nov 14 '11 at 19:08
  • If you browse to the svc file in your browser, then you should get a red banner saying that it does not trust the certificate, try clicking on the message and select to install the certificate locally. The machine that you are browsing from will now trust the certificate. – Shiraz Bhaiji Nov 14 '11 at 19:31
  • This seems not to work :-(. Do you know anyway to force the silverlight client to avoid this checking? – zapico Nov 14 '11 at 20:39
0

What do you see when open this url in browser? https://samsung/WCF40_SSL_Service/Service.svc

Inga
  • 482
  • 4
  • 9