CMI Tracking Service

Topics: Developer Forum, User Forum
Dec 12, 2008 at 6:21 PM
Anybody have any examples of how to consume the CMI Tracking Service in a .NET Visual Studio 2005 Express Edition environment?  This is hitting the Tracking Service from the V1.3.1 Alpha.  I am trying to evaluate this service in the hopes that it will allow me to relay student progress from a WinForm application but I seem to have some trouble with correctly configuring the service.  I ran svcutil to generate the TrackingService.cs and I copied the output.config info into my apps app.config...then I added the <client> section to the app.config - (see below).  I also included the button handler to show how I am trying to invoke along with the error. Any help would be appreciated.

<?

 

xml version="1.0" encoding="utf-8" ?>
<
configuration>
    <
configSections>
    </
configSections>
    <
system.serviceModel>
        <
bindings>
            <
customBinding>
                <
binding name="WebHttpBinding_TrackingContract">
                    <
textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"messageVersion="Soap12" writeEncoding="utf-8">
                        <
readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    </
textMessageEncoding>
                </
binding>
            </
customBinding>
        </
bindings>
    <
client>
        <
endpoint address="http://microsoft-slk/services" binding="customBinding" bindingConfiguration="WebHttpBinding_TrackingContract" contract="TrackingContract" name="WebHttpBinding_TrackingContract" />
    </
client>
    </
system.serviceModel>
</
configuration>

 

 

private void testSvcBtn_Click(object sender, EventArgs e)
{
    ActivityAttempt at = new ActivityAttempt();
    at.ActivityIdentifier =
"1";
    at.LearnerAssignmentIdentifier =
"1";
    at.CompletionStatus = SharePointLearningKit.Services.
CompletionStatus.Incomplete;
    TrackingContractClient client = new TrackingContractClient();
    client.Submit(at);
}

Error:
The CustomBinding on the ServiceEndpoint with contract 'TrackingContract' lacks a TransportBindingElement.  Every binding must have at least one binding element that derives from TransportBindingElement.

 

Jan 15, 2009 at 9:24 AM
Change in your configuraiton as mentioned below in bold,
                <binding name="WebHttpBinding_TrackingContract">
                    <
textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"messageVersion="Soap12" writeEncoding="utf-8">
                        <
readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    </
textMessageEncoding>
                  <httpTransport/>
                </
binding>

HTH,