Web service implementaion help [message #535457] |
Wed, 14 December 2011 03:46 |
|
balckbandit5
Messages: 104 Registered: December 2011
|
Senior Member |
|
|
Hello
Ok, basically I need to implement a web service, and I have no idea what i'm doing...
The guy i'm working with has already started it (just quickly last night) and today he has asked me to continue where he left off. So he's written the following SOAP Envelope:<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hr="http://hr.services.phmdr.merckserono.com/">
<soapenv:Header/>
<soapenv:Body>
<hr:findAllCostCenters>
<searchOptions>
<orderDirection>asc</orderDirection>
</searchOptions>
</hr:findAllCostCenters>
</soapenv:Body>
</soapenv:Envelope>
Which when tested returned a veeery long file which I will select only the beginning of:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:findAllCostCentersResponse xmlns:ns2="http://hr.services.phmdr.merckserono.com/">
<costCenter>
<costCenterCode>146972</costCenterCode>
</costCenter>
and then there are a bunch more <costCenter> tags, which I assume you don't want/need to see.
Ok, so then he has written the following SQL query to extract the data from the XML file:
select extractValue(value(t),'//findAllCostCentersResponse/costCenter/costCenterCode','') "costCenterCode"
, extractValue(value(t),'//findAllCostCentersResponse/costCenter/costCenterDescription','') "costCenterDescription"
from wwv_flow_collections c,
table(xmlsequence(extract(c.xmltype001,'//findAllCostCentersResponse','xmlns="http://hr.services.phmdr.merckserono.com/"'))) t
where c.collection_name = 'WSCOSTCENTERS_RESULTS'
Now he says this isn't working, and has asked me to try and sort it out (not the best idea he's ever had but oh well).
So is there anything that is obviously wrong with this SQL that is obviously the problem?
I looked at the 'Implementing a Web Service' section in the Application Express help and there are various sections for creating web services and other things but i'm not sure which section is relevant to me so if what I need is in there could you point me in the right direction...
Any suggestions/ideas/help with the SQL or what I need to do much appreciated
thanks
UPDATE: I've tried making a "report from web service" but I don't know what the Result Node Path (Xpath) is...it says its a child of the soap:body element but I don't see it...
UPDATE2: I've been looking at the result and i've noticed something; it doesn't seem to finish properly... the end is:<costCenter>
<costCenterCode>
EC10200401
</costCenterCode>
</costCenter>
<costCenter>
<costCent which seems a little odd...
UPDATE:upon further investigating, turns out that was just internet explorer. But the last tag is actually empty, could that affect it?
[Updated on: Wed, 14 December 2011 06:21] Report message to a moderator
|
|
|
Re: Web service implementaion help [message #535509 is a reply to message #535457] |
Wed, 14 December 2011 07:11 |
|
balckbandit5
Messages: 104 Registered: December 2011
|
Senior Member |
|
|
I'm coming to the conlusion its just the SQL thats not right...having been looking at the help 3:30 hours. But I can't see anything wrong with it I don't think.
Its strange, It doesn't seem to be returning no results beecause it doesn't display the "no results found" message. It seems to just have one result which is null on both columns...
[Updated on: Wed, 14 December 2011 07:18] Report message to a moderator
|
|
|
|