Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

web services - useOriginalwsdl=true is not working in axis2

I have followed contract first approach. So I first wrote the wsdl file and then generated the server side code. But when I hit the url for my web service in the browser then I see the auto generated wsdl file; not the one I had kept inside META-INF folder. I have also set useOriginalwsdl=true in my services.xml file. When I try to view the wsdl in browser, it fires error Unable to generate WSDL 1.1 for this service in description section and If you wish Axis2 to automatically generate the WSDL 1.1, then please set useOriginalwsdl as false in your services.xml in the reason section of error tag.

Please help me.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

useOriginalwsdl=true will work if you have followed the following steps:

  1. put the custom wsdl file inside the META-INF folder.
  2. the service name should be the same in both the custom wsdl as well as in the services.xml
  3. Name the custome wsdl as service.wsdl or (Your ServiceName).wsdl.
  4. Set useOriginalwsdl=true in services.xml file

Note: If useOriginalwsdl=true, Axis2 engine first tries to use any wsdl file named service.wsdl. If not found, then it tries to find named (your service name).wsdl If not succeeds, then it shows error when u try to access the web service.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...