No service handlers found on operations port

I am upgrading some code to 1.5 and am seeing this weird bug in the cosole output:

Console Output

No service handlers found on operations port with field name:_positionPortCategory StdOut
Level Info
Time 2007-09-06T23:53:49.92875-04:00
Subject No service handlers found on operations port with field name:_positionPort
Source http://roboben:50000/playdata
CodeSite Microsoft.Ccr.Core.Interleave CreateInterleaveFromDsspOperationHandlers(Microsoft.Dss.ServiceModel.DsspServiceBase.DsspServiceBase, Microsoft.Ccr.Core.IPortSet, System.String)() at line:0, file


This service implements 2 alternate contracts. here is a code snipit of the service: (i simplified it a bit)

Code Snippet

[Contract(Contract.Identifier)]
[AlternateContract(pos2d.Contract.Identifier)]
public class PlayDataService : DsspServiceBase
{
private PlayDataState _state = new PlayDataState();

[ServicePort("/playdata", AllowMultipleInstances=false)]
private PlayDataOperations _mainPort = new PlayDataOperations();

[AlternateServicePort("/position", AllowMultipleInstances = false, AlternateContract = pos2d.Contract.Identifier)]
private pos2d.SimplePositionOperations _positionPort = new pos2d.SimplePositionOperations();

...

protected override void Start()
{
...

//position operations
MainPortInterleave.CombineWith(
new Interleave(
new ExclusiveReceiverGroup(
Arbiter.ReceiveWithIterator<pos2d.Replace>(true, _positionPort, PositionReplaceHandler)
),
new ConcurrentReceiverGroup(
Arbiter.ReceiveWithIterator<pos2d.Get>(true, _positionPort, PositionGetHandler)
)
)
);

}

...

public IEnumerator<ITask> PositionGetHandler(pos2d.Get get)
{
get.ResponsePort.Post(_state.PositionState);
yield break;
}

public IEnumerator<ITask> PositionReplaceHandler(pos2d.Replace replace)
{
_state.PositionState = replace.Body;
replace.ResponsePort.Post(DefaultReplaceResponseType.Instance);
yield break;
}

...
}



what's wrong?

[2464 byte] By [BenAxelrod[CoroWare]] at [2008-2-21]
# 1

Nothing is really wrong its just a warning to tell you that you are not using the [ServiceHandler] attributes for your alternate port. In V1.5 you dont need to do MainPortInterleave.CombineWith anymore!

Just use the [ServiceHandler] on your alternate port handlers, but specify the port field you want the handlers to attach to

GeorgeChrysanthakopoulos at 2007-10-3 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Concurrency and Coordination Runtime (CCR)...
# 2

Any tips on using this new cool feature since it is not talked about in the documentation, sample code, or in the "what's new" page on the wiki? For example, I discovered that the AlternateServicePort attribute is required.

And is this the most eloquent way to handle subscriptions now?

Code Snippet

...

[Partner("/simpleposition", Contract = pos.Contract.Identifier, CreationPolicy = PartnerCreationPolicy.UseExisting)]
pos.SimplePositionOperations _positionPort = new pos.SimplePositionOperations();

[AlternateServicePort("/simplepositionPort", AllowMultipleInstances = true, AlternateContract = pos.Contract.Identifier)]
pos.SimplePositionOperations _positionNotify = new pos.SimplePositionOperations();

protected override void Start()
{
...

Arbiter.Choice(
_positionPort.Subscribe(_positionNotify),
delegate(SubscribeResponseType response) { },
delegate(Fault fault) { }
);

}

[ServiceHandler(ServiceHandlerBehavior.Exclusive, PortFieldName="_positionNotify")]
public IEnumerator<ITask> PositionReplaceHandler(pos.Replace msg)
{
...
yield break;
}


Thanks,
-Ben

BenAxelrod[CoroWare] at 2007-10-3 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Concurrency and Coordination Runtime (CCR)...
# 3

Check out the brand new service tutorial 8 and 9, they mention the right way to do alternate contracts.

No the way you use it above is not correct. You can only use it for alternate service ports, not notification ports.

GeorgeChrysanthakopoulos at 2007-10-3 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Concurrency and Coordination Runtime (CCR)...
# 4
It looks like these tutorials did not make to the release, but they are online. I will check them out there. Thanks!
BenAxelrod[CoroWare] at 2007-10-3 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Concurrency and Coordination Runtime (CCR)...

Microsoft Robotics Studio

Site Classified