cancel
Showing results for 
Search instead for 
Did you mean: 

consuming a https webservice from 6.20

Former Member
0 Kudos

Hi all,

I am trying to consume a webservice from 6.20 version. I have the WSDL file of the service and I am trying to build a SOAP message out of it.

Then I call the methods in my program to create the client and send the request data.

In the response/receive I am getting a 404 Resource not found, Partnernot reached..

I am unable to troubleshoot this problem. I am unable to find if it is related to the the SOAP message I am building or is it the client creation thats failing?

Interestingly ,IF I use cl_http_cleint create by URL, Iam able to connect to the actual URL of the webservice and could see the data in the response' Hi, there is form to invoke the service'. This is what you see if you go to that url in the browser.

Code:

****************************************************************************

CONCATENATE

'<?xml version="1.0" encoding="utf-8"?>'

'<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'

' xmlns:xsd="http://www.w3.org/2001/XMLSchema"'

' xmlns:soap="http://www.w3.org/2001/12/soap-envelope">'

'<soap:Body>'

'<Authenticator'

' xmlns="https://xxxyyy.com/XXXWebServices/services/authenticator">'

'<authenticate>'

'<userId0>' user '</userId0>'

'<credential>' password '</credential>'

'</authenticate>'

'</Authenticator>'

'</soap:Body>'

'</soap:Envelope>'

INTO wf_string.

CLEAR :rlength , txlen .

rlength = STRLEN( wf_string ) .

MOVE: rlength TO txlen .

CALL METHOD cl_http_client=>create

EXPORTING

host = 'xxx.com/TUFWebServices'

service = '443'

scheme = '2'

ssl_id = 'ABC'

IMPORTING

client = http_client.

CALL METHOD http_client->request->set_header_field

EXPORTING

name = '~request_method'

value = 'GET'.

CALL METHOD http_client->request->set_cdata

EXPORTING

data = wf_string

offset = 0

length = rlength.

CALL METHOD http_client->send

EXCEPTIONS

http_communication_failure = 1

http_invalid_state = 2.

CALL METHOD http_client->receive

EXCEPTIONS

http_communication_failure = 1

http_invalid_state = 2

http_processing_failed = 3.

data fields type tihttpnvp.

CLEAR wf_string1.

wf_string1 = http_client->response->get_cdata( ).

*************************************************************************

If I just use:

  • call method cl_http_client=>create_by_url

  • exporting

  • url =

  • 'https://xxx.com/XXXWebServices/services/authenticator'

  • ssl_id = 'ABC'

  • importing

  • client = http_client

  • exceptions

  • others = 1.

I am able to reach the URL.

Please suggest.

Accepted Solutions (1)

Accepted Solutions (1)

GrahamRobbo
Active Contributor
0 Kudos

Hi KP,

I suggest you grab a tool like XMLSpy from Altavista (free for 30 days) that let's you build a SOAP message from the WSDL and then send the SOAP request. In this way you can test that the whole web service works as documented in the WSDL and then look to see that your SOAP payload looks the same.

I must say that the later the WAS version you use the better. 6.20 was pretty rudimentary around this stuff. I have heard that SAP have completely rewritten the SOAP runtime in WAS 7 and it will be released in a service pack.

You could consider using a standalone WAS 7 as your SOAP handler and call it from your 6.20 backend using RFC?

Cheers

Graham

Former Member
0 Kudos

Hi .

I downloaded the XMLspy and built a SOAP request from the WSDL of the webservice provider. I was able to send the request and get the data back. It worked great.

Then I copied the SOAP request into my program and tried but it still comes up with '404 Resource not found'.

No clue why it is not working from SAP. I am not sure where I am doing wrong.

Is it the way I am building the reques object?

Please suggest.

Thanks

GrahamRobbo
Active Contributor
0 Kudos

Hi KP,

if the create_by_url method works and the create method does not then you could use the debugger to look at the differences in the two request objects.

If create_by_url works why don't you just use it?

Cheers

Graham

Answers (2)

Answers (2)

Former Member
0 Kudos

SOrry, still have a problem.

Former Member
0 Kudos

Thanks a lot Graham for your suggestion.

I am also looking into the option of using NetWeaver which is in our landscape act as the middle layer.

It would be able to call a webservice without any problems and could also connect to the SAP backend 6.20 once set in SLD.

Thanks