Results 1 to 2 of 2

Thread: [RESOLVED] Cross domain wshttpbinding

  1. #1
    Fanatic Member stlaural's Avatar
    Join Date
    Sep 07
    Location
    Quebec, Canada
    Posts
    682

    Resolved [RESOLVED] Cross domain wshttpbinding

    Hi all,

    I currently have a perfectly working session enable WCF service using wsHttpBinding but I'm having one problem, it does not work if its called from a client that is not the the same domain as the service itself. I searched on google a couple hours and found dome binding examples but nothing seems to work. Here's my current wshttpbinding:

    xml Code:
    1. <wsHttpBinding>
    2.                 <binding name="WSHttpBinding_IProductService" closeTimeout="00:10:00"
    3.                     openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
    4.                     bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
    5.                     maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
    6.                     messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
    7.                     allowCookies="false">
    8.                     <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
    9.                         maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
    10.                     <reliableSession ordered="true" inactivityTimeout="10:00:00"
    11.                         enabled="false" />
    12.                     <security mode="Message">
    13.                         <transport clientCredentialType="Windows" proxyCredentialType="None"
    14.                             realm="" />
    15.                         <message clientCredentialType="Windows" negotiateServiceCredential="true"
    16.                             algorithmSuite="Default" />
    17.                     </security>
    18.                 </binding>
    19.             </wsHttpBinding>

    If you have any idea let me know.
    Back to my search now
    Alex
    Sharepoint developer
    "No. Not even in the face of Armageddon. Never compromise." (Walter Kovacs/Rorschach)

    Things to consider before posting.
    Don't forget to rate the posts if they helped and mark thread as resolved when they are.


    .Net Regex Syntax (Scripting) | .Net Regex Language Element | .Net Regex Class | DateTime format | Framework 4.0: what's new
    My fresh new blog : writingthecode, even if I don't post much.

    System: Intel i7 920, Kingston SSDNow V100 64gig, HDD WD Caviar Black 1TB, External WD "My Book" 500GB, XFX Radeon 4890 XT 1GB, 12 GBs Tri-Channel RAM, 1x23" and 1x17" LCDs, Windows 7 x64, VS2008/VS2010, Framework 3.5 and 4.0

  2. #2
    Fanatic Member stlaural's Avatar
    Join Date
    Sep 07
    Location
    Quebec, Canada
    Posts
    682

    Re: Cross domain wshttpbinding

    As usuall I find my answer 20min after posting my question when I already searched for 4 hours :P

    In order to use cross domain wcf service with sessions enabled you have to specify a wshttpbinding binding configuration the the server side with the security mode set to "none" :

    xml Code:
    1. <wsHttpBinding>
    2.       <binding name="wsHttpBindingConfiguration">
    3.           <security mode="None" />
    4.           <reliableSession enabled="true" />
    5.       </binding>
    6. </wsHttpBinding>

    You also need this attribute in you service interface and the second one in the service class :

    c# Code:
    1. [ServiceContract(SessionMode=SessionMode.Required)]
    c# Code:
    1. [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession, ConcurrencyMode = ConcurrencyMode.Single)]
    Alex
    Sharepoint developer
    "No. Not even in the face of Armageddon. Never compromise." (Walter Kovacs/Rorschach)

    Things to consider before posting.
    Don't forget to rate the posts if they helped and mark thread as resolved when they are.


    .Net Regex Syntax (Scripting) | .Net Regex Language Element | .Net Regex Class | DateTime format | Framework 4.0: what's new
    My fresh new blog : writingthecode, even if I don't post much.

    System: Intel i7 920, Kingston SSDNow V100 64gig, HDD WD Caviar Black 1TB, External WD "My Book" 500GB, XFX Radeon 4890 XT 1GB, 12 GBs Tri-Channel RAM, 1x23" and 1x17" LCDs, Windows 7 x64, VS2008/VS2010, Framework 3.5 and 4.0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •