Archive for August 29th, 2008

h1

Learning Web Service in the Java EE Tutorial 3

August 29, 2008

Mystery was solved. To make a long story short, the cause of the problem was that glassfish application server did not correctly set up a configuration file called sun-acc.xml in the domain1 directory, which I use for this tutorial.  For the good information, take a look at http://forums.java.net/jive/thread.jspa?messageID=296235&#296235.

 

The simple HelloClient is a POJO, but to make WebServiceRef annotation, it seems that the program has to be executed in a container where this annotation is processed. Of course, there is a way not to use the container, which means intead of using WebServiceRef annotation, you could instantiate the stub service by yourself by simply new HelloService() in my case.

 

You might want to know what you are exactly doing with Netbean because operations in the Netbean are totally closed. The URL http://www.java-tips.org/java-ee-tips/java-api-for-xml-web-services/developing-web-services-using-j.html is very helpful although a bit old.

 

Now, I can move on for more complex web services.

 

ミステリーが解けた。手短に言うと、Glassfishサーバーをインストールが正しく、Sun-acc.xmlというファイルを作成していなかった。このファイルはチュートリアルで使用しているGlassfishサーバーのドメインディレクトリにある。詳細は、http://forums.java.net/jive/thread.jspa?messageID=296235&#296235.

 

簡単なHelloClientプログラムは、POJOで書かれているが、WebServiceRefアノテーションが処理されるには、それを処理が出来るコンテイナーで、実行されなくてはいけないようだ。もちろん、コンテイナーなしで、アノテーションを使わず、HelloServiceのオブジェクトを自分で、New HelloService() とすれば、HelloClientを普通のJavaのプログラムとして動かすことが出来る。

 

NETBEAN を使っていると、具体的に何をやっているかぜんぜんわからない。http://www.java-tips.org/java-ee-tips/java-api-for-xml-web-services/developing-web-services-using-j.htmlを読むと分かります。ちょっと古いけど。

 

やっともっと複雑なWeb Serviceに移れる。

 

h1

Learning Web Service in the Java EE Tutorial 2

August 29, 2008

I stuck on the simplest web service client example. It does not run due to stub service object is not instantiated that is defined by @WebServiceRef. I did not code anything, but I just followed the instruction. There is no compilation error, but it does not run from Netbean IDE as well as the command line. I wonder what’s wrong with this?

 

前回の続きで、さらに問題に出会う。クライアントのプログラムが動かない。理由は、Stub サービスのオブジェクトが作られていない。それは、@WebServiceRefで指定されている。このプログラムは自分が作ったのではなく、ただ、説明に従っただけ。コンパイラーのエラーもない。NetbeanIDEからもそして、コマンドラインからも動かない。どうなっているのか?