0

We have an ASMX web-service. I know, it's obsolete, but we have to keep it. So, I have a client-application that sends request (with WS-Addressing headers) to the method of this service:

someASMX.someSoapClient client = new someASMX.someSoapClient();
using (OperationContextScope scope = new OperationContextScope(client.InnerChannel))
{
    OperationContext.Current.OutgoingMessageHeaders.ReplyTo = new EndpointAddress("https://address2answer");
    OperationContext.Current.OutgoingMessageHeaders.MessageId = new System.Xml.UniqueId(Guid.NewGuid());
    client.someMethod("1", "test");
}

But request fails with the following exception:

Addressing Version 'AddressingNone (http://schemas.microsoft.com/ws/2005/05/addressing/none)' does not support adding WS-Addressing headers

Does ASMX web-services even support WS-Addressing then? If they do, what should I do to make it accept requests with WS-Addressing headers?

I have the following binding in app.config of the client:

<basicHttpBinding>
  <binding name="someSoap">
    <security mode="Transport" />
  </binding>
</basicHttpBinding>

<endpoint address="https://someserver:443/some.asmx"
    binding="basicHttpBinding" bindingConfiguration="someSoap"
    contract="someNS.someSoap" name="someSoap" />

I suspect it has to do something with bindings, but that's auto-generated stuff from adding Service Reference in Visual Studio - why it was generated that way then? Maybe I need to change something on the ASMX service's side?

retif
  • 1,495
  • 1
  • 22
  • 40

1 Answers1

0

My bad, I haven't done enough research about ASMX - it does not support wsHttpBinding. So we should get rid of it and create a WCF-service with wsHttpBinding endpoint.

retif
  • 1,495
  • 1
  • 22
  • 40