none
wcf submit fails asking for password RRS feed

  • Question

  • The https SOAP interface for xxxxx is returning a message requesting a username when attempting to send the message.  The username HAS been specified.  (obfuscated below as "uuuuu" )  xxxxx service requires a certificate and the SOAP messages include the username, password, and dataownerid.

    The call is in Visual Basic, using Visual Studio 2012 running under Windows 8.1 Pro.
    '  DEFINE THE WEB CLIENT

             ws1 = New xxxxService.xxxxx_transferPortTypeClient(contractName, EndPoint)
    '   BIND THE CERTIFICATE TO THE CLIENT
                ws1.ClientCredentials.ClientCertificate.SetCertificate( _
                    System.Security.Cryptography.X509Certificates.StoreLocation.CurrentUser, _
                    System.Security.Cryptography.X509Certificates.StoreName.My, _
                    System.Security.Cryptography.X509Certificates.X509FindType.FindByIssuerName, _
                    "CAIR Standalone Issuing CA")

    '     SEND THE MESSAGE (username, password, and dataowner have been obfuscated)
         

                 ws1.submitMessage("uuuuu", "ppppp", "dddddd", 1, "T", "SEND", SOAPMessage, ws1MessageReturn)

    The username and password have been validated previously.  The endpoint has been validated, and is a remote server requiring a certificate, user name, password, and dataowner.

    The message has been duplicated from SOAPUI.which is a utility for testing SOAP transfers.  SOAPui was able to successfully transmit the message to the endpoint.
    The submitMessage call results in the following, even though a valid user name and password are being used.

    The user name is not provided, Specify user name in ClientCredentials.

    1) Why is WCF claiming that a user name is not provided, when it has been provided in the submit call as the first parameter?

    UserName is considered to be read-only in VS when attempting to set the user name directly as in:

           ws1.ClientCredentials.UserName = "uuuuu"

    Here is the app.config file from the VS project.

     <system.serviceModel>
        <behaviors>
          <endpointBehaviors>
            <behavior name="xxxxClientCredential">
              <clientCredentials>
                <clientCertificate findValue="xxxx" x509FindType="FindByApplicationPolicy" />
              </clientCredentials>
            </behavior>
          </endpointBehaviors>
        </behaviors>
        <bindings>
          <basicHttpBinding>
            <binding name="xxxx_transferSoap11Binding">
              <security mode="Transport" />
            </binding>
            <binding name="xxxx_transferSoap11Binding1" />
          </basicHttpBinding>
          <customBinding>
            <binding name="xxxx_transferSoap12Binding">
              <textMessageEncoding messageVersion="Soap12" />
              <httpsTransport authenticationScheme="Basic" />
            </binding>
          </customBinding>
        </bindings>
        <client>
          <endpoint address="https://xxxxx.gov/submit/services/xxxxx_transfer.xxxxx_transferHttpsSoap12Endpoint"
            binding="customBinding" bindingConfiguration="xxxxx_transferSoap12Binding"
            contract="xxxxx.xxxx_transferPortType" name="xxxxx_transferHttpsSoap12Endpoint" />
          <endpoint address="https://xxxxx.gov/submit/services/xxxxx_transfer.xxxxx_transferHttpsSoap11Endpoint"
            binding="basicHttpBinding" bindingConfiguration="xxxxx_transferSoap11Binding"
            contract="xxxxxService.xxxxx_transferPortType" name="xxxxx_transferHttpsSoap11Endpoint" />
        </client>
      </system.serviceModel>

    And here is the SOAP message (truncated data).  Note that it also contains the username, password, and dataownerID

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:cdc:iisb:2011">
       <soapenv:Header/>
       <soapenv:Body/>
          <urn:submitMessage>
             <urn:userid>uuuuu</urn:userid>
             <urn:password>ppppp</urn:password>
             <urn:dataownerid>ddddd</urn:dataownerid>
             <urn:xxxxxprogramid>1</urn:xxxxxprogramid>
             <urn:xxxxxprogramenvironment>T</urn:xxxxxprogramenvironment>
             <urn:action>SEND</urn:action>
             <urn:messagecontent><![CDATA[MSH...xxxxxxxx]]></urn:messagecontent>
          </urn:submitMessage>
    </soapenv:Envelope>
    Sunday, June 8, 2014 7:40 PM

