cancel
Showing results for 
Search instead for 
Did you mean: 

Webservice to Multiple Webservices with responses

sriram_devarapalli
Participant
0 Kudos

Hi Team,

I had a scenario where the data is sent to a WebService as sender and in PI we need to Map it to 2 different WebServices in Sync interface. Both the Webservices has responses. So i cannot use multi Mapping also for this. The client is not ready for ccBPM. The Sender WebService is generated by PI using SR.

Thanks in Advance.

Sriram

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member181985
Active Contributor
0 Kudos

Since on the target side you already have two webservices, wrap these two webservices in a new webservice.

Call this new webservice in sync manner.

- Praveen Gujjeti.

former_member183908
Active Contributor
0 Kudos

Hi Ram,

--> Check this below article it may help you something not exactly as per your requirement.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0b6bb9d-7689-2c10-52a7-c3bd341d4...

Thanks

sriram_devarapalli
Participant
0 Kudos

Hi Pavan,

Can you please give me some Info or Code which you use in UDF to Call Soap Lookup.

Since the PI is 7.1, can we use SOAP Lookup, We had only JDBC or RFC Lookup's only.

Do we need to write any code in UDF for Soap Lookup.

Thanks

Sriram

former_member183908
Active Contributor
0 Kudos

Hi Ram,

--> refer the below blog for the SOAP look up

/people/bhavesh.kantilal/blog/2006/11/20/webservice-calls-from-a-user-defined-function


public String SoapLookUp(String FromCurrency,String ToCurrency,Container container){
//write your code here
 AbstractTrace trace = container.getTrace();
String conversionRate = " ";
try {
	/*Pass the Business System and Communication Channel as  input to the getChannel().
	/*BS_SOAPLOOKUP u2013 Business System*CC_Webservice_SOAP_CURRENCY_CONVERTOR u2013 Receiver SOAP Adapter */ 
	Channel channel =
		LookupService.getChannel(
			"BS_SoapLookUP",
			"CCT_YH1329_SOAPLOOKUP");
	SystemAccessor accessor = LookupService.getSystemAccessor(channel);
	/* Construct the SOAP Request Message using the InputParameters
	FromCurrency , ToCurrency are the Input Parameters.*/
	String SOAPxml =
		"<ConversionRate xmlns=\"http://www.webserviceX.NET/\"> <FromCurrency>"
			+ FromCurrency
			+ "</FromCurrency><ToCurrency>"
			+ ToCurrency
			+ "</ToCurrency></ConversionRate>";
	InputStream inputStream = new ByteArrayInputStream(SOAPxml.getBytes());
	XmlPayload payload = LookupService.getXmlPayload(inputStream);
	Payload SOAPOutPayload = null;
	/*The SOAP call is made here and the response obtained is in the SOAPOutPayload.*/
	SOAPOutPayload = accessor.call(payload);
	/* Parse the SOAPPayload to get the SOAP Response back. 
	 The conversion rate is available under the Field Name ConversionRateResult */
	InputStream inp = SOAPOutPayload.getContent();
	DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
	/* Create DOM structure from input XML */
	DocumentBuilder builder = factory.newDocumentBuilder();
	Document document = builder.parse(inp);
	/* ConversionRate is available in the TAG ConversionRateResult in the Response XML */
	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;

Thanks

Former Member
0 Kudos

Hi,

Is your requirement is to call a webservice ( one of the two) based on the condition from the received data...then you can proceed with this with out BPM...

like put a condition at receiver determination and based on that proceed furhter...but the wsdl should contain the both response messages...as optional..

HTH

Rajesh

sriram_devarapalli
Participant
0 Kudos

Hi Rajesh,

Thanks for the response.

This scenario is to get data from MDM server which is on Oracle. we need to get Data from 2 different Tables. So they are trying to get the Response from both the Tables, for this Scenario only they are palnning to do Webservices, this webservices will send the response from both the Tables from MDM. Can we write a SQL Select Statement on both tables and get the data. Is it possibe with out BPM. We need the Sync approach for this.

Please suggest me.

Thanks & Regards,

Sriram

former_member200962
Active Contributor
0 Kudos

This is possible (without a BPM) only if there is one target web-service (then no matter how many tables you query....on same DB)

Even Rajesh mentioned the same point that you can call one WS at a time

Now in your first post you mentioned that there are two target webservices, hence in this case you have to use a BPM if you want to invoke both these WS.

Your requirement can be achieved if:

1) You have to call only one WS at a given point of time

2) A single WS is created out of the two separate WS, and then you make a sync call

However if you want to call two different WebServices in the same sync call, then it seems not possible without a BPM.

Regards,

Abhishek.

former_member200962
Active Contributor
0 Kudos

As far as I know you have to implement a BPM for such a scenario. We may not be able to collect the response from the two WS and then pass the same to the source without a BPM.