Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Issue with -Xauthfile execution in wsimport tool(JAX-RI)

 
Niranjana Sr
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello developers,

I am facing one issue while trying to execute wsimport tool.

command is

wsimport -Xendorsed -keep -Xauthfile authFile.txt -httpproxy:server1-05.ad.com:8080 -p com.xerox.open -s D:\generated -d D:\generated http://server1-05.ad.com/metrojunction1/test/AddNumbersService?wsdl

and I have provided following values in authFile.txt
http://igor:igor1234@server1-05.ad.infosys.com//metrojunction1/test/AddNumbersService

Error message as folows.

[ERROR] Server returned HTTP response code: 401 for URL: http://server1-05.ad.com/metrojunction1/test/AddNumbersService?wsdl, "http://server1-05.ad.com/metrojunction1/test/AddNumbersService?wsdl" needs authorization, please provide authorization file with read access at C:\Documents and Settings\niranjan\.metro\auth or use -Xauthfile to give the authorization file and on each line provide authorization information using this format : http[s]://user:password@host:port//<url-path>

Searched a lot in internet but of no help.
if anyone has already faced similar issue, and if fix be posted here will be very helpful.

thanks,
Niranjan
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
My guess is that the web.xml deployment descriptor of the web service is not properly configured.
One should specify POST in the <http-method> element, as in the example below, not GET.
If you specify POST, then only requests sent to the service will require login and password. Requests for the WSDL, that use GET, will not require authentication.

Fragment from a web.xml deployment descriptor in which the security constraints for a web service has been specified:

Best wishes!
 
Vijay Vishwa
Ranch Hand
Posts: 38
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I also faced similar issue while generating webservice client code with authorization.
I was searching on the web for resolution but could't get any concrete answer

After doing various RnD I was able to resolve the issue, so thought of putting resolution over here so that other people can find the solution.

Although error message gives the format as



1. avoid "//" after port
2. include full wsdl url in the auth file

in my auth file I had following entry



and generated code with the command



It worked and generated code.


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic