wsdl.exe not creating class for fault element

Discussion in 'ASP .Net Web Services' started by Nick Locke, Oct 21, 2006.

  1. Nick Locke

    Nick Locke Guest

    I have already seen this:

    >> And I should point out that wsdl.exe ignores fault messages in the
    >> <portType> operations. You can manually insert them, but the wsdl tool
    >> will
    >> ignore them when it generates classes. There is currently no way that I
    >> know
    >> of to have VS .NET or the command line tools automatically generate wsdl
    >> that includes fault message references.


    and I assume that this is still correct. I had been hoping to see a
    generated class definition relating to the fault element already definined
    in the WSDL - but apparently not!

    I will be returning effectively an array of Error Codes and Error
    Descriptions. What is the recommended way to make sure that my (contract
    first) WSDL correctly represents what I am going to return from ASP.NET? Or
    is plan B to not actually formally define the error format in the WSDL?

    Thanks, Nick.
     
    Nick Locke, Oct 21, 2006
    #1
    1. Advertising

  2. "Nick Locke" <> wrote in message
    news:p...
    >I have already seen this:
    >
    >>> And I should point out that wsdl.exe ignores fault messages in the
    >>> <portType> operations. You can manually insert them, but the wsdl tool
    >>> will
    >>> ignore them when it generates classes. There is currently no way that I
    >>> know
    >>> of to have VS .NET or the command line tools automatically generate wsdl
    >>> that includes fault message references.

    >
    > and I assume that this is still correct. I had been hoping to see a
    > generated class definition relating to the fault element already definined
    > in the WSDL - but apparently not!
    >
    > I will be returning effectively an array of Error Codes and Error
    > Descriptions. What is the recommended way to make sure that my (contract
    > first) WSDL correctly represents what I am going to return from ASP.NET?
    > Or is plan B to not actually formally define the error format in the WSDL?


    What I did is to define my fault messages in a separate schema, which is
    referenced in the wsdl. I then ran that schema through XSD.EXE to get me
    class definitions I could use in my code. When I wanted to generate a
    SoapException corresponding to those faults, I serialized the generated
    class into the Detail property of the SoapException.

    John
     
    John Saunders, Oct 21, 2006
    #2
    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. Stephen Edgecombe

    WSDL.EXE: WSDL Import Directive

    Stephen Edgecombe, Aug 13, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    280
    Stephen Edgecombe
    Aug 13, 2003
  2. RH
    Replies:
    1
    Views:
    285
    Dino Chiesa [Microsoft]
    May 27, 2004
  3. mrnu

    wsdl.exe fails with WebMethods generated wsdl file

    mrnu, Jun 7, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    238
  4. Arnold Huygens

    How to have a "fault" element in generated WSDL?

    Arnold Huygens, Aug 2, 2004, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    187
  5. Steve
    Replies:
    2
    Views:
    1,213
    John Saunders
    Nov 17, 2006
Loading...

Share This Page