SOAPHeader

E

Eric

Hi,

I have a WebService client. All the code is generated by VS.NET 2003.
The problem is that some attributes are not generated.
All the attributes in the base class are generated.
But the attribute in the inherited class RFCSending are not.

Is it not possible to use this class structure for a SOAP header?


Thanks
Eric


Definition:
----------------------------------------------------------------------------
------------------
public RFCSending RFCSendingValue;

[System.Web.Services.Protocols.SoapHeaderAttribute("RFCSendingValue",
Direction=System.Web.Services.Protocols.SoapHeaderDirection.In,
Required=true)]

----------------------------------------------------------------------------
------------------


RFCSending is defined like that:

----------------------------------------------------------------------------
------------------
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.xxx")]
[System.Xml.Serialization.XmlRootAttribute(Namespace="http://www.xxx",
IsNullable=false)]
public class RFCSending : sendingType {
[System.Xml.Serialization.XmlAttributeAttribute("groupe-id")]
public int groupeid;
}


[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.xxx")]
[System.Xml.Serialization.XmlIncludeAttribute(typeof(EFCSending))]
[System.Xml.Serialization.XmlIncludeAttribute(typeof(RFCSending))]
public class sendingType : System.Web.Services.Protocols.SoapHeader {

/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("sending-date")]
public System.DateTime sendingdate;
}
 
M

[MSFT]

Hi Eric,

How did you find the attribute in the inherited class RFCSending are not
generated? I test your code with following client code:

localhost.Service1 ls= new localhost.Service1();

ls.Url="http://localhost:8080/WebService3/Service1.asmx";

localhost.RFCSending mh= new localhost.RFCSending();

mh.sendingdate=System.DateTime.Now;

mh.groupeid =4;

ls.RFCSendingValue =mh;
MessageBox.Show(ls.HelloWorld());

And it get following SoapHeader:

<soap:Header><RFCSending sending-date="2004-07-14T12:14:47.9905968+08:00"
groupe-id="4" xmlns="http://tempuri.org/" /></soap:Header>

Luke
 
E

Eric

I traced the SOAP message via a proxy listener.

When I moved the attribute to the base class, it was there.
 
M

[MSFT]

Hi Eric,

I trace the SOAP message with Trace utility in SOAP Toolkit 3.0. Would you
please more code for the problem? For example, the complete code for the
web service and client app.

Regards,

Luke
 

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

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top