Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Soap12 for HTTP #3426

Merged
merged 1 commit into from
Mar 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1175,12 +1175,6 @@ private bool PrepareMessageHeaders(Message message)
action = string.Format(CultureInfo.InvariantCulture, "\"{0}\"", UrlUtility.UrlPathEncode(action));
}

if (message.Version.Addressing == AddressingVersion.None)
{
message.Headers.Action = null;
message.Headers.To = null;
}

bool suppressEntityBody = message is NullMessage;

object property;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ private void PrepareContentHeaders()
action = string.Format(CultureInfo.InvariantCulture, "\"{0}\"", UrlUtility.UrlPathEncode(action));
}

if (_message.Version.Addressing == AddressingVersion.None)
{
_message.Headers.Action = null;
_message.Headers.To = null;
}

object property;
if (_message.Properties.TryGetValue(HttpRequestMessageProperty.Name, out property))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,11 +633,6 @@ public static string Tcp_Session_Tests_Duplex_Service
}
}

public static string TcpSoap12WSANone_Address
{
get { return GetEndpointAddress("TcpSoap12WSANone.svc/tcp-Soap12WSANone", protocol: "net.tcp"); }
}

public static string TcpSoap11WSA10_Address
{
get { return GetEndpointAddress("TcpSoap11WSA10.svc/tcp-Soap11WSA10", protocol: "net.tcp"); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public static void SameBinding_Soap11WSA2004_EchoString()

[WcfFact]
[OuterLoop]
[Issue(2864)]
public static void SameBinding_Soap12_EchoString_Http()
{
CustomBinding binding = null;
Expand Down Expand Up @@ -122,43 +121,6 @@ public static void SameBinding_Soap12_EchoString_Http()
}
}

[WcfFact]
[OuterLoop]
[Issue(2864)]
public static void SameBinding_Soap12_EchoString_Tcp()
{
CustomBinding binding = null;
EndpointAddress endpointAddress = null;
ChannelFactory<IWcfService> factory = null;
IWcfService serviceProxy = null;
string result = null;
string testString = "Hello";

try
{
// *** SETUP *** \\
binding = new CustomBinding(new TextMessageEncodingBindingElement(MessageVersion.CreateVersion(EnvelopeVersion.Soap12, AddressingVersion.None), Encoding.UTF8), new TcpTransportBindingElement());
endpointAddress = new EndpointAddress(Endpoints.TcpSoap12WSANone_Address);
factory = new ChannelFactory<IWcfService>(binding, endpointAddress);
serviceProxy = factory.CreateChannel();

// *** EXECUTE *** \\
result = serviceProxy.Echo(testString);

// *** VALIDATE *** \\
Assert.True(String.Equals(result, testString), String.Format(" Error: expected response from service: '{0}' Actual was: '{1}'", testString, result));

// *** CLEANUP *** \\
factory.Close();
((ICommunicationObject)serviceProxy).Close();
}
finally
{
// *** ENSURE CLEANUP *** \\
ScenarioTestHelpers.CloseCommunicationObjects((ICommunicationObject)serviceProxy, factory);
}
}

[WcfFact]
[OuterLoop]
public static void SameBinding_Soap11WSA10_EchoString_Http()
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ private static void Main()
CreateHost<TcpSessionTestServiceHost, WcfService.SessionTestsDefaultService>("SessionTestsDefaultService.svc", tcpBaseAddress);
CreateHost<TcpSessionShortTimeoutTestServiceHost, WcfService.SessionTestsShortTimeoutService>("SessionTestsShortTimeoutService.svc", tcpBaseAddress);
CreateHost<TcpSessionDuplexTestServiceHost, WcfService.SessionTestsDuplexService>("SessionTestsDuplexService.svc", tcpBaseAddress);
CreateHost<TcpSoap12WSANoneTestServiceHost, WcfService.WcfService>("TcpSoap12WSANone.svc", tcpBaseAddress);
CreateHost<TcpSoap11WSA10TestServiceHost, WcfService.WcfService>("TcpSoap11WSA10.svc", tcpBaseAddress);
CreateHost<DuplexWebSocketTestServiceHost, WcfWebSocketService>("DuplexWebSocket.svc", websocketBaseAddress);
CreateHost<WebSocketTransportTestServiceHost, WcfWebSocketTransportUsageAlwaysService>("WebSocketTransport.svc", websocketBaseAddress);
Expand Down