cancel
Showing results for 
Search instead for 
Did you mean: 

Web Services

Former Member
0 Kudos

Hi,

We have a situation where we are receiving an Idoc from R/3 into XI. We would now like to send a message to a Web Service with login credentials. The Web Service will send a message back with a login token. This token must then be used in another message back to the Web Service together with the information to be uploaded. Does anyone know whether this is possible in XI?

Thanks,

Miguel

Accepted Solutions (1)

Accepted Solutions (1)

STALANKI
Active Contributor
0 Kudos

It is very much possible and your inbound webservice is synchronous and outbound is async message.You can use a async-sync bridge and collect the token accordingly.It is definetly possible in XI.

former_member184154
Active Contributor
0 Kudos

No need for synch-asynch bridge, as the messintf activating the whole story is asynch (IDoc)...

The IP could be as follows:

1- asynch receive step (IDoc) that triggers the process

2- synch send to ws providing the token

3- transformation, that is a mapping taking both IDoc and token data (response msg used in step 2) as input and request msg for step 4 as output

4- synch send to "real" ws, sending both IDoc data and credentials

If you handle exception carefully you could also have an ack back to R/3 updating the IDoc status (should be done automtically by XI with SYSTAT... not sure)

Cheers,

Alex

Message was edited by: Alessandro Guarneri

Former Member
0 Kudos

Hi Guys,

I have followed your steps Alessandro and have been able to send out the messages. Thank you very much!

My next problem is the following and I'm hoping that you guys could guide me once again:-

I take the IDoc that I receive and map it to an external definition as required by the WebService. This mapped message must now be mapped onto 1 single string field to be sent back to the WebService.

This means that instead of creating an output file, this file needs to be converted into a string and then sent through to the webservice again.

Do you guys know whether I can take a whole mapped message interface and place it into another message interface, but into a single field only?

Thanks!

Miguel

former_member184154
Active Contributor
0 Kudos

Hi Miguel.

let me try to guess: you need to put the whole xml message as a string (probably html-escaped, too)?

I've done it with a Java Mapping, but you can find an xslt on sdn doing the same story.

Check out this one /people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping

Cheers,

Alex

Former Member
0 Kudos

Hi Alex,

Yip, you are correct. This is exactly what I am trying to do!

This will be the first time that I use either a Java Mapping or an XSLT Mapping, so this should be quite some fun.

Thanks for the guidance once again.

Thanks,

Miguel

Former Member
0 Kudos

Hi Alex,

I'm a little stuck at the moment.

Do you think that you could provide my an example of the java mapping that you used?

Could you also confirm whether I am taking the corret approach here:-

I have an Interface Mapping that maps the IDoc to a External Definition.

I also have an Interface Mapping that maps the Web Service Login Response to another External Defintion.

I now need to map the contents of the first External Definition as a string in a field of the second External Defintion. So therefore I have another Interface Mapping that will use the Java Mapping with both ED's above as the input and the second ED as the target.

Thanks very much for your help,

Thanks,

Miguel

former_member184154
Active Contributor
0 Kudos

Mmh, the approach seems to be correct.

If you want me to help you out, prepare a <i>fake</i> message mapping with messages you need (2 source and one target) and send me the source of both (as you can see them in the test tab).

I'll write a couple of lines for you.

Alex

Message was edited by: Alessandro Guarneri

Former Member
0 Kudos

Hi Alex,

Thank very much!!

My first input message is the response with the token:-

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

<p2:LoginResponse xmlns:p2="http://www.test.org/">

<p2:LoginResult>ABCDEFGHIJKLMNOPQRSTUVWXYZ</p2:LoginResult></p2:LoginResponse>

My second input message is the external definition that has been mapped with values from the IDoc:-

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

<p2:POD xmlns:p2="http://www.test.org/Schema.xsd" AccNo="9" OrderNo="972" DelNo="269" CheckDigit=" 5" Date="20060110" TotPages=" 1" NetWeight=" 1981.158"><p2:InvoiceTo Line1="Domestic Customer" Line4="Town" Line5="Province" VATRegNo="TESTING123"></p2:InvoiceTo><p2:DeliverTo Line1="Domestic Customer" Line4="Town" Line5="Province"></p2:DeliverTo><p2:Pages><p2:Page PageNo=" 1"><p2:ItemGroups><p2:ItemGroup Description="Clear"><p2:Items><p2:Item ItemNo="003" NoPacks=" 0.103" NoPieces=" 3.000" SqMetres=" 21.666" CustOrdNo="00000000" Description="Test Material"></p2:Item></p2:Items></p2:ItemGroup></p2:ItemGroups><p2:ItemGroups><p2:ItemGroup Description="Tint"><p2:Items><p2:Item ItemNo="001" NoPacks=" 1.000" NoPieces=" 50.000" SqMetres=" 222.250" CustOrdNo="00000000" Description="SP3"></p2:Item></p2:Items></p2:ItemGroup></p2:ItemGroups></p2:Page></p2:Pages></p2:POD>

It is this xml message that I need to map as a single string for the XML tag inputData of the following target message:-

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

<p3:SubmitInputData xmlns:p3="http://www.test.org/"><p3:token>ABCDEFGHIJKLMNOPQRSTUVWXYZ</p3:token><p3:customKey>269</p3:customKey><p3:inputData></p3:inputData></p3:SubmitInputData>

I have been able to map the other 2 input tags on this target message. It is that final tag that needs that conversion into a string.

Thanks very much again!

Thanks,

Miguel

former_member184154
Active Contributor
0 Kudos

Ok, be patient. I'll have a look tomorrow.

If you don't hear from me, drop me an email as a reminder(my address in my SDN Business Card

Alex

Answers (2)

Answers (2)

STALANKI
Active Contributor
0 Kudos

That is what I meant Asynch-Synch bridge..:)..It is not sync-async bridge.:)

Former Member
0 Kudos

Hi Guys,

Thanks very much for the guidance.

I'm gonna have a look at it and see what can be done.

Thanks again!

Miguel

former_member184154
Active Contributor
0 Kudos

Should be quite easy using BPM (and it is its real job!)

Have a look at the BPM section of the std docu

http://help.sap.com/saphelp_nw04/helpdata/en/3c/831620a4f1044dba38b370f77835cc/content.htm

Let me know if you need specific design help on the Integration Process.

Cheers,

Alex