Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > No "fault" element in generated WSDL

Reply
Thread Tools

No "fault" element in generated WSDL

 
 
Robbo
Guest
Posts: n/a
 
      08-21-2007
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:

<wsdlperation name="MI_OUT_customerData">
<soapperation
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>
<wsdlutput>
<soap:body
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal" />
</wsdlutput>
<wsdl:fault name="CustomError">
<soap:fault
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"
name="CustomError" />
</wsdl:fault>
</wsdlperation>


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


 
Reply With Quote
 
 
 
 
John Saunders [MVP]
Guest
Posts: n/a
 
      08-21-2007
"Robbo" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>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:
>
> <wsdlperation name="MI_OUT_customerData">
> <soapperation
> 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>
> <wsdlutput>
> <soap:body
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal" />
> </wsdlutput>
> <wsdl:fault name="CustomError">
> <soap:fault
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"
> name="CustomError" />
> </wsdl:fault>
> </wsdlperation>
>
>
> 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]

 
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
webservices, wsdl & xsd (schema-2-wsdl) Dark Java 1 11-14-2008 07:58 PM
Turn off Auto Generated WSDL, so I can use my static custom wsdl casucci@gmail.com ASP .Net Web Services 3 10-07-2008 06:38 PM
how to Update/insert an xml element's text----> (<element>text</element>) HANM XML 2 01-29-2008 03:31 PM
How to have a "fault" element in generated WSDL? Arnold Huygens ASP .Net Web Services 3 09-27-2004 04:45 PM
wsdl.exe fails with WebMethods generated wsdl file mrnu ASP .Net Web Services 0 06-07-2004 04:51 PM



Advertisments