I am not sure what you were looking for.
<%@ WebService language="C#" class="SoapHeaderTest" %>
using System;
using System.Xml;
using System.Xml.Serialization;
using System.Web.Services;
using System.Web.Services.Protocols;
[WebService(Namespace="urn:my-header-test")]
public class SoapHeaderTest
{
public MyHeader myHeader;
public SoapHeaderTest()
{
myHeader.myString = "Hello, there";
}
[SoapHeader ("myHeader",Direction=SoapHeaderDirection.InOut )]
[WebMethod]
public void MyMethod()
{
myHeader.myString = "Hello, from myMethod";
return;
}
[XmlRoot(Namespace="urn:my-header")]
public class MyHeader:SoapHeader
{
public string myString;
}
}
Here is something that seems to work for me. This sets the namespace info
correctly.
--
Girish Bharadwaj
http://msmvps.com/gbvb
"Corne Rabe" <> wrote in message
news:2545596C-60F5-416D-960A-...
> Hi all
>
> I've got a webservices that will be called by a delphi product. They have
> defined a soap message that they will use to call my webservice. A header
> snippet is found below:
> <soap:Header>
> <mm:TheHeader xmlns:mm="http://The URL">
> <SomeValue>123</SomeValue>
> <AnotherValue>blabla</AnotherValue>
> </mm:TheHeader >
> </soap:Header>
> I've defined a Class that inherits from SoapHeader, and added the
> SoapHeader
> attribute to my webmethod, and included a public member of that type in my
> webservice class.
> No matter what I do, I can not get the header variable populated. I've
> even
> used SoapUnknownHeader in my webmethod, but to no joy.
> I've got a idea that it's got to do with the namespace prefix (mm) they
> are
> using. I included the namespace specified in the header, but still no
> luck.
> They are following the soap standard, and other companies are using their
> product, so there is no option of changing the soap enevelope.
> Is there any way that I can get the soapheader variable populated?
>
> Thanks in advance
>