Highlighted
Absent Member.
Absent Member.
354 views

RTSM Web Service API using c#

Hi,

I want to access Nodes managed by OMi thu web service using c#. 

created web referance using wsdl"http://localhost:8080/axis2/services/UcmdbService?wsdl"

HPOMiUcmdbService.UcmdbService UcmdbService = new HPOMiUcmdbService.UcmdbService();

...

HPOMiUcmdbService.getCIsByTypeResponse res = UcmdbService.getCIsByType(type);

above code returned 401:unauthorized error. 

update username & password using std method in c#

UsernameToken userToken = new UsernameToken("admin", "<PASSWORD>", PasswordOption.SendNone);
HPOMiUcmdbService.UcmdbService UcmdbService = new HPOMiUcmdbService.UcmdbService();
SoapContext requestContext = UcmdbService.RequestSoapContext;
requestContext.Security.Tokens.Add(userToken);

still same issue.

do I need to add any token to security header?

0 Likes
1 Reply
Highlighted
Frequent Contributor.
Frequent Contributor.

Re: RTSM Web Service API using c#

Hello, 

If you're getting http 401:unauthorized error, that means the autentication is required at transport(HTTP) level.  not Application(Messaging) level.  If it's Application level autentication, you should get SOAP FAULT.

May I know which protocol are you using? Anyway, you need to setup http autentication,  for example, web_set_user in C script.

Regards,

Bingle(LoadRunner R&D)

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.