Answers

  • Hi,

    I see that you have defined two bindings in your client config file. Then for the basicHttpBinding, please try to add the following, or you will meet the error:

    <security mode="Transport">
          <transport clientCredentialType="Basic" />
    </security>

    For more information, please try to refer to:
    #The user name is not provided, Specify user name in ClientCredentials:
    http://amadotech.blogspot.com/2009/11/error-username-is-not-provided-specify.html .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, June 20, 2014 9:22 AM
    Moderator

All replies

  • The following configuration taken from MSDN can be applied to enable tracing on your WCF service.

    <configuration>
      <system.diagnostics>
        <sources>
          <source name="System.ServiceModel"
                  switchValue="Information, ActivityTracing"
                  propagateActivity="true" >
            <listeners>
                 <add name="xml"/>
            </listeners>
          </source>
          <source name="System.ServiceModel.MessageLogging">
            <listeners>
                <add name="xml"/>
            </listeners>
          </source>
          <source name="myUserTraceSource"
                  switchValue="Information, ActivityTracing">
            <listeners>
                <add name="xml"/>
            </listeners>
          </source>
        </sources>
        <sharedListeners>
            <add name="xml"
                 type="System.Diagnostics.XmlWriterTraceListener"
                 initializeData="Error.svclog" />
        </sharedListeners>
      </system.diagnostics>
    </configuration>
    Wednesday, June 11, 2014 10:01 AM
  • I added that to app.config and it produces the error.svclog.  The following is the first section of the ttrace.  There are 3 sections - increasing monotonically in time.

    The trace shows the same error - resulting in "The username is not provided."  It is interesting that with one submit in the .vb code, 3 sections of trace are produced.  Maybe there is something else that has to be set up in the web client that will cause it to use the username and password that have been provided in the vb code.

    DOES ANYONE ELSE HAVE A SUGGESTION?  Is there a way to attach a file to the post?  I see that there is the possibility of adding hyperlinks and html. 

    Jim

    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Transfer">0</SubType>
        <Level>255</Level>
        <TimeCreated SystemTime="2014-06-11T19:38:40.2864420Z" />
        <Source Name="System.ServiceModel" />
        <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" RelatedActivityID="{940b3b49-e5fc-44cb-a148-ba87d7c645b5}" />
        <Execution ProcessName="SweepHL7.vshost" ProcessID="4904" ThreadID="10" />
        <Channel/>
        <Computer>JIM4</Computer>
      </System>
      <ApplicationData>
      </ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>131085</EventID>
        <Type>3</Type>
        <SubType Name="Start">0</SubType>
        <Level>255</Level>
        <TimeCreated SystemTime="2014-06-11T19:38:40.3303878Z" />
        <Source Name="System.ServiceModel" />
        <Correlation ActivityID="{940b3b49-e5fc-44cb-a148-ba87d7c645b5}" />
        <Execution ProcessName="SweepHL7.vshost" ProcessID="4904" ThreadID="10" />
        <Channel/>
        <Computer>JIM4</Computer>
      </System><ApplicationData>
        <TraceData>
          <DataItem>
            <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Start">
              <TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ActivityBoundary.aspx</TraceIdentifier>
              <Description>Activity boundary.</Description>
              <AppDomain>SweepHL7.vshost.exe</AppDomain>
              <ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord">
                <ActivityName>Construct ChannelFactory. Contract type: 'SweepHL7.CDPHService.CDPH_transferPortType'.</ActivityName>
                <ActivityType>Construct</ActivityType>
              </ExtendedData>
            </TraceRecord>
          </DataItem>
        </TraceData>
      </ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>524323</EventID>
        <Type>3</Type>
        <SubType Name="Information">0</SubType>
        <Level>8</Level>
        <TimeCreated SystemTime="2014-06-11T19:38:40.6634070Z" />
        <Source Name="System.ServiceModel" />
        <Correlation ActivityID="{940b3b49-e5fc-44cb-a148-ba87d7c645b5}" />
        <Execution ProcessName="SweepHL7.vshost" ProcessID="4904" ThreadID="10" /><Channel/>
        <Computer>JIM4</Computer>
      </System>
      <ApplicationData>
        <TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Information">
          <TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.GetChannelEndpointElement.aspx</TraceIdentifier>
          <Description>Get ChannelEndpointElement.</Description>
          <AppDomain>SweepHL7.vshost.exe</AppDomain>
          <ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord">
            <FoundChannelElement>True</FoundChannelElement>
            <Name>CDPH_transferHttpsSoap12Endpoint</Name>
            <ContractName>CDPHService.CDPH_transferPortType</ContractName>
            <Binding>customBinding</Binding>
            <BindingConfiguration>CDPH_transferSoap12Binding</BindingConfiguration>
            <RemoteEndpointUri>https://hiegateway.cdph.ca.gov/submit/services/CDPH_transfer.CDPH_transferHttpsSoap12Endpoint</RemoteEndpointUri>
            <ConfigurationFileSource>h:\VB10\SweepCalRedie\obj\Debug\SweepHL7.vshost.exe.Config</ConfigurationFileSource>
            <ConfigurationFileLineNumber>106</ConfigurationFileLineNumber>
          </ExtendedData>
        </TraceRecord>
        </DataItem>
        </TraceData>
      </ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>524323</EventID>
        <Type>3</Type>
        <SubType Name="Information">0</SubType>
        <Level>8</Level>
        <TimeCreated SystemTime="2014-06-11T19:38:40.6694046Z" />
        <Source Name="System.ServiceModel" />
        <Correlation ActivityID="{940b3b49-e5fc-44cb-a148-ba87d7c645b5}" />
        <Execution ProcessName="SweepHL7.vshost" ProcessID="4904" ThreadID="10" />
        <Channel/>
        <Computer>JIM4</Computer>
      </System>
      <ApplicationData>
        <TraceData><DataItem>
          <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Information">
            <TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.GetChannelEndpointElement.aspx</TraceIdentifier>
            <Description>Get ChannelEndpointElement.</Description>
            <AppDomain>SweepHL7.vshost.exe</AppDomain>
            <ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord">
              <FoundChannelElement>True</FoundChannelElement>
              <Name>CDPH_transferHttpsSoap12Endpoint</Name>
              <ContractName>CDPHService.CDPH_transferPortType</ContractName>
              <Binding>customBinding</Binding>
              <BindingConfiguration>CDPH_transferSoap12Binding</BindingConfiguration>
              <RemoteEndpointUri>https://hiegateway.cdph.ca.gov/submit/services/CDPH_transfer.CDPH_transferHttpsSoap12Endpoint</RemoteEndpointUri>
              <ConfigurationFileSource>h:\VB10\SweepCalRedie\obj\Debug\SweepHL7.vshost.exe.Config</ConfigurationFileSource>
              <ConfigurationFileLineNumber>106</ConfigurationFileLineNumber>
            </ExtendedData>
          </TraceRecord>
        </DataItem>
        </TraceData>
      </ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Transfer">0</SubType>
        <Level>255</Level>
        <TimeCreated SystemTime="2014-06-11T19:38:40.7684147Z" />
        <Source Name="System.ServiceModel" />
        <Correlation ActivityID="{940b3b49-e5fc-44cb-a148-ba87d7c645b5}" RelatedActivityID="{00000000-0000-0000-0000-000000000000}" />
        <Execution ProcessName="SweepHL7.vshost" ProcessID="4904" ThreadID="10" />
        <Channel/>
        <Computer>JIM4</Computer>
      </System>
      <ApplicationData>
      </ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>131085</EventID>
        <Type>3</Type>
        <SubType Name="Stop">0</SubType>
        <Level>255</Level>
        <TimeCreated SystemTime="2014-06-11T19:38:40.7694111Z" />
        <Source Name="System.ServiceModel" />
        <Correlation ActivityID="{940b3b49-e5fc-44cb-a148-ba87d7c645b5}" />
        <Execution ProcessName="SweepHL7.vshost" ProcessID="4904" ThreadID="10" />
        <Channel/>
        <Computer>JIM4</Computer>
      </System>
      <ApplicationData>
        <TraceData><DataItem>
          <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Stop">
            <TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ActivityBoundary.aspx</TraceIdentifier>
            <Description>Activity boundary.</Description>
            <AppDomain>SweepHL7.vshost.exe</AppDomain>
            <ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord">
              <ActivityName>Construct ChannelFactory. Contract type: 'SweepHL7.CDPHService.CDPH_transferPortType'.</ActivityName>
              <ActivityType>Construct</ActivityType></ExtendedData>
          </TraceRecord>
        </DataItem>
        </TraceData>
      </ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Transfer">0</SubType>
        <Level>255</Level>
        <TimeCreated SystemTime="2014-06-11T19:38:41.0074451Z" />
        <Source Name="System.ServiceModel" />
        <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" RelatedActivityID="{0f62015e-48fa-4dc2-942b-ead1421ffeb6}" />
        <Execution ProcessName="SweepHL7.vshost" ProcessID="4904" ThreadID="10" />
        <Channel/>
        <Computer>JIM4</Computer>
      </System>
      <ApplicationData>
      </ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>131085</EventID>
        <Type>3</Type>
        <SubType Name="Start">0</SubType>
        <Level>255</Level>
        <TimeCreated SystemTime="2014-06-11T19:38:41.0074451Z" />
        <Source Name="System.ServiceModel" />
        <Correlation ActivityID="{0f62015e-48fa-4dc2-942b-ead1421ffeb6}" />
        <Execution ProcessName="SweepHL7.vshost" ProcessID="4904" ThreadID="10" />
        <Channel/>
        <Computer>JIM4</Computer>
      </System>
      <ApplicationData>
        <TraceData>
          <DataItem>
            <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Start">
              <TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ActivityBoundary.aspx</TraceIdentifier>
              <Description>Activity boundary.</Description>
              <AppDomain>SweepHL7.vshost.exe</AppDomain>
              <ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord">
                <ActivityName>Open ClientBase. Contract type: 'SweepHL7.CDPHService.CDPH_transferPortType'.</ActivityName>
                <ActivityType>Open</ActivityType>
              </ExtendedData>
            </TraceRecord>
          </DataItem>
        </TraceData>
      </ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Transfer">0</SubType>
        <Level>255</Level>
        <TimeCreated SystemTime="2014-06-11T19:38:41.3634672Z" />
        <Source Name="System.ServiceModel" />
        <Correlation ActivityID="{0f62015e-48fa-4dc2-942b-ead1421ffeb6}" RelatedActivityID="{00000000-0000-0000-0000-000000000000}" />
        <Execution ProcessName="SweepHL7.vshost" ProcessID="4904" ThreadID="10" />
        <Channel/>
        <Computer>JIM4</Computer>
      </System>
      <ApplicationData>
      </ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>131085</EventID>
        <Type>3</Type>
        <SubType Name="Stop">0</SubType>
        <Level>255</Level>
        <TimeCreated SystemTime="2014-06-11T19:38:41.3634672Z" />
        <Source Name="System.ServiceModel" />
        <Correlation ActivityID="{0f62015e-48fa-4dc2-942b-ead1421ffeb6}" />
        <Execution ProcessName="SweepHL7.vshost" ProcessID="4904" ThreadID="10" />
        <Channel/>
        <Computer>JIM4</Computer>
      </System>
      <ApplicationData>
        <TraceData>
          <DataItem>
            <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Stop">
              <TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ActivityBoundary.aspx</TraceIdentifier>
              <Description>Activity boundary.</Description>
              <AppDomain>SweepHL7.vshost.exe</AppDomain>
              <ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord">
                <ActivityName>Open ClientBase. Contract type: 'SweepHL7.CDPHService.CDPH_transferPortType'.</ActivityName>
                <ActivityType>Open</ActivityType>
              </ExtendedData>
            </TraceRecord>
          </DataItem>
        </TraceData>
      </ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Transfer">0</SubType>
        <Level>255</Level>
        <TimeCreated SystemTime="2014-06-11T19:38:41.3874351Z" />
        <Source Name="System.ServiceModel" />
        <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" RelatedActivityID="{b7d7b455-443d-463a-92a1-6d4243bec651}" />
        <Execution ProcessName="SweepHL7.vshost" ProcessID="4904" ThreadID="10" />
        <Channel/>
        <Computer>JIM4</Computer>
      </System>
      <ApplicationData>
      </ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>131085</EventID>
        <Type>3</Type>
        <SubType Name="Start">0</SubType>
        <Level>255</Level>
        <TimeCreated SystemTime="2014-06-11T19:38:41.3874351Z" />
        <Source Name="System.ServiceModel" />
        <Correlation ActivityID="{b7d7b455-443d-463a-92a1-6d4243bec651}" />
        <Execution ProcessName="SweepHL7.vshost" ProcessID="4904" ThreadID="10" />
        <Channel/>
        <Computer>JIM4</Computer>
      </System>
      <ApplicationData>
        <TraceData><DataItem>
          <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Start">
            <TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ActivityBoundary.aspx</TraceIdentifier>
            <Description>Activity boundary.</Description>
            <AppDomain>SweepHL7.vshost.exe</AppDomain>
            <ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord">
              <ActivityName>Process action 'urn:cdc:iisb:2011:submitMessage'.</ActivityName>
              <ActivityType>ProcessAction</ActivityType>
            </ExtendedData>
          </TraceRecord>
        </DataItem>
        </TraceData>
      </ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>524331</EventID>
        <Type>3</Type>
        <SubType Name="Information">0</SubType>
        <Level>8</Level>
        <TimeCreated SystemTime="2014-06-11T19:38:41.5254554Z" />
        <Source Name="System.ServiceModel" />
        <Correlation ActivityID="{b7d7b455-443d-463a-92a1-6d4243bec651}" />
        <Execution ProcessName="SweepHL7.vshost" ProcessID="4904" ThreadID="10" />
        <Channel/>
        <Computer>JIM4</Computer>
      </System>
      <ApplicationData>
        <TraceData>
          <DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Information">
            <TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.ServiceChannelLifetime.aspx</TraceIdentifier>
            <Description>ServiceChannel information.</Description>
            <AppDomain>SweepHL7.vshost.exe</AppDomain>
            <Source>System.ServiceModel.Channels.ServiceChannel/18107351</Source>
            <ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord">
              <ContractNamespace>urn:cdc:iisb:2011</ContractNamespace>
              <ContractName>CDPH_transferPortType</ContractName>
            </ExtendedData>
          </TraceRecord>
          </DataItem>
        </TraceData>
      </ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>131075</EventID>
        <Type>3</Type>
        <SubType Name="Error">0</SubType>
        <Level>2</Level>
        <TimeCreated SystemTime="2014-06-11T19:38:41.5604777Z" />
        <Source Name="System.ServiceModel" />
        <Correlation ActivityID="{b7d7b455-443d-463a-92a1-6d4243bec651}" />
        <Execution ProcessName="SweepHL7.vshost" ProcessID="4904" ThreadID="10" />
        <Channel/>
        <Computer>JIM4</Computer>
      </System>
      <ApplicationData>
        <TraceData>
          <DataItem>
            <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error">
              <TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ThrowingException.aspx</TraceIdentifier>
              <Description>Throwing an exception.</Description>
              <AppDomain>SweepHL7.vshost.exe</AppDomain>
              <Exception>
                <ExceptionType>System.InvalidOperationException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
                <Message>The username is not provided. Specify username in ClientCredentials.</Message>
                <StackTrace>
       at System.ServiceModel.ClientCredentialsSecurityTokenManager.CreateSecurityTokenProvider(SecurityTokenRequirement tokenRequirement, Boolean disableInfoCard)
       at System.ServiceModel.Channels.HttpChannelFactory`1.CreateAndOpenTokenProvider(TimeSpan timeout, AuthenticationSchemes authenticationScheme, EndpointAddress target, Uri via, ChannelParameterCollection channelParameters)
       at System.ServiceModel.Channels.HttpChannelFactory`1.CreateAndOpenTokenProvidersCore(EndpointAddress to, Uri via, ChannelParameterCollection channelParameters, TimeSpan timeout, SecurityTokenProviderContainer&amp;amp; tokenProvider, SecurityTokenProviderContainer&amp;amp; proxyTokenProvider)
       at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.CreateAndOpenTokenProviders(TimeSpan timeout)
       at System.ServiceModel.Channels.HttpsChannelFactory`1.HttpsRequestChannel.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
       at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp;amp; msgData, Int32 type)
       at SweepHL7.CDPHService.CDPH_transferPortType.submitMessage(submitMessageRequest request)
       at SweepHL7.CDPHService.CDPH_transferPortTypeClient.CDPHService_CDPH_transferPortType_submitMessage(submitMessageRequest request)
       at SweepHL7.CDPHService.CDPH_transferPortTypeClient.submitMessage(String userid, String password, String dataownerid, Int32 cdphprogramid, String cdphprogramenvironment, String action, String messagecontent, String&amp;amp; return)
       at SweepHL7.SweepCalRedie.ResultsLoop()
       at SweepHL7.SweepCalRedie.StartResults()
       at SweepHL7.SweepCalRedie._Lambda$__13(Object a0, EventArgs a1)
       at C1.Win.C1Ribbon.RibbonButton.OnClick(EventArgs e)
       at C1.Win.C1Ribbon.RibbonButton.k()
       at C1.Win.C1Ribbon.bh.e()
       at C1.Win.C1Ribbon.bh.ao()
       at C1.Win.C1Ribbon.bh.a.b()
       at C1.Win.C1Ribbon.bh.a.a(MouseEventArgs A_0)
       at C1.Framework.XView.OnMouseUp(MouseEventArgs e)
       at C1.Win.C1Ribbon.C1Ribbon.OnMouseUp(MouseEventArgs e)
       at System.Windows.Forms.Control.WmMouseUp(Message&amp;amp; m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message&amp;amp; m)
       at C1.Framework.ScrollableControl.WndProc(Message&amp;amp; m)
       at C1.Win.C1Ribbon.C1Ribbon.WndProc(Message&amp;amp; m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp;amp; msg)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp;amp; msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       at SweepHL7.My.MyApplication.Main(String[] Args)
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()































































































    Friday, June 13, 2014 1:07 AM
  • Hi,

    I see that you have defined two bindings in your client config file. Then for the basicHttpBinding, please try to add the following, or you will meet the error:

    <security mode="Transport">
          <transport clientCredentialType="Basic" />
    </security>

    For more information, please try to refer to:
    #The user name is not provided, Specify user name in ClientCredentials:
    http://amadotech.blogspot.com/2009/11/error-username-is-not-provided-specify.html .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, June 20, 2014 9:22 AM
    Moderator