on 07-07-2008 3:54 PM
I am in the middle of doing a webservice call from within a UDF.
The problem is that when I am declaring my message part of the definition is a url. So I am trying to declare a string like the following:
String m = "<?xml version="1.0" encoding="UTF-8"?><msgType xmlns:ns0=http://www.webservice.com ......
Now my problem is with the
xmlns:ns0=http://www.webservice.com
// is a comment in java so everything after this is being seen as a comment how do I solve this issue?
I had the same issue with "
"<?xml version="1.0" encoding="UTF-8"?>
but I solved it using \ like the following:
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>
The problem is this is working for the //
hey alex,
I just tried this
String m = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> < msgType xmlns:ns0=http://www.webservice.com> ";
and it works and gives no errors,
You do not have to bother about //,
the default escape char is \ and this is ok for "
Hope this helps.
Reward points if useful
Regards
Abhishek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks guys that is correct apparently it doesn't matter to have // defined within a string.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi it is helpful but not exactly what I want.
the url is in the payload... yes I have a comm channel with the relevant information but unfortunately what I am refering to is not the address of the service but rather the request message definition
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alex,
I had a scenario like this in the past.
In most cases you call Services for Lookups.
In such a Case use the
Com.sap.aii.mapping.lookup.api and use the accessor and the lookup services for the same.
In such a case the Communication Channel can store the web addresses and XML,
you just need to
1. Create a Channel object based on the channel
2. Derive a accessor out of it
3. Use the accessor to Bulid your payload
4. parse your payload.
[https://help.sap.com/javadocs/pi/SP3/xpi/index.html]
let me know if this was helpful and do reward points
regards,
Abhishek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
the last line is meant to read NOT working
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.