cancel
Showing results for 
Search instead for 
Did you mean: 

Consume ABAP HTTPS Webservice in Java

jitendra_it
Active Contributor
0 Kudos

Hi All,

Our Java team is consuming HTTPS webservices which are published by us(SAP ABAP).

But when they call the service , they are getting exception java.net.ConnectException: Connection timed out: connect.

While they are able to consume HTTP Webservice successfully for that they are sending Usename ,Passport and Endpoints.

Below is code which they are using for HTTPS call

ZSL_E010_WS_Service service = new ZSL_E010_WS_ServiceLocator();

   proxy = service.getPort(ZSL_E010_WS_PortType.class);

   ((ZSL_E010_WS_BindingStub) proxy)

     ._setProperty(((ZSL_E010_WS_BindingStub) proxy).USERNAME_PROPERTY,

       sapUser);

   ((ZSL_E010_WS_BindingStub) proxy)._setProperty(

     ((ZSL_E010_WS_BindingStub) proxy).PASSWORD_PROPERTY, sapPassword);

   ((ZSL_E010_WS_BindingStub) proxy)

     ._setProperty(

       ((ZSL_E010_WS_BindingStub) proxy).ENDPOINT_ADDRESS_PROPERTY,

       (String)e010EndPointMap.get("E010"));

Please guide us where we doing wrong.

Many Thanks,

Jitendra

Accepted Solutions (0)

Answers (2)

Answers (2)

vicky_khambhati5
Explorer
0 Kudos

Hi Jitendra,

I need one help from you. We are calling HTTP webservice from the Java which is exposed from SAP.

I am ABAP developer, and with Java guys help I created Webservice classes but they dont know the authentication process. Can you please help me by providing the logic for that?

Thanks in advance.

Regards,

Vicky

jitendra_it
Active Contributor
0 Kudos

Hi Vicky,

Authentication can be achieved in two ways.

1. You can directly save SAP username & password in service itself using tcode SICF.

2. Java will set username and password while calling service. Code for the same is in first post.

Many Thanks,

Jitendra

jitendra_it
Active Contributor
0 Kudos

Dear Experts,

Please suggest.

Many Thanks,

Jitendra