Where has the Message Body Gone?

Hi, all. According to my last threadMessage Routing doesn't work, I have corrected some problems and the message could be routed to my destination service. But now comes another problem that the message body seemed lost.

First let me give a short introduction about the projects. There are totally 5 projects:

  1. Client: The console UI.
  2. ClientService: Contains ClientServiceHandler class that inherites from CsfService.
  3. http://localhost/ClientServiceSite/: Hosting the ClientService.
  4. http://localhost/ServerService: The destination web service.
  5. CsfHelper: A helper project to simplifiy CSF work.

The destination web service is a simple asmx, which code is as follows:

using System;
using System.IO;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
public Service () {

//Uncomment the following line if using designed components
//InitializeComponent();
}

[WebMethod]
public void Log(string content)
{
using (StreamWriter writer = File.CreateText(@"C:\log.txt"))
{
writer.WriteLine(content);
}
}

}

The ClientServiceHandler class is as follows:

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

using Microsoft.ConnectedServices.Sdk;
using Microsoft.ConnectedServices.Sdk.Addressing;
using Microsoft.ConnectedServices.Sdk.Client;
using Microsoft.ConnectedServices.Sdk.Messaging;

using CsfHelper;

namespace ClientService
{
[CsfService(Namespace = "http://osdt/research/2006/10/ClientService")]
public class ClientServiceHandler : CsfService
{
[Operation(Action = "http://osdt/research/2006/10/ClientService/CreateSession")]
public void CreateSession()
{
m_SessionID = SessionHelper.CreateSession(SessionManifestHelper.GetSessionManifestFromXmlFile(@"C:\manifest.xml"));
}

[Operation(Action = "http://osdt/research/2006/10/ClientService/Talk")]
public void Talk(string content)
{
Header header = new Header();
header.Addressing = new AddressingHeaders(new Uri("http://localhost/ClientServiceSite/ClientService.ashx"));
header.Addressing.To = new Uri("http://localhost/session30/session.ashx");
header.Addressing.Action = "http://tempuri.org/Log";
header.CsfProperties.SessionId = new Uri(m_SessionID);
header.Security.Add(SecurityHelper.GetUsernameToken());

Message msg = Message.CreateMessage(header, content);
MessageSender sdr = new MessageSender();
sdr.SendAsync(msg);
}

[Operation(Action = "http://osdt/research/2006/10/ClientService/TalkResponse")]
public void TalkResponse(string content)
{
using (StreamWriter writer = File.CreateText(@"C:\logResponse.txt"))
{
writer.WriteLine(content);
}
}

[Operation(Action = "http://osdt/research/2006/10/ClientService/TerminateSession")]
public void TerminateSession()
{
SessionHelper.TerminateSession(m_SessionID);
}

private string m_SessionID;
}
}

Thehttp://localhost/ClientServiceSite is just used to host the ClientServiceHandler by adding httpHandler to its web.config file as follows:

<httpHandlers>
<add verb="*" path="ClientService.ashx" type="ClientService.ClientServiceHandler, ClientService"/>
</httpHandlers>

CsfHelper contains nothing but several helper classes to simplify manifest deserialization, session creation, session termination, and security token obtaining.

The Client project contains web reference to ClientService and talk to the destination service through it. Here's code inside the Main method:

ClientServiceHandler proxy = new ClientServiceHandler();
proxy.CreateSession();
proxy.Talk("Allen Lee");
proxy.TerminateSession();

The manifest is as follows:

