cancel
Showing results for 
Search instead for 
Did you mean: 

Consume j2ee webservice from abap

Former Member
0 Kudos

i created a simple webservice and deployed to the j2ee engine. I can test it successfully here:

http://<ServerName>:<Port>/wsnavigator/enterwsdl.html

I then created an abap proxy class from the WSDL. I create a test abap program like this...


REPORT  ztest_umewebservice.

DATA: lo_clientproxy TYPE REF TO zumeco_cg_ume_wsvi_document,
      lo_sys_exception   TYPE REF TO cx_ai_system_fault,

      ls_request_addgroup TYPE  zumeadd_group_in_doc,
      ls_response_addgroup TYPE  zumeadd_group_out_doc,

      ls_request_addrole TYPE  zumeadd_role_in_doc,
      ls_response_addrole TYPE  zumeadd_role_out_doc,

      exception_msg TYPE string.


TRY.
    CREATE OBJECT lo_clientproxy
      EXPORTING
        logical_port_name = 'UME_PORT'.
  CATCH cx_ai_system_fault INTO lo_sys_exception.
    exception_msg = lo_sys_exception->get_text( ).
    WRITE exception_msg.
ENDTRY.

TRY.
    ls_request_addgroup-userid = 'USERID'.
    ls_request_addgroup-group = 'GROUPNAME'.

    CALL METHOD lo_clientproxy->add_group
      EXPORTING
        input  = ls_request_addgroup
      IMPORTING
        output = ls_response_addgroup.

    WRITE ls_response_addgroup-response.


  CATCH cx_ai_system_fault INTO lo_sys_exception.
    exception_msg = lo_sys_exception->get_text( ).
    WRITE exception_msg.
  CATCH cx_ai_application_fault .

ENDTRY.

I always get this error:


SOAP:1,007 SRT: Unsupported xstream found: ("HTTP Code 400  : Bad Request")

Edited by: K Ferguson on Jul 6, 2009 11:48 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

1) Check wether this could be due to missing authorizations of the RFC-user (type 'Communication') calling the webservice. The RFC-user itsself may be assigned before to the webservice in the http-service tree (transaction SICF). RFC-User needs (at least) the role SAP_BC_WEBSERVICE

2) Also can you check the following

3) This could be also due to incorrect path definition in the RFC destination.

Thanks,

Sridhar

Answers (2)

Answers (2)

Former Member
0 Kudos

With SOAMANAGER I had to modify the URL access path (transport settings tab) and add the style at the end (i.e : ?wsdl&mode=sap_wsdl&style=document).

Former Member
0 Kudos

Hi:

The link given by Mantri works!

Thank you!

Edited by: Wayne Lou on Aug 11, 2009 8:16 AM

Former Member
0 Kudos

i dont think its an auth issue because i tried it with my userid that has SAP-ALL. but then again, my id is a Dialogue user....

Also can you tell me what you mean by:

"3) This could be also due to incorrect path definition in the RFC destination."

I created the logical port using tcode, SOAMANAGER, (which launches an abap web dynpro application). I entered the WSDL and a username and password....after saving an RFC destination automatically is created...

Not sure how an incorrect path definition can happen?