Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7644693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:45:07+00:00 2026-05-31T09:45:07+00:00

I wanted to create a one-way method for wcf service. Everything is ok unless

  • 0

I wanted to create a one-way method for wcf service. Everything is ok unless
I want to return fault message – if any.

I am using wscf blue code generator for wsdl and contract files.

In wsdl operation element I have only ‘Input’ and ‘Fault’ child elements.
When I run the service i got the information that cannot declare fault message in one-way communication and .. one of the solutions is to set one-way to false .. what I did and well it works ok. If error occurs I get the message.

However I am wondering if I broke the web service/wsdl creation rules … Because from wsdl service schema generator creates for me one-way communication (set to ‘true’) and other in other programming languages’ generators would probably do the same …

So Is it correct what i Did? How can I change wsdl so that the generator could create the code appropriately?

If in theory I cannot use fault in one-way communication then Do I need extra structure on response to return any error?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T09:45:09+00:00Added an answer on May 31, 2026 at 9:45 am

    It’s true that one-way operations can’t return faults to clients. If you want to generate a void not one-way service operation in WCF you will have to add an empty output element for that operation in your WSDL contract.

    The .NET based WSDL parsers (such as WSCF.blue and svcutil) will generate one-way service operations for <wsdl:operation> elements that don’t have a corresponding <wsdl:output> element.

    For example this WSDL operation is one-way:

    <wsdl:definitions>
        <wsdl:portType>
            ... 
            <wsdl:operation name="Foo">
               <wsdl:input message="tns:FooRequest" />
            </wsdl:operation>
        </wsdl:portType>
    </wsdl:definitions>
    

    On the other hand, defining an operation with an empty <wsdl:output> element (i.e an XSD type containing an empty sequence) will be mapped to a void not one-way method in .NET, which can optionally contain a fault declaration:

    <wsdl:definitions>
        <wsdl:portType>
            ... 
            <wsdl:operation name="Foo">
               <wsdl:input message="tns:FooRequest" />
               <wsdl:output message="tns:FooResponse" />
               <wsdl:fault message="tns:FooFault" />
            </wsdl:operation>
        </wsdl:portType>
    </wsdl:definitions>
    

    where the <tns:FooResponse> type is simply defined as:

    <xs:element name="FooResponse">
        <xs:complexType>
            <xs:sequence/>
        </xs:complexType>
    </xs:element>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanted to create a function of a certain type. I've found one way
I wanted to create one js file which includes every js files to attach
I wanted to create smth similar to this one Kansas county map where user
I wanted to create a very simple method that switches between views in a
I'm using ActiveModel in one of my projects and I wanted to ask what
I wanted to create a new property on a table in my model.. Basically
I wanted to create a control with a TextBox and to bind TextBox.Text property
I wanted to create a page with a simple button which runs away from
I wanted to create some subdirectories inside my blob. But it is not working
I wanted to create jquery plugin & started off creating a sample jquery plugin...But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.