cancel
Showing results for 
Search instead for 
Did you mean: 

Help with solution for receiver axis soap multipart

inigo_sacramento
Participant
0 Kudos

Hi everybody.

I've read many questions made by people to this forum with no possitive results to my issue.

I'm developing a simple scenario : RFC>XI>Webservice in a sync way. I call a FM in an R3

backend and i must retrieve a string from the webservice.

First thing i've noticed is that the webservice only works if i set the external definition of it

in RPC mode. If not, i get the error 'method retrieveData' not found.

Second thing is that conventional SOAP receiver adapter doesn't work. I must use AXIS option.

So, i must use RPC mode with AXIS receiver.

No i've met another problem. When i check sxi_monitor, i have my FM response empty. This is because

i'm not retrieving the same message that is defined in the webservice. I retrieve a multipart

message with 3 parts : document-0, document-1 and document-2. I think that response message

mapping is not working because as document-0 comes a different structure that the one defined

in message mapping.

These are the the things i've tried :

Use of Payloadwapbean in receiver soap axis adapter. I can't put as document-0 the one that has the field i need.

I tried with ABAP-Mapping but when i try to find the field <name>, is not there.

Now, i'm thinking in other two solutions. first, develop a module to enhace the SOAP axis receiver.

First question about this .. will i have the 3 'attachments' so i can get the <name> field?

Can i use AXIS handlers to get the complete payload (i've read abput it but i don`t understand

how to do it)?.

Kind regards,

Inigo

Accepted Solutions (1)

Accepted Solutions (1)

sunil_singh13
Active Contributor
0 Kudos

Hi Inigo,

You can achive this in AXIS adapter only

Your XI payload must be created as a SOAP Body element or a SOAP Envelope

element with multiple Body child elements. In this case, the payload

extraction mode at the receiver adapter can be set accordingly to transmit

the SOAP message with multiple Body child elements.

Just verify your payload and select the appropriate parameter in the

adapter. It should work.

Payload Extraction options:

This parameter determines how the payloads of the SOAP message and the XI

message (SOAP with Attachments) are associated. The available options are:

SOAP BodyChild

The SOAP Body child element is associated with the XI application payload.

SOAP Body

The SOAP Body element is associated with the XI application payload.

SOAP Envelope

The SOAP Envelope element is associated with the XI application payload.

Attachments

The first attachment of the SOAP message is associated with the XI

application payload.

The request message that arrives at the sender adapter is the SOAP message.

This message is passed to the XI30InboundHandler handler to be converted

into the XI message. The above setting allows several options in extracting

the part of the SOAP message to be used as the XI payload. The selected

setting is valid for both the request and response chains. However, this

can be overwritten by setting handler parameter payload for the

corresponding XI30InboundHandler handler to bodyChild, body, envelope, or

attachment, respectively.

The treatment of additional attachments depends on the setting of the

Keep-Attachments parameter

After doing this your response payload will be changed. So you have to take the Response payload in the moni and with the help of ALTOVA (or any other if u know) generate the new structure and give it in the response Message of Webservice interface.

Well if you still want to go for Module then just refer

https://www.sdn.sap.com/irj/scn/wiki?path=/pages/viewpage.action&pageid=64389779

in this code below part takes care of all the attchment it is generic code.

try {

Iterator itr = mes.getAttachmentIterator();

//to iterate through all the attached messages.

Payload pay = null;

int i = xmlText.indexOf("<Content>");

while(itr.hasNext())

{ pay = (Payload) itr.next(); Audit.addAuditLogEntry(amk,AuditLogStatus.SUCCESS, "Payload Description}

}

Thanks

Sunil Singh

Answers (1)

Answers (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

I honestly don't know why swapbean does not work in your case

(I believe you might have configured it in a wrong way) but

>Now, i'm thinking in other two solutions. first, develop a module to enhace the SOAP axis receiver.First question about this .. will i have the 3 'attachments' so i can get the <name> field?

if you have a standard XI message you can easily get

any attachment you need - getattachment method:

http://help.sap.com/javadocs/pi/SP3/xpi/com/sap/engine/interfaces/messaging/api/Message.html

but you don't need axis handlers you can do it using standard adapter modules

if you just use axis to transform SOAP call into an XI message with the use of AF_Adapters/axis/AFAdapterBean module (but this is why axis was designed for)

Regards,

Michal Krawczyk

inigo_sacramento
Participant
0 Kudos

Hi again,

This is what i get in SXI_MONITOR.

In payloads, i have 3 :

document-0

document-1

document-2

Double clicking in document-0, i get :

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

- <ns1:ZF_ARQ_DOCUMENTUM_WEBS.Response xmlns:ns1="urn:sap-com:document:sap:rfc:functions">

- <DATOS>

<item />

</DATOS>

</ns1:ZF_ARQ_DOCUMENTUM_WEBS.Response>

This is the answer of the message mapping, but is empty.

Double clicking in document-1 i get :

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

- <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:RetRecuperar" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://model.servicio.procop.sgce.aragon.es" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<datos xsi:type="xsd:base64Binary">SUkqANQAAABX</datos>

<retorno href="#id1" />

</multiRef>

Here is the field i need, 'datos'.

Finally, in document-2 i get :

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

- <multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:Retorno" xmlns:ns3="http://model.servicio.procop.sgce.aragon.es" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<errorMessage xsi:type="xsd:string" />

<excepcion xsi:type="xsd:string" />

<retCode xsi:type="xsd:string">OK</retCode>

<errorCode xsi:type="xsd:string" />

</multiRef>

If i use a test program, such as SOAPUI, i get this answer :

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soapenv:Body>

<ns1:recuperarResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:MiNameSpacePrueba">

<recuperarReturn href="#id0"/>

</ns1:recuperarResponse>

<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:RetRecuperar" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://model.servicio.procop.sgce.aragon.es">

<datos xsi:type="xsd:base64Binary">SUkqANQAAABX</datos>

<retorno href="#id1"/>

</multiRef>

<multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:Retorno" xmlns:ns3="http://model.servicio.procop.sgce.aragon.es" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">

<errorMessage xsi:type="xsd:string"/>

<excepcion xsi:type="xsd:string"/>

<retCode xsi:type="xsd:string">OK</retCode>

<errorCode xsi:type="xsd:string"/>

</multiRef>

</soapenv:Body>

</soapenv:Envelope>

I don't know why i'm getting these 3 documents because in message mapping, the response method of the WSDL is completely different than the message i'm retrieving as the answer.

Thank you for your answers,

Kind regards,

Inigo.