This project is read-only.

Creating Web Service with a void method ...

Mar 12, 2012 at 3:53 PM


   I am trying to define contract which would allow me to create a void method.
Here is a contract in the message xml file.

  <xs:element name="SelectPaper" >
        <xs:element name="BookId" type="TBookParameter" />

  <xs:element name="SelectPaperResponse">

The problem is that, when Response element is empty (as above), client code is generated for SelectPaper method
with SelectPaper class, and TBookParameter is a member of this class.

What I would like to have is, the method SelectPaper with TBookParameter parameter.

I have sth like this:
public object TestMethod (SelectPaper paper)

I would like to have:
public object TestMethod (TBookParameter paper)

When the response element contains any type, then I have the correct method signature ...

What's wrong with my code?








Mar 13, 2012 at 9:34 AM

Ok I solved the problem by creating one-way set to false method wiithout response xsd element.

Normally one-way set to true would suffice, however I wouldn't be able to get fault message.


By the way, can you tell me if that is ok? I wanted to create one-way method but wscf wizard doesn't want

to create one-way communication with fault response. If I set request/response then I am forced to point to

response method. However when I change manually one-way to false in service interface then everything works ok ...