No "fault" element in generated WSDL

Discussion in 'ASP .Net Web Services' started by Robbo, Aug 21, 2007.

  1. Robbo

    Robbo Guest

    I wonder if anyone can help regarding webservices and exceptions? I have
    given the WSDL generated from my webservice to my integration team and they
    are saying it needs a "fault" element in order for them to publish it, as it
    will be called by non .net clients.

    I.e: they are saying it needs something like:

    <wsdl:eek:peration name="MI_OUT_customerData">
    <soap:eek:peration
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    soapAction=http://blah.com/get />
    <wsdl:input>
    <soap:body
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal" />
    </wsdl:input>
    <wsdl:eek:utput>
    <soap:body
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal" />
    </wsdl:eek:utput>
    <wsdl:fault name="CustomError">
    <soap:fault
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"
    name="CustomError" />
    </wsdl:fault>
    </wsdl:eek:peration>


    However, I only have the input & output elements under my operation, no
    <wdsl:fault> element.

    Can I get the faults/exceptions specifically declared in there somehow?

    Thanks,

    Paul
     
    Robbo, Aug 21, 2007
    #1
    1. Advertising

  2. "Robbo" <> wrote in message
    news:%...
    >I wonder if anyone can help regarding webservices and exceptions? I have
    >given the WSDL generated from my webservice to my integration team and they
    >are saying it needs a "fault" element in order for them to publish it, as
    >it will be called by non .net clients.
    >
    > I.e: they are saying it needs something like:
    >
    > <wsdl:eek:peration name="MI_OUT_customerData">
    > <soap:eek:peration
    > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    > soapAction=http://blah.com/get />
    > <wsdl:input>
    > <soap:body
    > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal" />
    > </wsdl:input>
    > <wsdl:eek:utput>
    > <soap:body
    > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal" />
    > </wsdl:eek:utput>
    > <wsdl:fault name="CustomError">
    > <soap:fault
    > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"
    > name="CustomError" />
    > </wsdl:fault>
    > </wsdl:eek:peration>
    >
    >
    > However, I only have the input & output elements under my operation, no
    > <wdsl:fault> element.
    >
    > Can I get the faults/exceptions specifically declared in there somehow?


    Sorry, no, not without a lot of custom development, at any rate.

    ..NET doesn't generate fault information. I suspect this is partially because
    there's no obvious source of the information. For instance, a Java method
    must be decorated with a throws() clause listing all possible exceptions it
    may throw. I presume that a Java-to-WSDL program would use this information
    to generate fault elements in the WSDL.

    ..NET programs don't have that kind of information available. If you really
    need this, and if you have nothing better to do for the next few months, you
    might be able to write a piece of code to interface with the process .NET
    uses to reflect over your code to create the WSDL. Such a piece of code
    could do something like parse the XML file that results from compilation
    with XML comments. It could look for the <exception/> information and might
    be able to generate fault elements for you.

    Otherwise, you're pretty much out of luck without switching to WCF. WCF
    allows you to indicate which faults you want included in the WSDL.
    --
    John Saunders [MVP]
     
    John Saunders [MVP], Aug 22, 2007
    #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. mrnu

    wsdl.exe fails with WebMethods generated wsdl file

    mrnu, Jun 7, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    234
  2. 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:
    182
  3. Steve
    Replies:
    2
    Views:
    1,188
    John Saunders
    Nov 17, 2006
  4. Nick Locke

    wsdl.exe not creating class for fault element

    Nick Locke, Oct 21, 2006, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    446
    John Saunders
    Oct 21, 2006
  5. Replies:
    3
    Views:
    517
    John Saunders
    Oct 7, 2008
Loading...

Share This Page