on 03-28-2014 7:48 AM
HI ,
I have a scenario in my project from SAP to Web service. Currently an IDoc is being trigerred from SAP. The Web service has three services: Add_Id, Get_Id and Inactive_Id. There are two operations to be performed. One Add_Id and the other Inactive_Id.
Based on 4 fields of IDoc either Add_Id or Inactive_Id will be trigerred. If it is Add_id it is fine as it is asynchronous.
But if it Inactive_id, first Get_Id will be called and it is synchronous. This is because for one unique Id at SAP has different unique Id at Web service. A request message Get_Request_id will go from SAP to Web service to fetch id from Web service and get a response back as a Get_Response_Id message. Then the Id received in response will be added to Inactive_Id and send asynchronously to Webservice.
Can anyone please suggest how to develop this scenario.If I use BPM , how to proceed with the condition check and triggering of the messages Add_Id(asynchronous) . Get_Id(synchronous0 and Inactive_Id(asynchronous).
Please suggest.
Regards,
Suman
Hi Suman,
I'm assuming that the Id is already in the idoc right? If yes, this can be achieved without BPM. You just need one inbound service interface with two operations: Add_Id and Inactive_Id
1st part: Add_Id
- Normal idoc to webservice scenario (async -> async)
2nd part: Inactive_Id
- Normal idoc to webservice scenario (async -> async) except in this case you would need to do a lookup (could be soap lookup) in the message mapping to retrieve the Id from the webservice
Use enhanced interface determination in ESR by using multi-mapping for the two target messages (0..1)
ID:
Only one receiver determination is needed
Only one interface determination is needed
Two receiver agreements
Hope this helps,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I coded the UDF and I am getting the below error. Could anyone please suggest me?
Compilation of XXXX successful
Hi Suman,
The error seems to be in the response. Check the request in communication channel monitoring and try later the same request with SOAPui, with this you can check if the request is right and if you are getting an error. May be, you are getting a error page response and this raises the exception that you are seeing.
Regards.
Hi Suman,
Did you construct the SOAP request xml? I guess you are directly passing the input parameters in udf.
To construct the xml follow this in udf
String SOAPxml =
"<yq1:SOAPrequestname xmlns:yq1=\"namespace of your SOAP Request\"><input1>"
+ input1
+ "</input1><input2>"
+ input2
+ "</input2></yq1:SOAPrequestname>";
Thanks,
Prudhvi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suman,
Check this line in your code.
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><ns0:SendDataToStorage xmlns:ns0=\"http://xyz/ABC\">
Please use this code for SOAPxml and make sure your input parameters to the udf are a,b,c,d
String SOAPxml =
"<ns0:Get_Organizations_Request xmlns:ns0="urn:com.workday/bsvc"><Include_Roles_Data>"
+ a
+"</Include_Roles_Data><Include_Hierarchy_Data>"
+ b
+"</Include_Hierarchy_Data><Include_Supervisory_Data>"
+ c
+"</Include_Supervisory_Data><Include_Staffing_Restrictions_Data>"
+d
+"<Include_Staffing_Restrictions_Data></ns0:Get_Organisations_Request>";
Thanks,
Prudhvi
Edited the xml as per Indrajit.
Hi Suman
Create a external definition from the WSDL of the web service. Then once you created the external definition, you will see all the three service.
Then create one dummy message map and select the Get_Id request as the source message type.
Then click on test tab and see the xml source.
This will give you the xml format of the request message. Then you need to generate the same in UDF.
The structure you provided has the soap envelope in it. The UDF code provided by Prudhvi is only applicable when we are adding the soap envelope manually.
But normally we do not add soap envelope , the soap adapter take care of that.
For your understanding see the example below
Request with soap envelope
Request message in PI
xml:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:SendSMSToIndia xmlns:ns0="http://www.webserviceX.NET">
<ns0:MobileNumber>34353454354</ns0:MobileNumber>
<ns0:FromEmailAddress>test</ns0:FromEmailAddress>
<ns0:Message>Test Message</ns0:Message>
In your case you need to populate this kind of xml in UDF.
</ns0:SendSMSToIndia>
Hi Indrajit,
Please find the code I am using. The response of Webservice is already attached in earlier replies. The code is not giving the desired value.It gives null sometimes.
Please note I have used a string variable "a", for Id in the code passed as parameter in the UDF.
If I use WID = node.getNodeValue(); it returns nothing. Instead if i use WID = node.getNodeName(); it return the correct node "wd ID". This happens when the entire string is hardcoded without using the string variable "a".
If use the string variable "a", even WID = node.getNodeName(); does not work.
Can you please help.
Regards,
Suman
Hi Suman
You have to change the code for parsing the response message as well.
Your soap response will come to PI without soap envelope and hence the structure will not have
any field like 'wd:Organization_Reference'
Please check the response message you are getting in PI after calling the web-service with your
input xml.
User | Count |
---|---|
83 | |
11 | |
10 | |
8 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.