aspose file tools*
The moose likes Web Services and the fly likes Issue with -Xauthfile execution in wsimport tool(JAX-RI) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Issue with -Xauthfile execution in wsimport tool(JAX-RI)" Watch "Issue with -Xauthfile execution in wsimport tool(JAX-RI)" New topic
Author

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

Niranjana Sr
Greenhorn

Joined: Nov 16, 2011
Posts: 1
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

Joined: Oct 04, 2006
Posts: 2198
    
    1
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!


My free books and tutorials: http://www.slideshare.net/krizsan
 
 
subject: Issue with -Xauthfile execution in wsimport tool(JAX-RI)
 
Similar Threads
Trouble generating web service client
Need help connecting to WSDL for first time
Ant & wsimport
Generating and using client code from wsdl file with wsimport
need help to consume webservice in Java