미리 정의 된 WSDL을 가져와 (나는 이것을 제어하지 않습니다.) 다양한 SOAP/UPnP 요청에 응답하기 위해 장치에 공개해야합니다.WCF - 일반화 된 액션 문자열
어쨌든이 모든 작업을 수행 할 수 있지만 모든 채널에서 요청할 수있는 서비스가 하나 있기 때문에 문제가 발생합니다. 나는 설명 할 것이다 :
[System.ServiceModel.ServiceContractAttribute(Namespace="urn:some:namespace:{channelNumber}", ConfigurationName="myInterface")]
public interface myInterface
{
[System.ServiceModel.OperationContractAttribute(Action="urn:some:namespace:{channelNumber}#GetConfiguration", ReplyAction="*")]
[System.ServiceModel.XmlSerializerFormatAttribute()]
[return: System.ServiceModel.MessageParameterAttribute(Name="config")]
MyConfigurationResponse GetConfiguration(MyConfigurationRequest request, String channelNumber);
}
I :
기본적으로[System.ServiceModel.ServiceContractAttribute(Namespace="urn:some:namespace:1", ConfigurationName="myInterface")]
public interface myInterface
{
[System.ServiceModel.OperationContractAttribute(Action="urn:some:namespace:1#GetConfiguration", ReplyAction="*")]
[System.ServiceModel.XmlSerializerFormatAttribute()]
[return: System.ServiceModel.MessageParameterAttribute(Name="config")]
MyConfigurationResponse GetConfiguration(MyConfigurationRequest request);
}
가, 내가 (나는이 구문이 완전히 잘못 인식하지만 난 그게 걸쳐 포인트를 얻을 것이다 생각) 할 시도하고있어 이것이다 단순히 구현중인 메소드에 매개 변수로 전달 된 원래의 액션 메시지 일부를 원합니다.
내가 구현할 수있는 다른 방법은 다른 방법을 지정하는 것이고 우리는 Action = "*"으로 Dispatcher를 호출 한 다음 OperationContext.Current.IncomingMessageHeaders.Action
을 사용하여 수동으로 구문 분석합니다. 이것은 단지 일을하는 정말 그늘지는 방법처럼 보입니다. 나는 여기 주요한 장애물이 WCF에 대한 나의 경험이 없다고 확신한다.
제공 할 수있는 모든 도움을 주시면 감사하겠습니다.
감사합니다,
의견을 주셔서 감사합니다 Sixto. 곧 보게 되겠지만, 나는 아직도이 물건들로 시작하고 있습니다.어쩌면 다른 유형의 솔루션을 얻기 위해 내 질문을 다시 구성 할 수 있습니다. SVCUtil.exe에서 생성 된 인터페이스 파일을 수정하는 데 정말로 문제가 없지만 다양한 UPnP 클라이언트에서 128 개 이상의 다른 채널로 들어갈 수 있으며 3 ~ 4 개의 서비스를 손으로 코딩하는 것은 압도적입니다. –