Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / August 2007

Tip: Looking for answers? Try searching our database.

No "fault" element in generated WSDL

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robbo - 21 Aug 2007 18:32 GMT
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:operation name="MI_OUT_customerData">
           <soap:operation
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:output>
               <soap:body
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal" />
           </wsdl:output>
           <wsdl:fault name="CustomError">
               <soap:fault
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"
name="CustomError" />
           </wsdl:fault>
</wsdl:operation>

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
John Saunders [MVP] - 22 Aug 2007 00:45 GMT
>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
[quoted text clipped - 26 lines]
>
> 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.
Signature

John Saunders [MVP]


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.