Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. web services quest

web services quest

Scheduled Pinned Locked Moved C#
questionjavawcftutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pelos
    wrote on last edited by
    #1

    hello forum, i have defined a web service. If the remote operation is successful the method must return a type of datum (for example, struct Okstr) but if the remote operation is not successful the method must return another different type of datum (for example, ERRORstr). How Can i do this with Web Services?? Is possible to throw exceptions via Web Services (like JAVA RMI or CORBA)? A lot of thanks!!

    V 1 Reply Last reply
    0
    • P pelos

      hello forum, i have defined a web service. If the remote operation is successful the method must return a type of datum (for example, struct Okstr) but if the remote operation is not successful the method must return another different type of datum (for example, ERRORstr). How Can i do this with Web Services?? Is possible to throw exceptions via Web Services (like JAVA RMI or CORBA)? A lot of thanks!!

      V Offline
      V Offline
      VenkatFor NET
      wrote on last edited by
      #2

      Yes, you can throw SoapExceptions using XML Web Services. One way of doing this if you do not want to throw exception, is to create error object of required type like ( Struct in this case ). If web service is successful return the data object else return your error object. In this case, the return type of your web method can be struct or any type you want. :) Bhaskara

      P 1 Reply Last reply
      0
      • V VenkatFor NET

        Yes, you can throw SoapExceptions using XML Web Services. One way of doing this if you do not want to throw exception, is to create error object of required type like ( Struct in this case ). If web service is successful return the data object else return your error object. In this case, the return type of your web method can be struct or any type you want. :) Bhaskara

        P Offline
        P Offline
        pelos
        wrote on last edited by
        #3

        thank you... but i dont know how can i define (with visual studio .Net) a web service that can return two different types. In SUN RPC's I used a union with its discriminator to do this, but there's no union in C#. Can you help me? thanks in advance!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups