cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP with login

EdgarTabar
Participant
0 Kudos

Hi,

before I can use a webservice in a file to SOAP scenario I have to call an other web service where I will get for a request message (database, user, pwd) a response message (session-id). This session-id and the file I need to call the original webservice.

How can I do this?

In the ESR exists:

1) datatype + messagetype + service interface for the file

2) an external definition (wsdl) for the login web service

3) an external definition (wsdl) for the web service (here I need the session-id from the login web service)

4) ???

What kind of service interfaces and mappings I need?

Any help please?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hi,

before I can use a webservice in a file to SOAP scenario I have to call an other web service where I will get for a request message (database, user, pwd) a response message (session-id). This session-id and the file I need to call the original webservice.

How can I do this?

that is very simple, just you can use SOAP LOOKUP in mapping level:

ex.code:

AbstractTrace trace = container.getTrace();

String conversionRate = "";

String SOAPxml ="<ConversionRate xmlns="http://www.webserviceX.NET/"> <FromCurrency>"+ FromCurrency

+ "</FromCurrency><ToCurrency>"+ Tocurrency+ "</ToCurrency></ConversionRate>";

try

{

Channel channel =LookupService.getChannel("BS_Receiver")(<-here you define Bus Comp),"CC_soap_receiver"(<-here you define comm.channel));

SystemAccessor accessor = LookupService.getSystemAccessor(channel);

InputStream inputStream = new ByteArrayInputStream(SOAPxml.getBytes());

XmlPayload payload = LookupService.getXmlPayload(inputStream);

Payload SOAPOutPayload = null;

SOAPOutPayload = accessor.call(payload);

InputStream inp = SOAPOutPayload.getContent();

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

DocumentBuilder builder = factory.newDocumentBuilder();

String str = inp.toString();

trace.addInfo(str);

Document document = builder.parse(inp);

NodeList list = document.getElementsByTagName("ConversionRateResult");

Node node = list.item(0);

if (node != null) {

node = node.getFirstChild();

if (node != null) {

conversionRate = node.getNodeValue();

}

}

}

catch (Exception e) {

trace.addWarning("Error" + e);

}

return conversionRate;

please refer below weblog:

[weblog|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/5001] [original link is broken] [original link is broken] [original link is broken];

thanks,

Edited by: bhavanisankar.solasu on Jan 19, 2012 6:53 AM

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>before I can use a webservice in a file to SOAP scenario I have to call an other web service where I will get for a request message (database, user, pwd) a response message (session-id). This session-id and the file I need to call the original webservice.

How can I do this?

You can do first webservice using SOAP call in the mapping itself, If you get all the values then update those information in the target structure webservice and call the webservice. Since you get just session information in the first webservice, you can handle this lookup in the mapping itself.

Refer this link for webservice call using UDF in the mapping program.

MichalKrawczyk
Active Contributor
0 Kudos

hi,

if you don't want to use a ccBPM my suggestion would be to call the first WS in the adapter module of the second call

and if this goes ok - make the final SOAP call - but it may not be a one day dev

if you want to use ccBPM then you can go with a standard way of two send steps

Regards,

Michal Krawczyk