SOAPHeader

Discussion in 'ASP .Net Web Services' started by Eric, Jul 13, 2004.

  1. Eric

    Eric Guest

    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;
    }
    ----------------------------------------------------------------------------
    ------------------
     
    Eric, Jul 13, 2004
    #1
    1. Advertising

  2. Eric

    [MSFT] Guest

    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
     
    [MSFT], Jul 14, 2004
    #2
    1. Advertising

  3. Eric

    Eric Guest

    I traced the SOAP message via a proxy listener.

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



    "[MSFT]" <> wrote in message
    news:...
    > 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
    >
     
    Eric, Jul 14, 2004
    #3
  4. Eric

    [MSFT] Guest

    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
     
    [MSFT], Jul 15, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. All Smiles

    SoapHeader problem

    All Smiles, May 20, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    343
    All Smiles
    May 20, 2004
  2. Replies:
    0
    Views:
    395
  3. Replies:
    0
    Views:
    333
  4. Replies:
    0
    Views:
    393
  5. Replies:
    0
    Views:
    340
Loading...

Share This Page