PL/SQL SOAP - Loop round XML
I've receiving a SOAP document very similar to:
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<env:Body>
<n1:check xmlns:n1="http://www.com">
<n1:standardHeader xmlns:n1="http://www.com" xsi:nil="true" />
<n1:tests xmlns:n1="http://www.com" xsi:type="n1:tests">
<n1:test xmlns:n1="http://www.com">
<n1:outcome xmlns:n1="http://www.com">1</n1:outcome>
</n1:test>
<n1:test xmlns:n1="http://www.com">
<n1:outcome xmlns:n1="http://www.com">2</n1:outcome>
</n1:test>
<n1:test xmlns:n1="http://www.com">
<n1:outcome xmlns:n1="http://www.com">3</n1:outcome>
</n1:test>
</n1:tests>
</n1:check>
</env:Body>
</env:Envelope>
However, using the resp.doc.extract('//n1:tes'/child::text()', 'xmlns:n1="http://www.com">').getstringval(); method I can only get all three values concatenated (e.g. - 123).
How do I loop round and select each one separately?
Thanks,
Adam
I sloved my first question: to get the Nodevalue, I need to use getFirstChild(n);
But, I still didn't figure out the second
problem. Actually, It works when I modified my xml file as following:
<?xml version="1.0"?>
<profile>
<id>1</id>
<name>Company</name>
<des>master profile</desc>
<subprofile><subid>1</subid><subname>group1</subname><subdesc>groupprofile</subdesc></subprofile>
</profile>
All the <subprofile>....</subprofile> must be in one line without any return. This is unbelievable! It suppose that xml does not matter new lines. I tested my code, it seems space is fine, but new line. Something must be wrong in my code.
please give any suggestion. Thanks,
Yudong
null
Similar Messages
-
Calling SOAP Request from XML Spy
I have published PLSQL web service at Oracle 10g AS.
The web service runs at http://localhost:7201/reqProcess with processRequest as method being exposed.
This web service takes the string as input and return XMLTYPE as out parameter.
Now When I am trying to pass SOAP XML from XMLSPY to above url I am getting folloing errors.
1) I get http error: couldnot post the file /reqProcess/ on server 'localhost' (500)
2) I get SOAP Error as
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>No Deserializer found to deserialize a 'http://wsi.nat.zz.com/2005/06/StandardHeader/:m0:standardHeader' using encoding style 'null'. [java.lang.IllegalArgumentException]</faultstring>
<faultactor>/reqProcess</faultactor>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Please help..Hi Quwang ur help needed
My requirement ...
1) PLSQL as web service : I succesffuly deployed PLSQL Procedure as Web service at 10 10g. The PLSQL takes string (CLOB) as input convert that into XML and store in table and return XMLTYPE as output.
When I am accesing PLSQL WS using browser I am able to send string (basically XML format) as a input and able to receive the result back (SOAP envelop)
2)WS Invocation : After PLSQL WS published I need to pass the SOAP XML which is generated from XYX wsdl file to the PLSQL WS published above. For this req I was using XML Spy to test this. (In actual the clinet will be Sieble that will send SOAP XML to PLSQL WS).
Initially I was generating the SOAP XML from XYZ.wsdl and was directly sending that to PLSQL URL. I was getting error as I described initially.
Next I tried to generate the SOAP request from the PLSQL WS wsdl file and inside the parameter I am sending the SOAP XML as string to the IN paramater of PLSQL WS. This time I am getting some different errors. The first error is same as http error: couldnot post the file /balprocess/balprocess/operation?processRequest on server 'localhost' (500)
and second error is SOAP fault as follows
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>java.sql.SQLException: ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00210: expected '<' instead of '"'
Error at line 1
ORA-06512: at "SYS.XMLTYPE", line 0
ORA-06512: at "SCOTT.BAL_A_PROCESS", line 16
ORA-06512: at line 1
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:137)</faultstring>
<faultactor>/balprocess/balprocess</faultactor>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
For ur reference I am pasting the PLSQL WSDL file and the SOAP request xml that I am sending to PLSQL WS URL.
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="bal_a_process"
targetNamespace="http://bal.request.process/bal_a_process.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://bal.request.process/bal_a_process.wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd1="http://bal.request.process/bal_a_process.xsd" >
<documentation>
WSDL for Service: bal_a_process, generated by Oracle WSDL toolkit (version: 1.1)
</documentation>
<types>
<schema targetNamespace="http://bal.request.process/bal_a_process.xsd" xmlns:tns="http://bal.request.process/bal_a_process.xsd" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dom="http://xmlns.oracle.com/2001/XMLSchema/DOM">
<complexType name="bal_request_process_bal_a_processUser_processRequest_Out">
<all>
<element name="outresponsexmlOut" type="dom:org.w3c.dom.DocumentFragment"/>
</all>
</complexType>
</schema>
</types>
<message name="processRequestOutput">
<part name="return" type="xsd1:bal_request_process_bal_a_processUser_processRequest_Out"/>
</message>
<message name="processRequestInput">
<part name="param0" type="xsd:string"/>
</message>
<portType name="bal_a_processPortType">
<operation name="processRequest">
<input message="tns:processRequestInput"/>
<output message="tns:processRequestOutput"/>
</operation>
</portType>
<binding name="bal_a_processBinding" type="tns:bal_a_processPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
<operation name="processRequest">
<soap:operation soapAction="urn:bal-request-process-bal_a_process/processRequest"/>
<input>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:bal-request-process-bal_a_process"/>
</input>
<output>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:bal-request-process-bal_a_process"/>
</output>
</operation>
</binding>
<service name="bal_a_process">
<port name="bal_a_processPort" binding="tns:bal_a_processBinding">
<soap:address location="http://localhost:7200/balprocess/balprocess"/>
</port>
</service>
</definitions>
Request I am sending to PLSLQ WS URL
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<processRequest xmlns:m="urn:bal-request-process-bal_a_process" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<param0 xsi:type="xsd:string"> "<a>"aaa"</a>" </param0>
</processRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I above SOAP request XML i m testing "<a>"aaa"</a>" as XML string. but this is also getting failed. In actual this will be SOAP XML request from some other XYZ wsdl file.
Quwang ur help needed urgently.
Regards -
Hello Everyone,
Please assist with a step by step guide on how to setup a For Each Loop for XML Task
I'm trying to convert XML to XSLT
I have tried more than 10 times and i just do not know what i am doing wrong - no error, my package just runs for a few seconds but nothing happens
Thanks in advance
DeeI managed to get my XML to XSLT to work but now when i run my package to import the data into SQL table,
it stops after a few records, i get the following error:
[XML Source [1]] Error: The component "XML Source" (1) was unable to process the XML data. The element "Errors" cannot contain a child element. Content model is text only.
Please assist
Check this:
http://social.msdn.microsoft.com/Forums/en-US/80726e0c-9e85-43ca-87bc-7cf90fd7fb31/xml-source-data-flow-throws-cannot-contain-a-child-element-content-model-is-text-only-error?forum=sqlintegrationservices
Chaos isn’t a pit. Chaos is a ladder. Many who try to climb it fail and never get to try again. The fall breaks them. And some are given a chance to climb, but they refuse. They cling to the realm, or the gods, or love. Illusions. Only the ladder is real.
The climb is all there is. -
Sql query generator from xml data
Hi,
I am looking for an open source tool in java which would generate the sql query with an xml configuration file as input. The xml configuration file schema would be defined by the tool and and would provide placeholders for giving the various information required to build the sql query.
Are there any available?
Please let me know.
Anshukhi All,
I tried below . but still no luck .
CREATE OR REPLACE FUNCTION get_audit_trail_log(cikey IN INTEGER) RETURN blob IS
CURSOR c_log(l_cikey INTEGER) IS
SELECT *
FROM PROD_SOAINFRA.audit_details atr
WHERE cikey = l_cikey
ORDER BY count_id;
bl BLOB;
BEGIN
dbms_lob.createtemporary (bl, TRUE);
FOR r_log IN c_log(cikey)
LOOP
dbms_lob.append (bl,r_log.log);
END LOOP;
RETURN(bl);
END;
=======================================
SELECT UTL_RAW.CAST_TO_VARCHAR2(UTL_COMPRESS.LZ_UNCOMPRESS(get_audit_trail_log(ci.cikey)))
FROM PROD_SOAINFRA.audit_details ci
WHERE cikey = 848063749
=======================================
Error:
=====================
ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 20958, maximum: 2000)
22835. 00000 - "Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: %s, maximum: %s)"
*Cause: An attempt was made to convert CLOB to CHAR or BLOB to RAW, where
the LOB size was bigger than the buffer limit for CHAR and RAW
types.
Note that widths are reported in characters if character length
semantics are in effect for the column, otherwise widths are
reported in bytes.
*Action: Do one of the following
1. Make the LOB smaller before performing the conversion,
for example, by using SUBSTR on CLOB
2. Use DBMS_LOB.SUBSTR to convert CLOB to CHAR or BLOB to RAW. -
Hi: We are using weblogic81 sp3. Other developers in my office ran the same porgram and got no errors.
My startWebLogic.cmd are configured exactly same as theirs.
My startWebLogic classpath:
set CLASSPATH=%WL_HOME%\server\lib\ojdbc14.jar;%WL_HOME%\server\lib\CR122067_81sp3.jar;%WEBLOGIC_CLASSPATH%;%POINTBASE_CLASSPATH%;%JAVA_HOME%\jre\lib\rt.jar;%WL_HOME%\server\lib\webservices.jar;%CLASSPATH%
I keep getting this webservice error.
SOAP Fault:javax.xml.rpc.soap.SOAPFaultException: Exception during processing: w
eblogic.xml.schema.binding.DeserializationException: mapping lookup failure. typ
e=['java:language_builtins.util']:ArrayList schema context=TypedSchemaContext{ja
vaType=[Ljava.lang.Object;} (see Fault Detail for stacktrace)
Detail:
<detail>
<bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webse
rvice/fault/1.0.0">weblogic.xml.schema.binding.DeserializationException: mapping
lookup failure. type=['java:language_builtins.util']:ArrayList schema context=T
ypedSchemaContext{javaType=[Ljava.lang.Object;}
at weblogic.xml.schema.binding.RuntimeUtils.lookup_deserializer(RuntimeU
tils.java:461)
thank you for your helpwe used castor to do xml mapping
-
Hi, I created a webservice using weblogic8.1 sp3 workshop. On my desktop, I tested the webservice with a java client and it worked fine. When I deployed webservice application on UNIX production server, it deployed successfully and it displayed WSDL file too. But, when I run java client from desktop to access this webservice on UNIX server, it is throwing the following exception.
java.rmi.RemoteException: SOAP Fault:javax.xml.rpc.soap.SOAPFaultException: EXCEPTION: java.lang.NoClassDefFoundError [ServiceException]
Detail:
<detail>
null </detail>; nested exception is:
javax.xml.rpc.soap.SOAPFaultException: EXCEPTION: java.lang.NoClassDefFoundError [ServiceException]
at weblogic.jws.proxies.MyServiceSoap_Stub.getInfo(MyServiceSoap_Stub.java:31)
at SoapClient.main(SoapClient.java:17)
Caused by: javax.xml.rpc.soap.SOAPFaultException: EXCEPTION: java.lang.NoClassDefFoundError [ServiceException]
at weblogic.webservice.core.ClientDispather.receive(ClientDispatcher.java:313)
at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:144)
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:457)
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:443)
at weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:290)
at weblogic.jws.proxies.MyServiceSoap_Stub.getInfo(MyServiceSoap_Stub.java:26)
can somebody please help me. This is very critical for me.
Thanks in advance.Hi, I created a webservice using weblogic8.1 sp3 workshop. On my desktop, I tested the webservice with a java client and it worked fine. When I deployed webservice application on UNIX production server, it deployed successfully and it displayed WSDL file too. But, when I run java client from desktop to access this webservice on UNIX server, it is throwing the following exception.
java.rmi.RemoteException: SOAP Fault:javax.xml.rpc.soap.SOAPFaultException: EXCEPTION: java.lang.NoClassDefFoundError [ServiceException]
Detail:
<detail>
null </detail>; nested exception is:
javax.xml.rpc.soap.SOAPFaultException: EXCEPTION: java.lang.NoClassDefFoundError [ServiceException]
at weblogic.jws.proxies.MyServiceSoap_Stub.getInfo(MyServiceSoap_Stub.java:31)
at SoapClient.main(SoapClient.java:17)
Caused by: javax.xml.rpc.soap.SOAPFaultException: EXCEPTION: java.lang.NoClassDefFoundError [ServiceException]
at weblogic.webservice.core.ClientDispather.receive(ClientDispatcher.java:313)
at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:144)
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:457)
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:443)
at weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:290)
at weblogic.jws.proxies.MyServiceSoap_Stub.getInfo(MyServiceSoap_Stub.java:26)
can somebody please help me. This is very critical for me.
Thanks in advance. -
How to test SOAP request using XML SPY
Hi,
1. I am new to WebServices concept, I have downloaded the wsdl file and now I need to test the SOAP requests using XML Spy. However, when I try to test the SOAP request generated by XML Spy I receive an error "Internal Error: Session is not available. Aborting" , How do I go ahead to generate the session, Is there a way I can provide the Username and password in the XML Spy to generate something like session.
2. The second problem that I am facing is when I import the WSDL in XML Spy and generate the SOAP request, for all the fields xml tags gets populated with "aaaaaaaaaaaa" kind of data through out. Am i doing something wrong ? Is there some step while creating a SOAP request that I am missing becasue of which the gibbrish data is being populated as default ?
Please Help !
Thanks .I got my SOAP Requests tested using SOAP UI .. However I am still looking for ways to test it using XML SPY.
In the SOAP UI Tool just do right click and select Add WS Security Token ..
Thanks :) -
For this problem I went through
following links
Re: FOR loop in XML Publisher
Re: How do you iterate through a string?
Re: How can print blank rows for XML output report..
Based on the information I created one template
as follow
<?for-each:xdoxslt:foreach_number($_XDOCTX,1,3,1)?>
<?for-each:/ROWSET?>
<?for-each:ROW?> DEPT ---it (DEPT)is a XML tag generated with desktop tool
<?end for-each?>
<?end for-each?>
<?end for-each?>
XML is
- <ROWSET>
<PAR>2</PAR>
- <ROW>
<DEPT>Z1</DEPT>
<DATA>2112</DATA>
</ROW>
- <ROW>
<DEPT>A1</DEPT>
<DATA>7985</DATA>
</ROW>
- <ROW>
<DEPT>B1</DEPT>
<DATA>8452</DATA>
</ROW>
- <ROW>
<DEPT>B2</DEPT>
<DATA>2159</DATA>
</ROW>
</ROWSET>
I am now successful in repeating the record sets but not individual records.
Suppose XML contains single record for
Z1
A1
B1
B2
This is the record set.
Now what I am getting is
Z1
A1
B1
B2
Z1
A1
B1
B2
Z1
A1
B1
B2
But I want it in the form
Z1
Z1
Z1
.A1
A1
A1
B1
B1
B1
C1
C1
Please help me in the issue.
Thanks in advance
C1Hiii,
Sorry about the @row. I was in a bit of a hurry. But you're right. The @row is the row of the table.
try just to use the position() and last().
<?if:position()!=last()?>
<!-- Add page break -->
<?end if?>
br Kenneth -
How to call pl/sql procedure/function from XML
Hi,
I have a requirement to call pl/sql function/procedure from the RTF template. How can I do this?Hi,
I have got the same requirement. We need to call the store PL/SQL procedure from the XML template to generate the fixedwidth files. Could you tell me if you are able to call PL/SQL procedure from XML template?
Thanks,
Ram -
What is payload, xi-soap message and xml payload....
can any 1 explains abt What is payload, xi-soap message and xml payload....
Hi Shiva,
see this abstract from messages file:
"The SOAP header of a message contains all the important information that the Integration Server requires to forward the message, while the payload contains the actual business data (such as <PurchaseOrder> in the example above). <b>You can also append an unlimited number of attachments to the message before it is sent. Attachments typically comprise non-XML data, for example, pictures, text documents, or binary data."</b>
Check this link for more info:
http://help.sap.com/saphelp_nw04/helpdata/en/b6/0b733cb7d61952e10000000a11405a/content.htm
Regards,
Subhasha -
SQL Functions to Update XML Data
Hi,
Can anybody please tell me whether SQL Functions to Update XML Data (such as updateXML, insertChildXML, insertXMLbefore etc) are available with oracle 9i or not?
Please tell me.You can also do a describe on SYS.XMLTYPE to see what methods are supported in your release. How would you find e.g. insertChildXML in DESC sys.xmltype? I suppose it is not a Method of the Type: Summary of XMLType Subprograms.
-
Oracle equivalent of SQL Server's "FOR XML" and "OPENXML"
Hi
Can someone please tell what are the Oracle's equivalent of SQL Server's "FOR XML" and "OPENXML" features?Probably you can try General XML forum General XML
Gints Plivna
http://www.gplivna.eu -
How do i put a loop round this so the user can only enter a number between
how do i put a loop round this so that the user can only enter a number between 1 and 3 if a number like 4 is enter it will just say something like retry
if (CA.trim().equals(ans1)){
Out = "incorrect";
else if(CA.trim().equals(ans2)){
Out = "incorrect";
else if(CA.trim().equals(ans3)){
Out = "correct";
else{
System.out.println("Enter 1 2 or 3 try doin test again");
System.out.println(Out);
byte b[] = Out.getBytes();
out1.write(b);You already know the conditions so here's some pseudocode.
get input
while(input is not what I want (between one and three))
Inform user of improper input and ask for it again
get new input -
Hi,
how can I get the body content of SOAP messages in XML format?
I have a service that get as input a XML string, I want to create a Web Service, with this service, without change all but I have not understand how take the XML to give it to the old service.
TIA
AslasYou should check out the following in details. It
explains to you how soap works and how you can
implement a listener to retrieve the XML doc in
the body.
http://xml.apache.org/soap/docs/index.html
Amlan -
SQL Server's FOR XML EXPLICIT functionality in Oracle
What could be the best way to implement SQL Server's FOR XML EXPLICIT functionality? Can someone please give the overview?
Probably you can try General XML forum General XML
Gints Plivna
http://www.gplivna.eu
Maybe you are looking for
-
I am trying to get an IPOD touch started. It will not connect to wifi. Any tip?
-
Dimensions width and length of a book in iBooks Author
How I can set the width and size throughout the pages and therefore the book in iBooks Author? IPad and need to export it to PDF for printing with specific steps. Any help please?
-
Difference between Intel Core Duo and Intel Core 2 Duo
I bought my MBP in November of last year, before the update on the Pros. However, it says about the new Pros that they have Intel Core 2 Duo processors, which are faster than the Intel Core Duos of previous MBPs. I know I bought mine before they upda
-
Run report then How we can set it maximize utomaticaly
PLEASE HELP ME REGARDING THIS ISSUE HOW CAN I MAXIMIZE REPORT IN DEVELOPER 6.0 REPORTS BUILDER AUTOMATICALY REGARDS AHMAD
-
On the ipad, should apps be totally closed or simply left minimized?
to conserve battery life on the ipad, should apps be fully closed, or simply left minized?