none
Converting from WSE 2.0 to WCF RRS feed

  • Question

  • I'm having some trouble getting started with WCF and converting an existing WSE client, I'm currently getting the following error.

    System.ServiceModel.Security.MessageSecurityException: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail. ---> System.ServiceModel.FaultException: System Error occured in Management Point.

    Any guidance is greatly appreciated.

    =====
    WSE 2.0 Client Code
    =====
    // WSE 2.0 Client
    ServiceWse client = new ServiceWse();
    client.Timeout = 60000;
    client.Url = GatewayURLs.Testing;

    // Create the Security Elements
    UsernameToken UsernameToken = new UsernameToken("username", "password", PasswordOption.SendPlainText);
    X509SecurityToken X509SecurityToken = new X509SecurityToken( Microsoft.Web.Services2.Security.X509.X509Certificate.CreateCertFromFile( SSLCert ) );

    // Set and add the Security Elements
    client.RequestSoapContext.Security.MustUnderstand = false;
    client.RequestSoapContext.Security.Tokens.Add(UsernameToken);
    client.RequestSoapContext.Security.Elements.Add(new MessageSignature(X509SecurityToken));

    // Get response
    string response = client.realtimeLQ(requestXML);

    =====
    WCF Config & Code
    =====

    RealtimeLQClient client = new RealtimeLQClient("WebService");
    client.ChannelFactory.Credentials.UserName.UserName = "username";
    client.ChannelFactory.Credentials.UserName.Password = "password";
    string response = "";
    try
    {
    response = client.realtimeLoopQual(vzxml);
    }
    catch(Exception E)
    {
    response = E.ToString();
    }
    Console.WriteLine(response);

    =====
    Config
    =====

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
    <configSections>
    </configSections>
    <system.serviceModel>
    <behaviors>
    <endpointBehaviors>
    <behavior name="X509">
    <clientCredentials>
    <clientCertificate findValue="sslcertname" storeLocation="CurrentUser" storeName="My" x509FindType="FindBySubjectName"/>
    </clientCredentials>
    </behavior>
    </endpointBehaviors>
    </behaviors>
    <bindings>
    <basicHttpBinding>
    <binding name="WebServiceSoapBinding" closeTimeout="00:01:00"
    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
    useDefaultWebProxy="true">
    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
    <security mode="TransportWithMessageCredential">
    <transport clientCredentialType="None" proxyCredentialType="None" />
    <message clientCredentialType="UserName" />
    </security>
    </binding>
    </basicHttpBinding>
    </bindings>
    <client>
    <endpoint address="https://www.partner.com" behaviorConfiguration="X509"
    binding="basicHttpBinding" bindingConfiguration="WebServiceSoapBinding"
    contract="test1.RealtimeLQ" name="WebService" />
    </client>
    </system.serviceModel>
    </configuration>
    Sunday, April 1, 2007 2:37 AM

All replies

  • It looks like your problem must be related to the authentication of your service and is a WCF error message. Probably most people thought the problem was because you were upgrading from WSE2 which is not compatible with WCF or WSE3. At this point, I would recommend just updating the service to WCF, but you could still get the same error message. Here is another forum that explains the problem you experienced: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=653318&SiteID=1. I would make sure that the username/password credentials can authenticate and then just make sure your certificate location is accurate for the user you are testing with. You may also need to ensure that the certificate is available on the client certificate store as well.

     

    Thanks,

     

    Thursday, June 5, 2008 3:27 PM