on 07-14-2015 2:03 PM
Hi,
We are trying to create OData services using SOAP based WSDL and deploy to SMP server.
We have SMP 3.0 SP07 with PL03 patch with Kepler SR2.
We have soap based service which has header level authentication and apart from that we have backend level authentication to fetch the data from backend.
We have created few sample Odata services to confirm that SMP server is working fine and able to deploy OData services.
Now in this case we have different kind of payload which has two authentication: Header level service authentication and backend level authentication.
Attached are the request payload and response payload from SOAPUI tool.
Since this is complex services we are not able to do request and response mapping directly from design time from Kepler, we will have to go for custom query and here we required valuable inputs
Kindly help us Please.
Hi,
Actually as per this scenario as you have header level authorization which can be injected in the odata call directly and also the other body level auth data also should be passed in the header in the oData request itself and in the custom script assign it separately to Header and Body and try to generate the whole request XML as similar as in SOAP UI with injecting the namespace as well from the script. What said is correct, coming to your scenario you can have separate field names at header level for that request and w.r.t that name access that in the custom script and then try to create the request XML similar as you have is SOAP UI.
Hope this helps.
Regards,
Fenil.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bjoern,
We have services from Oracle and those are mapped again using SOA which is another mapping tool of Oracle.
In general we have two authentications:
1. SOA (authentication for SOA SOAP URL)
2. Authentication for Oracle system which will fetch the data according to user logged in to the application.
I have attached the SOAP UI request and response.
Kindly help us please.
If possible, i will share my screen?
This shouldn't be a problem.What you can do, in the OData request that you send against the IGW, you include four header attributes:
username1: un1
password1: pw1
username2: un2
password2: pw2
Then in the custom scripting you extract these attributes from the OData call, and then you create the hashmaps for the outgoing SOAP request:
The first username/password combination goes in the header, the second username/password combination goes in the body of the outgoing SOAP request.
How this can be achieved you can find in the blog I posed above:
Kind regards
Björn
Bjoern,
We tried below code:
function processRequestData(message) {
importPackage(java.util);
importPackage(org.apache.olingo.odata2.api.processor);
importPackage(com.sap.gateway.ip.core.customdev.logging);
var context = message.getHeaders().get("odatacontext");
var username_s = context.getRequestHeaders().get("username_s").get(0);
var password_s = context.getRequestHeaders().get("password_s").get(0);
childMap = new LinkedHashMap();
childMap.put("username_s", username_s);
childMap.put("password_s", password_s);
message.setHeader(childMap);
var InterfaceID = context.getRequestHeaders().get("InterfaceID").get(0);
var username_b= context.getRequestHeaders().get("username_b").get(0);
var password_b = context.getRequestHeaders().get("password_b").get(0);
childMap1 = new LinkedHashMap();
childMap1.put("InterfaceID ", InterfaceID);
childMap1.put("username_b", username_b);
childMap1.put("password_b", password_b);
message.setBody(childMap1);
return message;
}
But no luck yet.
Hi Reshma,
looking at your SOAP query screenshot, the header fields need to be called Username and Password, not username_s and password_s.
The fields in your body need to be called UserName and Password, not username_b and password_b.
If you are continuing to face issues, please look into debugging your custom code:
Regards
Björn
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.