How can I use wsimport to generate a webservice client which wsdl requires authentication?
Asked Answered
I

2

13

I'm trying to generate a webservice client using wsimport, but the wsdl requires authentication.

I'm using a command like this: wsimport https://username:password@url?wsdl

But it doesn't work.

Instar answered 9/6, 2011 at 13:41 Comment(0)
D
13

After running your command you should get a message complaining about a missing web authorization file.

What you need to do is create an authorization file (usually the default name/location for it is $HOME_DIRECTORY/.metro/auth, but check the previous error message, you'll get the hint from there). Inside this file you just write the line: "https://username:password@url?wsdl"

Once the file is created, run the wsimport command again omitting the username/password info, like this:

wsimport https://url?wsdl

Hope it helps.

Daedal answered 20/6, 2011 at 11:17 Comment(1)
It Works !! I however face problem because my Username had an @ so I escaped that by replacing my username [email protected] with asdas%40xx.comRiva
I
4
wsimport -Xauthfile C:\resources\META-INF\auth.conf https://url?wsdl

auth.conf

https://USERNAME:PASWORD@url?wsdl
Illgotten answered 22/8, 2019 at 15:46 Comment(1)
how to escape special characters in the password/username?Larceny

© 2022 - 2024 — McMap. All rights reserved.