none
WCF In Workgroup RRS feed

  • Question

  • I have a WCF service running on a workgroup server.  It uses nettcp.  Being in a Workgroup, Windows and Certificate security modes are not an option.  I did try setting both the client and server modes to "None" but I still get the "Stream Security is required at http://www.w3.org/2005/08/addressing/anonymous, but no security context was negotiated." error.

    I don't know what I can be doing that is forcing stream security.  Does anyone know how to get WCF with nettcp to work in a workgroup environment without the standard hack of having identical accounts and passwords on the two machines?

    Thanks, LD

    Sunday, March 13, 2011 6:05 PM

Answers

  • Hello, one thing I noticed is you don't have a bindingConfiguration attribute. Try to add this attribute and give it another try.

    <endpoint name="NetTcpEndPoint" bindingConfiguration="NetTcpEndPoint" address ="" binding="netTcpBinding" contract="SEToolkit.SQLManagerService.SQLMServiceContracts.ISQLManagerPackageContracts"/>

    By the way, you can first paste the code to Word and then copy code from Word to the forum. This way the code will be nicely formatted.


    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    Windows Azure Technical Forum Support Team Blog
    • Marked as answer by Last Defense Tuesday, March 15, 2011 4:13 AM
    Tuesday, March 15, 2011 3:08 AM

All replies

  • Did you try setting up Transport level security ... this is the default communication policy for NETTCPBINDING... 

    <bindings>
     <netTcpBinding>
      <binding name="InsecureTcp">
       <security mode="Transport">
         <transport clientCredentialType="Windows" />
       </security>
      </binding>
     </netTcpBinding>
    </bindings>
    

    Also, have a look at this thread... but this suggest to use a common username/password which you dont want ... 

    http://social.msdn.microsoft.com/forums/en-us/wcf/thread/D4E55E77-7318-49B2-97B0-03FF9087F884

     

    Have you tried setting the followings 

    proxy.ClientCredentials.Windows.AllowNtlm = true; 

     

    Please post your configs


    Tanvir Huda
    Sunday, March 13, 2011 11:57 PM
  • Sorry for the formatting below.  I cut and pasted the info.  Apparently the MS code forum cannot handle code paste from the MS Dev IDE...

    I have moved on to try to use a service certificate with message security and will handle the username/password in code. Nothing exotic.

    I have a service with methods that return object and a couple that return streams.  The service runs on a stand alone server (no domain).  I created an X509 cert for the service to use and the service starts fine.  But when I connect to it and before I call a method I get an error "Framing mode Singleton is not supported".  I tried to include all the normal config stuff until after I get the connection working.

    Here is my service config:

    <

     

    system.serviceModel>

     

     

    services>

     

     

    service name="SEToolkit.SQLManagerService.WCFServiceClasses.SQLManagerPackageContracts" behaviorConfiguration="NETBehavior">

     

     

    host>

     

     

    baseAddresses>

     

     

    add baseAddress="net.tcp://192.168.1.220:5501/SQLManagerPackageContracts"/>

     

     

    baseAddresses>

     

     

    host>

     

     

    endpoint name="NetTcpEndPoint"

     

     

    address =""

     

     

    binding="netTcpBinding"

     

     

    contract="SEToolkit.SQLManagerService.SQLMServiceContracts.ISQLManagerPackageContracts"/>

     

     

    endpoint name="NetTcpMetadataPoint"

     

     

    address="mex"

     

     

    binding="mexTcpBinding"

     

     

    contract="IMetadataExchange"/>

     

     

    service>

     

     

    services>

     

     

    behaviors>

     

     

    serviceBehaviors>

     

     

    behavior name ="NETBehavior">

     

     

    serviceMetadata httpGetEnabled="false"/>

     

     

    serviceDebug includeExceptionDetailInFaults="true"/>

     

     

    serviceCredentials>

     

     

    serviceCertificate findValue="GARRISONWCF"

     

     

    storeLocation="LocalMachine"

     

     

    storeName="My"

     

     

    x509FindType="FindBySubjectName" />

     

     

    serviceCredentials>

     

     

    behavior>

     

     

    serviceBehaviors>

     

     

    behaviors>

     

     

    bindings>

     

     

    netTcpBinding>

     

     

    binding name="NetTcpEndPoint" transferMode="Streamed" maxBufferPoolSize="524288"

     

     

    maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="65536">

     

     

    security mode="TransportWithMessageCredential">

     

     

    message clientCredentialType="UserName" />

     

     

    security>

     

     

    binding>

     

     

    netTcpBinding>

     

     

    bindings>

     

     

    system.serviceModel>

    Here is my client info

    this

     

     

    .binding = new NetTcpBinding();

     

     

    SecurityMode.TransportWithMessageCredential;

     

     

    "http://SEToolkit.ScopeEdge.mil/SQLMServiceContracts";

     

     

    MessageCredentialType.UserName;

     

     

    TransferMode.Streamed;

     

     

    new TimeSpan(0, 10, 0);

     

    binding.MaxBufferPoolSize = 524288;

    binding.MaxBufferSize = 65536;

    binding.MaxConnections = 10;

    binding.MaxReceivedMessageSize = 65536;

    I assign a username and password to the client proxy once it is initialzed.

    Error is raised on "Open()";

    using

     

     

    (SQLManagerPackageContractsClient client = new SQLManagerPackageContractsClient(dbc.WCFInfo.Binding, dbc.WCFInfo.EPAddress))

    {

    client.ClientCredentials.UserName.UserName =

     

    "User";

     

     

    "Password";

     

     

    client.Open();

    isWCFAvailable = client.IsOnline();

    client.Close();

    }

    client.ClientCredentials.UserName.Password =

    binding.ReceiveTimeout =

    binding.TransferMode =

    binding.Security.Message.ClientCredentialType =

    binding.Namespace =

    binding.Security.Mode =

    </

    </

    </

    </

    </

    <

    <

    <

    <

    <

    </

    </

    </

    </

    <

    <

    <

    <

    <

    <

    <

    </

    </

    <

    <

    </

    </

    <

    <

    <

    <

    <

    Monday, March 14, 2011 11:34 AM
  • Hello, one thing I noticed is you don't have a bindingConfiguration attribute. Try to add this attribute and give it another try.

    <endpoint name="NetTcpEndPoint" bindingConfiguration="NetTcpEndPoint" address ="" binding="netTcpBinding" contract="SEToolkit.SQLManagerService.SQLMServiceContracts.ISQLManagerPackageContracts"/>

    By the way, you can first paste the code to Word and then copy code from Word to the forum. This way the code will be nicely formatted.


    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    Windows Azure Technical Forum Support Team Blog
    • Marked as answer by Last Defense Tuesday, March 15, 2011 4:13 AM
    Tuesday, March 15, 2011 3:08 AM
  • You are correct.  I just had to step away for a few and get some sleep.  Somehow that entry had dropped off during one of my many attempts to get this working.  Once I got back into the code, it almost jumped off the screen.

    Now that I have it working with no security, I can figure out how to handle security in a workgroup configuration.

    Thanks for the tip.

    LD

    Tuesday, March 15, 2011 4:13 AM