Я использую веб-службу Java, разработанную одним из наших поставщиков, и у меня нет никакого контроля над ней. Я написал маршрутизатор WCF, который клиентское приложение вызывает его, и маршрутизатор отправляет сообщение в веб-службу Java и возвращает данные обратно клиенту.Заголовки WCF MustUnderstand не поняли
Проблема, с которой я сталкиваюсь, я успешно могу назвать веб-службу Java с маршрутизатора WCF, но я возвращаю следующие исключения.
Router конфигурационный файл выглядит следующим образом:
<customBinding>
<binding name="SimpleWSPortBinding">
<!--<reliableSession maxPendingChannels="4" maxRetryCount="8" ordered="true" />-->
<!--<mtomMessageEncoding messageVersion ="Soap12WSAddressing10" ></mtomMessageEncoding>-->
<textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
messageVersion="Soap12WSAddressing10" writeEncoding="utf-8" />
<httpTransport manualAddressing="false" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
allowCookies="false" authenticationScheme="Anonymous" bypassProxyOnLocal="true" keepAliveEnabled="true"
maxBufferSize="65536" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"/>
</binding>
</customBinding>
тестовый файл клиента конфигурационный
<customBinding>
<binding name="DocumentRepository_Binding_Soap12">
<!--<reliableSession maxPendingChannels="4" maxRetryCount="8" ordered="true" />-->
<!--<mtomMessageEncoding messageVersion ="Soap12WSAddressing10" ></mtomMessageEncoding>-->
<textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
messageVersion="Soap12WSAddressing10" writeEncoding="utf-8">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</textMessageEncoding>
<httpTransport manualAddressing="false" maxBufferPoolSize="524288"
maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous"
realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
useDefaultWebProxy="true" />
</binding>
</customBinding>
Если я использую textMessageEncoding я получаю
<soap:Text xml:lang="en">MustUnderstand headers: [{http://www.w3.org/2005/08/addressing}To, {http://www.w3.org/2005/08/addressing}Action] are not understood.</soap:Text>
Если я использую mtomMessageEncoding Я получение
The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.
класс Мой маршрутизатор следующим образом:
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple, AddressFilterMode = AddressFilterMode.Any, ValidateMustUnderstand = false)]
public class EmployeeService : IEmployeeService
{
public System.ServiceModel.Channels.Message ProcessMessage(System.ServiceModel.Channels.Message requestMessage)
{
ChannelFactory<IEmployeeService> factory = new ChannelFactory<IEmployeeService>("client");
factory.Endpoint.Behaviors.Add(new MustUnderstandBehavior(false));
IEmployeeService proxy = factory.CreateChannel();
Message responseMessage = proxy.ProcessMessage(requestMessage);
return responseMessage;
}
}
«Клиент» в приведенном выше коде под ChannelFactory определяется в конфигурационном файле, как:
<client>
<endpoint address="http://JavaWS/EmployeeService" binding="wsHttpBinding"
bindingConfiguration="wsHttp" contract="EmployeeService.IEmployeeService"
name="client" behaviorConfiguration="clientBehavior">
<headers>
</headers>
</endpoint>
</client>
Благодарим Вас за любезное помощь.
Спасибо заранее, Raghu
Так почему это происходит? Могли ли вы каким-то образом изменить значение заголовка 'mustunderstand' в своем сообщении? –