<Session
timestamp="0001-01-01T00:00:00.0000000-08:00"
timeout="30"
serialize="None"
routeAnyAction="true"
ackOnRouteMsgToParticipants="false"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://Microsoft/ConnectedServices/2006/06/Session/">
<SessionName>HelloWorld</SessionName>
<Participants>
<Participant timeout="30" role="Service" inChannelResponse="false" type="WebService">
<ParticipantName>ServerService</ParticipantName>
<ParticipantID>ServerService</ParticipantID>
<ParticipantUrl>http://localhost/ServerService/Service.asmx</ParticipantUrl>
</Participant>
<Participant timeout="30" role="Service" inChannelResponse="false" type="WebService">
<ParticipantName>ClientService</ParticipantName>
<ParticipantID>ClientService</ParticipantID>
<ParticipantUrl>http://localhost/ClientServiceSite/ClientService.ashx</ParticipantUrl>
</Participant>
</Participants>
<RoutingTable version="0" timestamp="0001-01-01T00:00:00.0000000-08:00">
<Routes>
<Route>
<Criteria>(ACTION EQ 'http://tempuri.org/Log')</Criteria>
<Destination>ServerService[http://tempuri.org/Log]</Destination>
</Route>
<Route>
<Criteria>(ACTION EQ 'http://tempuri.org/LogResponse')</Criteria>
<Destination>ClientService[http://osdt/research/2006/10/ClientService/TalkResponse]</Destination>
</Route>
</Routes>
</RoutingTable>
</Session>

Session_InputTrace.webinfo is as follows:

<?xml version="1.0" encoding="utf-8"?>
<log>
<inputMessage utc="10/16/2006 3:32:15 PM" messageId="urn:uuid:fa25b367-b08a-45bd-bc08-435e6021128b">
<processingStep description="Unprocessed message">
<env:Envelope xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<wsa:Action>http://Microsoft/ConnectedServices/2006/06/Session/CreateSession</wsa:Action>
<wsa:MessageID>urn:uuid:fa25b367-b08a-45bd-bc08-435e6021128b</wsa:MessageID>
<wsa:ReplyTo>
<wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
</wsa:ReplyTo>
<wsa:To>http://research-osdt.contoso.com/Session30/SessionManagerAdmin.ashx</wsa:To>
<wsse:Security env:mustUnderstand="true">
<wsu:Timestamp wsu:Id="Timestamp-0187685f-05d8-430f-a263-3df5d8c75e11">
<wsu:Created>2006-10-16T15:32:15Z</wsu:Created>
<wsu:Expires>2006-10-16T15:37:15Z</wsu:Expires>
</wsu:Timestamp>
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SecurityToken-c05d366c-8a37-4b0b-8b10-a346648e68cb">
<wsse:Username>Session-Service@contoso.com</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">research=0sdt</wsse:Password>
<wsse:Nonce>U1AQV+nzaOw5D1mVZURWhQ==</wsse:Nonce>
<wsu:Created>2006-10-16T15:32:15Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</env:Header>
<env:Body>
<CreateSession xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://Microsoft/ConnectedServices/2006/06/Session/">
<Session timestamp="0001-01-01T00:00:00-08:00" timeout="30" persist="None" state="Active" routeAnyAction="true" ackOnRouteMsgToParticipants="false">
<SessionName>HelloWorld</SessionName>
<Participants>
<Participant timeout="30" role="Service" inChannelResponse="false" type="WebService">
<SoapVersion>Default</SoapVersion>
<ParticipantName>ServerService</ParticipantName>
<ParticipantID>ServerService</ParticipantID>
<ParticipantUrl>http://localhost/ServerService/Service.asmx</ParticipantUrl>
<Actions />
<PolicyDocument>
<Include>
<SecondaryCredentialMap>
<PrimaryCredentialForMessage>None</PrimaryCredentialForMessage>
<PrimaryCredentialForTransport transportAuthenticationType="Ntlm">None</PrimaryCredentialForTransport>
</SecondaryCredentialMap>
</Include>
</PolicyDocument>
</Participant>
<Participant timeout="30" role="Service" inChannelResponse="false" type="WebService">
<SoapVersion>Default</SoapVersion>
<ParticipantName>ClientService</ParticipantName>
<ParticipantID>ClientService</ParticipantID>
<ParticipantUrl>http://localhost/ClientServiceSite/ClientService.ashx</ParticipantUrl>
<Actions />
<PolicyDocument>
<Include>
<SecondaryCredentialMap>
<PrimaryCredentialForMessage>None</PrimaryCredentialForMessage>
<PrimaryCredentialForTransport transportAuthenticationType="Ntlm">None</PrimaryCredentialForTransport>
</SecondaryCredentialMap>
</Include>
</PolicyDocument>
</Participant>
</Participants>
<RoutingTable version="0" timestamp="0001-01-01T00:00:00-08:00">
<Routes>
<Route>
<Criteria>(ACTION EQ 'http://tempuri.org/Log')</Criteria>
<Destination>ServerService[http://tempuri.org/Log]</Destination>
</Route>
<Route>
<Criteria>(ACTION EQ 'http://tempuri.org/LogResponse')</Criteria>
<Destination>ClientService[http://osdt/research/2006/10/ClientService/TalkResponse]</Destination>
</Route>
</Routes>
</RoutingTable>
</Session>
</CreateSession>
</env:Body>
</env:Envelope>
</processingStep>
<processingStep description="Entering SOAP filter Microsoft.Web.Services3.Design.RequireSoapHeaderAssertion+RequireSoapHeaderFilter" />
<processingStep description="Exited SOAP filter Microsoft.Web.Services3.Design.RequireSoapHeaderAssertion+RequireSoapHeaderFilter" />
<processingStep description="Entering SOAP filter Microsoft.ConnectedServices.Sdk.Security.DynamicAssertionServiceInputFilter" />
<processingStep description="Exited SOAP filter Microsoft.ConnectedServices.Sdk.Security.DynamicAssertionServiceInputFilter" />
<processingStep description="Entering SOAP filter Microsoft.ConnectedServices.InternalUtils.TraceFilters.InputTraceFilter" />
<processingStep description="Exited SOAP filter Microsoft.ConnectedServices.InternalUtils.TraceFilters.InputTraceFilter" />
<processingStep description="Entering SOAP filter Microsoft.Web.Services3.Design.AuthorizationAssertion+AuthorizationFilter" />
<processingStep description="Exited SOAP filter Microsoft.Web.Services3.Design.AuthorizationAssertion+AuthorizationFilter" />
<processingStep description="Processed message">
<env:Envelope xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header />
<env:Body>
<CreateSession xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://Microsoft/ConnectedServices/2006/06/Session/">
<Session timestamp="0001-01-01T00:00:00-08:00" timeout="30" persist="None" state="Active" routeAnyAction="true" ackOnRouteMsgToParticipants="false">
<SessionName>HelloWorld</SessionName>
<Participants>
<Participant timeout="30" role="Service" inChannelResponse="false" type="WebService">
<SoapVersion>Default</SoapVersion>
<ParticipantName>ServerService</ParticipantName>
<ParticipantID>ServerService</ParticipantID>
<ParticipantUrl>http://localhost/ServerService/Service.asmx</ParticipantUrl>
<Actions />
<PolicyDocument>
<Include>
<SecondaryCredentialMap>
<PrimaryCredentialForMessage>None</PrimaryCredentialForMessage>
<PrimaryCredentialForTransport transportAuthenticationType="Ntlm">None</PrimaryCredentialForTransport>
</SecondaryCredentialMap>
</Include>
</PolicyDocument>
</Participant>
<Participant timeout="30" role="Service" inChannelResponse="false" type="WebService">
<SoapVersion>Default</SoapVersion>
<ParticipantName>ClientService</ParticipantName>
<ParticipantID>ClientService</ParticipantID>
<ParticipantUrl>http://localhost/ClientServiceSite/ClientService.ashx</ParticipantUrl>
<Actions />
<PolicyDocument>
<Include>
<SecondaryCredentialMap>
<PrimaryCredentialForMessage>None</PrimaryCredentialForMessage>
<PrimaryCredentialForTransport transportAuthenticationType="Ntlm">None</PrimaryCredentialForTransport>
</SecondaryCredentialMap>
</Include>
</PolicyDocument>
</Participant>
</Participants>
<RoutingTable version="0" timestamp="0001-01-01T00:00:00-08:00">
<Routes>
<Route>
<Criteria>(ACTION EQ 'http://tempuri.org/Log')</Criteria>
<Destination>ServerService[http://tempuri.org/Log]</Destination>
</Route>
<Route>
<Criteria>(ACTION EQ 'http://tempuri.org/LogResponse')</Criteria>
<Destination>ClientService[http://osdt/research/2006/10/ClientService/TalkResponse]</Destination>
</Route>
</Routes>
</RoutingTable>
</Session>
</CreateSession>
</env:Body>
</env:Envelope>
</processingStep>
</inputMessage>
<inputMessage utc="10/16/2006 3:32:16 PM" messageId="urn:uuid:abe3c6f1-f7d8-4fcd-8812-45f4ba1a1930">
<processingStep description="Unprocessed message">
<env:Envelope xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<wsa:Action>http://tempuri.org/Log</wsa:Action>
<wsa:From>
<wsa:Address>http://localhost/ClientServiceSite/ClientService.ashx</wsa:Address>
</wsa:From>
<wsa:MessageID>urn:uuid:abe3c6f1-f7d8-4fcd-8812-45f4ba1a1930</wsa:MessageID>
<wsa:To>http://localhost/session30/session.ashx</wsa:To>
<csfse:SessionID xmlns:csfse="http://Microsoft/ConnectedServices/2006/06/Session/">urn:639ab751-796b-4aa4-9c81-2ab4ab196281</csfse:SessionID>
<wsse:Security env:mustUnderstand="true">
<wsu:Timestamp wsu:Id="Timestamp-b6030519-0423-4bf7-bb2d-bbe6674d7430">
<wsu:Created>2006-10-16T15:32:16Z</wsu:Created>
<wsu:Expires>2006-10-16T15:37:16Z</wsu:Expires>
</wsu:Timestamp>
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SecurityToken-612fcc3a-1867-4cac-ac25-1482505d96dd">
<wsse:Username>Session-Service@contoso.com</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">research=0sdt</wsse:Password>
<wsse:Nonce>XOb9henrTOk2qrHqGJYgDw==</wsse:Nonce>
<wsu:Created>2006-10-16T15:32:16Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</env:Header>
<env:Body>
<string xmlns="http://tempuri.org/">Allen Lee</string>
</env:Body>
</env:Envelope>
</processingStep>
<processingStep description="Entering SOAP filter Microsoft.Web.Services3.Design.RequireSoapHeaderAssertion+RequireSoapHeaderFilter" />
<processingStep description="Exited SOAP filter Microsoft.Web.Services3.Design.RequireSoapHeaderAssertion+RequireSoapHeaderFilter" />
<processingStep description="Entering SOAP filter Microsoft.ConnectedServices.Sdk.Security.DynamicAssertionServiceInputFilter" />
<processingStep description="Exited SOAP filter Microsoft.ConnectedServices.Sdk.Security.DynamicAssertionServiceInputFilter" />
<processingStep description="Entering SOAP filter Microsoft.ConnectedServices.InternalUtils.TraceFilters.InputTraceFilter" />
<processingStep description="Exited SOAP filter Microsoft.ConnectedServices.InternalUtils.TraceFilters.InputTraceFilter" />
<processingStep description="Entering SOAP filter Microsoft.Web.Services3.Design.AuthorizationAssertion+AuthorizationFilter" />
<processingStep description="Exited SOAP filter Microsoft.Web.Services3.Design.AuthorizationAssertion+AuthorizationFilter" />
<processingStep description="Processed message">
<env:Envelope xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<csfse:SessionID xmlns:csfse="http://Microsoft/ConnectedServices/2006/06/Session/">urn:639ab751-796b-4aa4-9c81-2ab4ab196281</csfse:SessionID>
</env:Header>
<env:Body>
<string xmlns="http://tempuri.org/">Allen Lee</string>
</env:Body>
</env:Envelope>
</processingStep>
</inputMessage>
<inputMessage utc="10/16/2006 3:32:16 PM" messageId="urn:uuid:2fa7c49e-e076-413b-b85d-cdcbe0231b9d">
<processingStep description="Unprocessed message">
<env:Envelope xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<wsa:Action>http://Microsoft/ConnectedServices/2006/06/Session/TerminateSession</wsa:Action>
<wsa:MessageID>urn:uuid:2fa7c49e-e076-413b-b85d-cdcbe0231b9d</wsa:MessageID>
<wsa:ReplyTo>
<wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
</wsa:ReplyTo>
<wsa:To>http://research-osdt.contoso.com/Session30/SessionManagerAdmin.ashx</wsa:To>
<csfse:SessionID xmlns:csfse="http://Microsoft/ConnectedServices/2006/06/Session/">urn:639ab751-796b-4aa4-9c81-2ab4ab196281</csfse:SessionID>
<wsse:Security env:mustUnderstand="true">
<wsu:Timestamp wsu:Id="Timestamp-7123343e-6f74-4eef-9c52-2df096cc3308">
<wsu:Created>2006-10-16T15:32:16Z</wsu:Created>
<wsu:Expires>2006-10-16T15:37:16Z</wsu:Expires>
</wsu:Timestamp>
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SecurityToken-be7e99c5-a810-4a1b-b64b-6384e4f240b4">
<wsse:Username>Session-Service@contoso.com</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">research=0sdt</wsse:Password>
<wsse:Nonce>ASESZT/lBLI8cXxvKhTXgg==</wsse:Nonce>
<wsu:Created>2006-10-16T15:32:16Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</env:Header>
<env:Body>
<TerminateSession xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://Microsoft/ConnectedServices/2006/06/Session/" />
</env:Body>
</env:Envelope>
</processingStep>
<processingStep description="Entering SOAP filter Microsoft.Web.Services3.Design.RequireSoapHeaderAssertion+RequireSoapHeaderFilter" />
<processingStep description="Exited SOAP filter Microsoft.Web.Services3.Design.RequireSoapHeaderAssertion+RequireSoapHeaderFilter" />
<processingStep description="Entering SOAP filter Microsoft.ConnectedServices.Sdk.Security.DynamicAssertionServiceInputFilter" />
<processingStep description="Exited SOAP filter Microsoft.ConnectedServices.Sdk.Security.DynamicAssertionServiceInputFilter" />
<processingStep description="Entering SOAP filter Microsoft.ConnectedServices.InternalUtils.TraceFilters.InputTraceFilter" />
<processingStep description="Exited SOAP filter Microsoft.ConnectedServices.InternalUtils.TraceFilters.InputTraceFilter" />
<processingStep description="Entering SOAP filter Microsoft.Web.Services3.Design.AuthorizationAssertion+AuthorizationFilter" />
<processingStep description="Exited SOAP filter Microsoft.Web.Services3.Design.AuthorizationAssertion+AuthorizationFilter" />
<processingStep description="Processed message">
<env:Envelope xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<csfse:SessionID xmlns:csfse="http://Microsoft/ConnectedServices/2006/06/Session/">urn:639ab751-796b-4aa4-9c81-2ab4ab196281</csfse:SessionID>
</env:Header>
<env:Body>
<TerminateSession xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://Microsoft/ConnectedServices/2006/06/Session/" />
</env:Body>
</env:Envelope>
</processingStep>
</inputMessage>
</log>

Session_OutputTrace.webinfo is as follows:

<?xml version="1.0" encoding="utf-8"?>
<log>
<outputMessage utc="10/16/2006 3:32:16 PM" messageId="urn:uuid:a615334b-0d8f-4766-b53a-2016267493ed">
<processingStep description="Unprocessed message">
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Body>
<CreateSessionResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://Microsoft/ConnectedServices/2006/06/Session/">
<SessionID>urn:639ab751-796b-4aa4-9c81-2ab4ab196281</SessionID>
<SessionLocations>
<SessionLocation transport="http">
<SessionManagerAdminWSUri>http://research-osdt.contoso.com/Session30/SessionManagerAdmin.ashx</SessionManagerAdminWSUri>
<SessionAdminWSUri>http://research-osdt.contoso.com/Session30/SessionAdmin.ashx</SessionAdminWSUri>
<SessionWSUri>http://research-osdt.contoso.com/Session30/Session.ashx</SessionWSUri>
</SessionLocation>
</SessionLocations>
</CreateSessionResponse>
</env:Body>
</env:Envelope>
</processingStep>
<processingStep description="Entering SOAP filter Microsoft.ConnectedServices.InternalUtils.TraceFilters.OutputTraceFilter" />
<processingStep description="Exited SOAP filter Microsoft.ConnectedServices.InternalUtils.TraceFilters.OutputTraceFilter" />
<processingStep description="Entering SOAP filter Microsoft.ConnectedServices.Sdk.Security.DynamicAssertionServiceOutputFilter" />
<processingStep description="Exited SOAP filter Microsoft.ConnectedServices.Sdk.Security.DynamicAssertionServiceOutputFilter" />
<processingStep description="Processed message">
<env:Envelope xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<wsa:Action>http://Microsoft/ConnectedServices/2006/06/Session/CreateSessionResponse</wsa:Action>
<wsa:From>
<wsa:Address>http://research-osdt.contoso.com/Session30/SessionManagerAdmin.ashx</wsa:Address>
</wsa:From>
<wsa:MessageID>urn:uuid:a615334b-0d8f-4766-b53a-2016267493ed</wsa:MessageID>
<wsa:RelatesTo>urn:uuid:fa25b367-b08a-45bd-bc08-435e6021128b</wsa:RelatesTo>
<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
<csfse:SessionID xmlns:csfse="http://Microsoft/ConnectedServices/2006/06/Session/">urn:639ab751-796b-4aa4-9c81-2ab4ab196281</csfse:SessionID>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-11a418ce-de1c-4c04-b09a-7febb88e52e5">
<wsu:Created>2006-10-16T15:32:16Z</wsu:Created>
<wsu:Expires>2006-10-16T15:37:16Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</env:Header>
<env:Body>
<CreateSessionResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://Microsoft/ConnectedServices/2006/06/Session/">
<SessionID>urn:639ab751-796b-4aa4-9c81-2ab4ab196281</SessionID>
<SessionLocations>
<SessionLocation transport="http">
<SessionManagerAdminWSUri>http://research-osdt.contoso.com/Session30/SessionManagerAdmin.ashx</SessionManagerAdminWSUri>
<SessionAdminWSUri>http://research-osdt.contoso.com/Session30/SessionAdmin.ashx</SessionAdminWSUri>
<SessionWSUri>http://research-osdt.contoso.com/Session30/Session.ashx</SessionWSUri>
</SessionLocation>
</SessionLocations>
</CreateSessionResponse>
</env:Body>
</env:Envelope>
</processingStep>
</outputMessage>
<outputMessage utc="10/16/2006 3:32:16 PM" messageId="urn:uuid:1b5366e5-1e95-4690-8af7-212dc206058d">
<processingStep description="Unprocessed message">
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<string xmlns="http://tempuri.org/">Allen Lee</string>
</soap:Body>
</soap:Envelope>
</processingStep>
<processingStep description="Entering SOAP filter Microsoft.Web.Services3.Security.Wse2PipelinePolicy+LegacyFilterWrapper" />
<processingStep description="Exited SOAP filter Microsoft.Web.Services3.Security.Wse2PipelinePolicy+LegacyFilterWrapper" />
<processingStep description="Entering SOAP filter Microsoft.Web.Services3.Security.Wse2PipelinePolicy+LegacyFilterWrapper" />
<processingStep description="Exited SOAP filter Microsoft.Web.Services3.Security.Wse2PipelinePolicy+LegacyFilterWrapper" />
<processingStep description="Processed message">
<soap:Envelope xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<wsa:Action>http://tempuri.org/Log</wsa:Action>
<wsa:From>
<wsa:Address>http://localhost/session30/session.ashx</wsa:Address>
<wsa:ReferenceProperties>
<csfse:SessionID xmlns:csfse="http://Microsoft/ConnectedServices/2006/06/Session/">urn:639ab751-796b-4aa4-9c81-2ab4ab196281</csfse:SessionID>
<csfse:OriginalFrom xmlns:csfse="http://Microsoft/ConnectedServices/2006/06/Session/">http://localhost/ClientServiceSite/ClientService.ashx</csfse:OriginalFrom>
<csfse:OriginalMessageID xmlns:csfse="http://Microsoft/ConnectedServices/2006/06/Session/">urn:uuid:abe3c6f1-f7d8-4fcd-8812-45f4ba1a1930</csfse:OriginalMessageID>
</wsa:ReferenceProperties>
</wsa:From>
<wsa:MessageID>urn:uuid:1b5366e5-1e95-4690-8af7-212dc206058d</wsa:MessageID>
<wsa:To>http://localhost/ServerService/Service.asmx</wsa:To>
<csfse:SessionID xmlns:csfse="http://Microsoft/ConnectedServices/2006/06/Session/">urn:639ab751-796b-4aa4-9c81-2ab4ab196281</csfse:SessionID>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-b5d85790-bebd-4e96-b4a3-15a0227facf0">
<wsu:Created>2006-10-16T15:32:16Z</wsu:Created>
<wsu:Expires>2006-10-16T15:37:16Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soap:Header>
<soap:Body>
<string xmlns="http://tempuri.org/">Allen Lee</string>
</soap:Body>
</soap:Envelope>
</processingStep>
</outputMessage>
<outputMessage utc="10/16/2006 3:32:16 PM" messageId="urn:uuid:334f763f-1c48-4bec-bfb6-f43c33588b4e">
<processingStep description="Unprocessed message">
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Body>
<TerminateSessionResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://Microsoft/ConnectedServices/2006/06/Session/" />
</env:Body>
</env:Envelope>
</processingStep>
<processingStep description="Entering SOAP filter Microsoft.ConnectedServices.InternalUtils.TraceFilters.OutputTraceFilter" />
<processingStep description="Exited SOAP filter Microsoft.ConnectedServices.InternalUtils.TraceFilters.OutputTraceFilter" />
<processingStep description="Entering SOAP filter Microsoft.ConnectedServices.Sdk.Security.DynamicAssertionServiceOutputFilter" />
<processingStep description="Exited SOAP filter Microsoft.ConnectedServices.Sdk.Security.DynamicAssertionServiceOutputFilter" />
<processingStep description="Processed message">
<env:Envelope xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<wsa:Action>http://Microsoft/ConnectedServices/2006/06/Session/TerminateSessionResponse</wsa:Action>
<wsa:From>
<wsa:Address>http://research-osdt.contoso.com/Session30/SessionManagerAdmin.ashx</wsa:Address>
</wsa:From>
<wsa:MessageID>urn:uuid:334f763f-1c48-4bec-bfb6-f43c33588b4e</wsa:MessageID>
<wsa:RelatesTo>urn:uuid:2fa7c49e-e076-413b-b85d-cdcbe0231b9d</wsa:RelatesTo>
<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
<csfse:SessionID xmlns:csfse="http://Microsoft/ConnectedServices/2006/06/Session/">urn:639ab751-796b-4aa4-9c81-2ab4ab196281</csfse:SessionID>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-f1f86efe-dcbd-490e-b364-251fc9b09b06">
<wsu:Created>2006-10-16T15:32:16Z</wsu:Created>
<wsu:Expires>2006-10-16T15:37:16Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</env:Header>
<env:Body>
<TerminateSessionResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://Microsoft/ConnectedServices/2006/06/Session/" />
</env:Body>
</env:Envelope>
</processingStep>
</outputMessage>
</log>

The InputTrace.webinfo of ServerService is as follows:

<?xml version="1.0" encoding="utf-8"?>
<log>
<inputMessage utc="10/16/2006 3:32:16 PM" messageId="urn:uuid:1b5366e5-1e95-4690-8af7-212dc206058d">
<processingStep description="Unprocessed message">
<soap:Envelope xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<wsa:Action>http://tempuri.org/Log</wsa:Action>
<wsa:From>
<wsa:Address>http://localhost/session30/session.ashx</wsa:Address>
<wsa:ReferenceProperties>
<csfse:SessionID xmlns:csfse="http://Microsoft/ConnectedServices/2006/06/Session/">urn:639ab751-796b-4aa4-9c81-2ab4ab196281</csfse:SessionID>
<csfse:OriginalFrom xmlns:csfse="http://Microsoft/ConnectedServices/2006/06/Session/">http://localhost/ClientServiceSite/ClientService.ashx</csfse:OriginalFrom>
<csfse:OriginalMessageID xmlns:csfse="http://Microsoft/ConnectedServices/2006/06/Session/">urn:uuid:abe3c6f1-f7d8-4fcd-8812-45f4ba1a1930</csfse:OriginalMessageID>
</wsa:ReferenceProperties>
</wsa:From>
<wsa:MessageID>urn:uuid:1b5366e5-1e95-4690-8af7-212dc206058d</wsa:MessageID>
<wsa:To>http://localhost/ServerService/Service.asmx</wsa:To>
<csfse:SessionID xmlns:csfse="http://Microsoft/ConnectedServices/2006/06/Session/">urn:639ab751-796b-4aa4-9c81-2ab4ab196281</csfse:SessionID>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-b5d85790-bebd-4e96-b4a3-15a0227facf0">
<wsu:Created>2006-10-16T15:32:16Z</wsu:Created>
<wsu:Expires>2006-10-16T15:37:16Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soap:Header>
<soap:Body>
<string xmlns="http://tempuri.org/">Allen Lee</string>
</soap:Body>
</soap:Envelope>
</processingStep>
<processingStep description="Entering SOAP filter Microsoft.Web.Services3.Security.Wse2PipelinePolicy+LegacyFilterWrapper" />
<processingStep description="Exited SOAP filter Microsoft.Web.Services3.Security.Wse2PipelinePolicy+LegacyFilterWrapper" />
<processingStep description="Entering SOAP filter Microsoft.Web.Services3.Security.Wse2PipelinePolicy+LegacyFilterWrapper" />
<processingStep description="Exited SOAP filter Microsoft.Web.Services3.Security.Wse2PipelinePolicy+LegacyFilterWrapper" />
<processingStep description="Processed message">
<soap:Envelope xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<csfse:SessionID xmlns:csfse="http://Microsoft/ConnectedServices/2006/06/Session/">urn:639ab751-796b-4aa4-9c81-2ab4ab196281</csfse:SessionID>
</soap:Header>
<soap:Body>
<string xmlns="http://tempuri.org/">Allen Lee</string>
</soap:Body>
</soap:Envelope>
</processingStep>
</inputMessage>
</log>

This is a very long threat! The projects is just to test whether the message sent from client could be routed to the destination service. After the execution of the Client, the log.txt was created under C:, but inside the log file there was nothing! The session trace files and destination service input trace file indicated that message has been routed to the destination service. But why?

Another question is that how CSF passes messages to methods? Does it pass the whole message to a method or just the message body? Sometime I saw some service method defined its parameter as Message type, and sometime .NET primitive type. Which way is proper?

[55468 byte] By [YonglunLi] at [2008-2-27]
# 1

Young - That's because you have terminated the session before the response from your ASMX service could reach the session.

If you notice the timestamp in the trace, its the same for RouteMsgToParticipants and the TerminateSession call in the input trace.

<inputMessage utc="10/16/2006 3:32:16 PM" messageId="urn:uuid:abe3c6f1-f7d8-4fcd-8812-45f4ba1a1930">

Which means by the time the response comes back from the service, Session would have got terminated. That's the reason why your ClientService is not recieving the response.

So you may want to call the TerminateSession after your recieve your response back from Session.

For your second question, Session passes the whole body and some header elements. The body is not modified.

Thanks

SenthilN-msft at 2007-9-3 > top of Msdn Tech,Connected Services Framework,Connected Services Framework...
# 2
Hi, SenthiN. Inside the method of the destination service, I just want to log the client message to disk without any response to client. So when the message reached the destination service, it could have been logged. In this case, why should I care whether the timestamps for RouteMsgToParticipants and TerminateSession are the same? By the way, Session passes the whole message, including its entire body and header to the destination method?
YonglunLi at 2007-9-3 > top of Msdn Tech,Connected Services Framework,Connected Services Framework...
# 3

SenthilN, this time I change the code inside Main method as follows:

ClientServiceHandler proxy = new ClientServiceHandler();

Console.WriteLine("Press [ENTER] to create session...");
Console.ReadLine();
proxy.CreateSession();

Console.WriteLine("Press [ENTER] to talk to destination service...");
Console.ReadLine();
proxy.Talk("Allen Lee");

Console.WriteLine("Press [ENTER] to terminate session...");
Console.ReadLine();
proxy.TerminateSession();

Console.WriteLine("Press [Enter] to continue...");
Console.ReadLine();

And there's still nothing inside the log.txt. In addition, the Event Viewer said before I terminated Session but after message was routed:

Event Type: Error
Event Source: Microsoft WSE 3.0
Event Category: None
Event ID: 0
Date: 10/17/2006
Time: 2:34:22 PM
User: N/A
Computer: RESEARCH-OSDT
Description:
Message Dispatch Failure: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><soap:Header><wsa:Action>http://schemas.xmlsoap.org/ws/2004/08/addressing/fault</wsa:Action><wsa:MessageID>urn:uuid:afd896cf-b23c-4419-9365-7a8c07bbc063</wsa:MessageID><wsa:RelatesTo>urn:uuid:4338c523-af75-4e5f-a0a1-b81407d6f232</wsa:RelatesTo><wsa:To>http://localhost/session30/session.ashx</wsa:To><csfse:SessionID xmlns:csfse="http://Microsoft/ConnectedServices/2006/06/Session/">urn:cde33645-4fa8-42df-bda5-dffc63dcb843</csfse:SessionID><csfse:OriginalFrom xmlns:csfse="http://Microsoft/ConnectedServices/2006/06/Session/">http://localhost/ClientServiceSite/ClientService.ashx</csfse:OriginalFrom><csfse:OriginalMessageID xmlns:csfse="http://Microsoft/ConnectedServices/2006/06/Session/">urn:uuid:affa6d3a-364d-4413-bf24-4d5f417b1771</csfse:OriginalMessageID><wsse:Security><wsu:Timestamp wsu:Id="Timestamp-a6c8b499-31cb-4100-9b41-f10df0807944"><wsu:Created>2006-10-17T21:34:22Z</wsu:Created><wsu:Expires>2006-10-17T21:39:22Z</wsu:Expires></wsu:Timestamp></wsse:Security></soap:Header><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>System.Web.Services.Protocols.SoapException: Server was unable to process request. &gt; System.NullReferenceException: Object reference not set to an instance of an object.
at Service.Log(Object content)
End of inner exception stack trace </faultstring><detail /></soap:Fault></soap:Body></soap:Envelope>

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Any suggestions to solve the problem?

YonglunLi at 2007-9-3 > top of Msdn Tech,Connected Services Framework,Connected Services Framework...
# 4

Yonglun - We are looking into this issue. Will get back to you with some suggestions how to resolve this.

Thanks

SenthilN-msft at 2007-9-3 > top of Msdn Tech,Connected Services Framework,Connected Services Framework...