cancel
Showing results for 
Search instead for 
Did you mean: 

Consuming a webservice in WebDynpro

Former Member
0 Kudos

Hi,

In my webDynpro Application I was trying to comsume this webservice.

http://PWDF2696.wdf.sap.corp:50076/sap/bc/srt/xip/sap/EmployeeAbsenceList_WSD?sap-client=800

When I try to run the application I get the following error.

Service call exception; nested exception is: java.lang.Exception: Call to returned http code 500 with unacceptable content type (text/html; charset=iso-8859-1). <HTML> <HEAD> <TITLE>Unknown Host</TITLE> </HEAD> <BODY BGCOLOR="white" FGCOLOR="black"> <H1>Unknown Host</H1> <HR> <FONT FACE="Helvetica,Arial"><B> Description: Unable to locate the server named "<EM>PWDF2696.wdf.sap.corp</EM>" --- the server does not have a DNS entry. Perhaps there is a misspelling in the server name, or the server no longer exists. Double-check the name and try again. </B></FONT> <HR> </BODY>

Is this a authentication error. How do I handle do I gain the access... I mean where do I need to pass the username and password.

Thanks a lot,

Tarun.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Tarun,

Have you made entry in "HOSTS" file for your hostname "PWDF2696.wdf.sap.corp"?

Its required to make entry for hostname resolution.

Make following entry in "HOSTS" file located at <drive>:\windows\system32\drivers\etc\

PWDF2696.wdf.sap.corp <IPaddress>

Regards,

Bhavik

tkhiani
Employee
Employee
0 Kudos

Thanks so much for that.

Althoug I have one more issue now.

Service call exception; nested exception is: com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (401) Unauthorized.

This is the execption that I have received now. Could I know how to provide the user name password...???

tkhiani
Employee
Employee
0 Kudos

Hi Bhavik Devisha,

Thanks a lot for that. Although now I have another error... this is regarding the authentication.

Could you let me know how to provide the user name password or where can I find documentation of how authentication is done?

Could I have your contact details?

Regards,

Tarun.

Former Member
0 Kudos

Hi Tarun,

Write following code before executing your web service model.

wdcontext.current<node>element().modelobject()._serUser("<user name>");

wdcontext.current<node>element().modelobject()._serPassword("<Password>");

Regards,

Bhavik

tkhiani
Employee
Employee
0 Kudos

Hi Bhavik,

Well dont you see a problem with this approach.

If this is a product then the username password should be configured by a properties file or some other way right.

Do you have other information?

Thanks & Regards,

Tarun.

Former Member
0 Kudos

Hi Tarun,

You can also write properties file and read User info from this properties file and pass that string here.

Other option for this is to create HTTP destination from Visual administrator and then specify this HTTP destination in your code. So, your user information lies on server not in your code.

Regards,

Bhavik

Former Member
0 Kudos

Hi Tarun,

Have you resolved your problem?

If yes then please close this thread.

And don't forget to award points if it was helpful.

Regards,

Bhavik

Former Member
0 Kudos

Hi Friends,

I was trying the same code but i am constantly getting this error even after putting username and password dynamically.

Error : Service call exception; nested exception is: com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (407) Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy service is denied. ).

Could someone help me on this ?

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Tarun,

"500 with unacceptable content type " !!!

I think your webservice is not returning XML format whereas it is returning of type HTML.Please verify the webservice once again.

Regards, Anilkumar

Message was edited by: Anilkumar Vippagunta