• Post Reply Bookmark Topic Watch Topic
  • New Topic

to Richard--Question about Listing 15-47 and 15-48 in RMH book  RSS feed

 
Nancy King
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Listing 15-47:
...
<message name="fooRequest">
<part name="book" type="mh:Book"/>
</message>
<message name="fooResponse">
<part name="book" type="mh:Book"/>
</message>
<portType name="FooBar">
<operation name="foo">
<input message="mh:fooRequest"/>
<output message="mh:fooResponse"/>
</operation>
</portType>

Listing 15-48:
public interface FooBar extends java.rmi.Remote{
public void foo(BookHolder book) throws java.rmi.RemoteException;
}

My Question:
Because there is <output..>, shouldn't the foo method return "Book" type instead of "void"?
Thanks,
Nancy
 
Russell Teabeault
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The top of page 465 contains your answer. Both fooRequest and fooResponse have a part with the name "book". Since book is declared by both the input and output message it is a INOUT parameter and requires a holder. If fooResponse part on the other hand had a different name (such as "book2") then I believe that the generated interface would of had a return value of type Book and an input parameter of type Book. I hope this helps. Be sure to read section 15.3.4.2.

-russ
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!