SoapHeader Required=true not working

M

Martin Lapierre

I've got the following soap header attribute set:

[WebMethod]
[SoapHeader("m_UserInfo", Direction=SoapHeaderDirection.In, Required=true)]
public void SetTest()
{
....
}

The bad thing is, the requirement isn't working: the client can call the
method without the setting the header. What's missing???

Thanks
 
A

Andrea Saltarello [UGIdotNET]

[WebMethod]
[SoapHeader("m_UserInfo", Direction=SoapHeaderDirection.In, Required=true)]
public void SetTest()
{
...
}

The bad thing is, the requirement isn't working: the client can call the
method without the setting the header. What's missing???
Are you using ASP .NET v1.1? If yes, please consider that as of this version
the "Required" attribute has been marked obsolete (see doc), and is not
working anymore:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemwebservicesprotocolssoapheaderattributememberstopic.asp
http://www.gotdotnet.com/team/changeinfo/Backwards1.0to1.1/default.aspx#0000
0101
HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top