Skip to Content
avatar image
Former Member

Consume j2ee webservice from abap

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Jul 06, 2009 at 10:31 PM

    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

    error-when-consuming-service-in-abap

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

    Thanks,

    Sridhar

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 07, 2009 at 11:30 PM

    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?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 08, 2009 at 02:41 PM

    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).

    Add comment
    10|10000 characters needed characters exceeded