Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > SOAPHeader

Reply
Thread Tools

SOAPHeader

 
 
Eric
Guest
Posts: n/a
 
      07-13-2004
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.SoapHeader Direction.In,
Required=true)]

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


RFCSending is defined like that:

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


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

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




 
Reply With Quote
 
 
 
 
[MSFT]
Guest
Posts: n/a
 
      07-14-2004
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

 
Reply With Quote
 
 
 
 
Eric
Guest
Posts: n/a
 
      07-14-2004
I traced the SOAP message via a proxy listener.

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



"[MSFT]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
[MSFT]
Guest
Posts: n/a
 
      07-15-2004
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AXIS to emit SOAPHeader in WSDL davecline@gmail.com Java 0 12-15-2004 12:01 AM
AXIS to emit SOAPHeader in wsdl davecline@gmail.com Java 0 12-14-2004 11:44 PM
AXIS to emit SOAPHeader in wsdl davecline@gmail.com Java 0 12-14-2004 11:44 PM
AXIS to emit SOAPHeader in wsdl davecline@gmail.com Java 0 12-14-2004 11:43 PM
SoapHeader problem All Smiles ASP .Net 0 05-20-2004 05:48 PM



Advertisments