cancel
Showing results for 
Search instead for 
Did you mean: 

sender proxy to webservice synchronous communication

Former Member
0 Kudos

Hi all,

I have a scenario where sender is a proxy communication synchronously with webservice. Just for testing purpose i just need to ping the webservice and get reponse back.

Hence for this I mapped the constant for request because no data need to send to webservice and responce will be a string and accordingly created it.

I created two synchronous interface for both inbound and outbound and generate the proxy also.

i tried to execute this scenario by create the report as below code

<b>DATA : prxy TYPE REF TO zsynctstoutco_miproxy_syn,

it_req TYPE zsynctstoutdtreq_request,

it_res TYPE zsynctstoutdtres_response.

CREATE OBJECT prxy.

TRY.

CALL METHOD prxy->EXECUTE_SYNCHRONOUS

IMPORTING

input = it_res

EXPORTING

output = it_REQ .

CATCH cx_ai_system_fault .

DATA fault TYPE REF TO cx_ai_system_fault .

CREATE OBJECT fault.

WRITE 😕 fault->errortext.

ENDTRY.

COMMIT WORK.

WRITE : 'tested'.</b>

when I try to compile this I got the error as <b>"OUTPUT" is not expected.</b>.

please let me know where I went wrong...I hope i am in the right track for this scenario.

Regards,

Dhill

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

Ref this links

/people/kamaljeet.kharbanda/blog/2005/09/16/xi-bi-integration

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/18dfe590-0201-0010-6b8b-d21...

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9f2ad490-0201-0010-a1bd-81d...

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/0ccae190-0201-0010-1593-c90...

Check with this code

REPORT zaaj_out_proxy_tata.

DATA: obj TYPE REF TO zco_mioa_tata,

szdt_tata TYPE zdt_tata,

szmt_tata TYPE zmt_tata,

szdt_tata_employee TYPE zdt_tata_employee,

szdt_tata_employee_tab TYPE zdt_tata_employee_tab.

DATA: itab TYPE STANDARD TABLE OF zcnu_proxy_table,

wa LIKE LINE OF itab.

SELECT name city FROM zcnu_proxy_table INTO (wa-NAME,WA-CITY).

  • APPEND wa TO itab.

szdt_tata_employee-name = wa-name.

szdt_tata_employee-city = wa-city.

APPEND szdt_tata_employee TO szdt_tata_employee_tab.

szdt_tata-employee = szdt_tata_employee_tab.

szmt_tata-mt_tata = szdt_tata.

ENDSELECT.

TRY.

CREATE OBJECT obj.

CALL METHOD obj->execute_asynchronous

EXPORTING

output = szmt_tata.

COMMIT WORK.

CATCH cx_ai_system_fault.

ENDTRY.

Former Member
0 Kudos

Hi Sridhar,

Thanks, Actually I need to know the responce back from webservice and below code is not having import parameter.

Anybody let me know an example of synchronous communication from proxy to webservice.

sender strucuture(wsdl) of webservice will not have any field and receive strcuture(wsdl) will have only field of string type.

Regards,

Dhill

Former Member
0 Kudos

Hi All,

I made one mistake by giving structure type instead of table type. Now I am able to execute the scenario but I am getting the responce back and in SXMB_MONI I received the error as below

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

- <!-- Request Message Mapping

-->

- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">

<SAP:Category>Application</SAP:Category>

<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>

<SAP:P1>com/sap/xi/tf/_MMReq_</SAP:P1>

<SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>

<SAP:P3>RuntimeException in Message-Mapping transformatio~</SAP:P3>

<SAP:P4 />

<SAP:AdditionalText />

<SAP:ApplicationFaultMessage namespace="" />

<SAP:Stack>During the application mapping com/sap/xi/tf/_MMReq_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: RuntimeException in Message-Mapping transformatio~</SAP:Stack>

<SAP:Retry>N</SAP:Retry>

</SAP:Error>

but when I test the interface from SPROXY transaction till is executing successfully as below

Outbound procesing

Payload Before Service

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

- <nr1:MTReq xmlns:nr1="http://test/Proxy/SYN">

- <Request>

<Constant>This is a string 1</Constant>

</Request>

</nr1:MTReq>

<b>Note</b> : Not sure when the system is picking upt the contant as "This is a string 1"

Payload After Service

<?xml version="1.0" encoding="UTF-8" ?>

- <ns1:MTRes xmlns:ns1="http://test/Proxy/SYN">

- <Response>

<String>PING SUCCESS - sk80364!</String>

</Response>

</ns1:MTRes>

I hope there will be no connectivity issue because I can execute from SPROXY transaction but please help me out why this is not executing from report.

the code of the report is

*The below code is Synchoronous communication with webservice.

DATA : prxy TYPE REF TO zsynctstoutco_miproxy_syn,

it_req TYPE zsynctstoutmtreq,

it_res TYPE ZSYNCTSTOUTMTRES.

TRY.

CREATE OBJECT prxy.

CALL METHOD prxy->execute_synchronous

EXPORTING

output = it_req

IMPORTING

input = it_res.

COMMIT WORK.

CATCH cx_ai_system_fault .

DATA fault TYPE REF TO cx_ai_system_fault .

CREATE OBJECT fault.

WRITE 😕 fault->errortext.

ENDTRY.

COMMIT WORK.

Regards,

Dhill

Former Member
0 Kudos

Hi Dhil,

The error message you are getting now is <b>not</b> related to the proxy.

This message means that the message mapping occurring in XI is failing. By the looks of it, the <b>request</b> message mapping is failing.

Open the message in SXMB_MONI and scroll down in the top right-hand side frame until you see what looks like a stack trace. Near the beginning of this stack trace you will find exactly which field is producing the error.

If you are still having problems, please attach the trace from SXMB_MONI.

Former Member
0 Kudos

Hi Yaghya,

thank you, the issue is with only on request mapping that my webservice doesn't look for any values to ping but from SAP I am receiving some string which I mapped. I didn't notice this because you know it will not give any error.

Thank your help and time.

Regards,

Senthil.

Former Member
0 Kudos

Comment this lines...n try..

WRITE 😕 fault->errortext.

WRITE : 'tested'.

Nilesh