SOAP Fault when returning null from a Native Web Service Stored Procedure
I have a stored procedure which I can successfully invoke via soapUI
However, if one of the Stored Procedure's OUT arguments is set to null the native web service returns the following fault :
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>Error processing input</faultstring>
<detail>
<OracleErrors xmlns="http://xmlns.oracle.com/orawsv/faults">
<OracleError>
<ErrorNumber>ORA-19202</ErrorNumber>
<Message>Error occurred in XML processing</Message>
</OracleError>
<OracleError>
<ErrorNumber>ORA-01405</ErrorNumber>
<Message>fetched column value is NULL</Message>
</OracleError>
</OracleErrors>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>I can see how to control the processing of null values when invoking orawsv (using the null_handling element).
Is there an equivalent for Stored Procedures ?
Thanks,
PD
versions as follows :
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
"CORE 11.2.0.1.0 Production"
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
Without going into any technical discussion about the code, my first question is what JDK version was used to create this which was imported into the form? Understand that Forms 10 runs on JDK 1.4.2, so if you used any newer JDK version, likely there will be problems.
Similar Messages
-
ORA-31050:Access denied when trying enabling the database-native Web servic
Dear all,
I'm trying to follow the instruction of OBE about "Using Oracle XML DB Web Services for Service-Oriented Architecture " as this url http://st-curriculum.oracle.com/obe/db/11g/r1/prod/datamgmt/xmldb2_b/xmldb2_b.htm#http .
I would like to enable the database-native Web service end point in Oracle XML DB and I already execute the script to create Web Service Endpoint.
Anyway, I got the following error.
ORA-31050: Access denied
ORA-06512: at "XDB.DBMS_XDB", line 528
ORA-06512: at "SYSTEM.ADDSERVLETMAPPING", line 91
I found that this procedure was created on system schema but the problem occur when I tried to call ADDSERVLETMAPPING procedure.
This is a code that I used to enable.
set pagesize 100
set linesize 132
set long 20000
set echo on
-- conn sys/oracle as sysdba
create or replace procedure addServletMapping (pattern varchar2,
servletname varchar2,
dispname varchar2,
servletclass varchar2,
servletschema varchar2,
language varchar2,
description varchar2,
securityRole xmltype) as
xdbconfig xmltype;
begin
xdbconfig := dbms_xdb.cfg_get();
select deleteXML
xdbconfig,
'/xdbconfig/sysconfig/protocolconfig/httpconfig/webappconfig/servletconfig/servlet-list/servlet[servlet-name="' || servletname || '"]'
into xdbconfig
from dual;
if (language = 'C') then
select insertChildXML
xdbconfig,
'/xdbconfig/sysconfig/protocolconfig/httpconfig/webappconfig/servletconfig/servlet-list',
'servlet',
xmlElement
"servlet",
xmlAttributes('http://xmlns.oracle.com/xdb/xdbconfig.xsd' as "xmlns"),
xmlForest
servletname as "servlet-name",
language as "servlet-language",
dispname as "display-name",
description as "description"
securityRole
into xdbconfig
from dual;
else
select insertChildXML
xdbconfig,
'/xdbconfig/sysconfig/protocolconfig/httpconfig/webappconfig/servletconfig/servlet-list',
'servlet',
xmlElement
"servlet",
xmlAttributes('http://xmlns.oracle.com/xdb/xdbconfig.xsd' as "xmlns"),
xmlForest
servletname as "servlet-name",
language as "servlet-language",
dispname as "display-name",
description as "description",
servletclass as "servlet-class",
servletschema as "servlet-schema"
into xdbconfig
from dual;
end if;
select deleteXML
xdbconfig,
'/xdbconfig/sysconfig/protocolconfig/httpconfig/webappconfig/servletconfig/servlet-mappings/servlet-mapping[servlet-name="' || servletname || '"]'
into xdbconfig
from dual;
select insertChildXML
xdbconfig,
'/xdbconfig/sysconfig/protocolconfig/httpconfig/webappconfig/servletconfig/servlet-mappings',
'servlet-mapping',
xmltype
'<servlet-mapping xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd">
<servlet-pattern>'||pattern||'</servlet-pattern>
<servlet-name>'||servletname||'</servlet-name>
</servlet-mapping>'
into xdbconfig
from dual;
xdb.dbms_xdb.cfg_update(xdbconfig);
end;
call addServletMapping(
'/orawsv/*',
'orawsv',
'Oracle Query Web Service',
null,
null,
'C',
'Web Services Servlet',
xmltype(
'<security-role-ref>
<role-name>XDB_WEBSERVICES</role-name>
<role-link>XDB_WEBSERVICES</role-link>
</security-role-ref>'
call addServletMapping(
'/orawsdl/*',
'orawsdl',
'Oracle WSDLs',
null,
null,
'C',
'WSDL Servlet',
xmltype(
'<security-role-ref>
<role-name>XDB_WEBSERVICES</role-name>
<role-link>XDB_WEBSERVICES</role-link>
</security-role-ref>'
--grant XDB_WEBSERVICES to oe
grant XDB_WEBSERVICES to TESTDB
-- For 11g only
--grant XDB_WEBSERVICES_OVER_HTTP to oe
grant XDB_WEBSERVICES_OVER_HTTP to TESTDB
--grant XDB_WEBSERVICES_WITH_PUBLIC to oe
grant XDB_WEBSERVICES_WITH_PUBLIC to TESTDB
-- Clean up afterward
drop procedure addServletMapping
Regards,
Zenoni
Edited by: zenoni on Jan 28, 2011 10:18 AMTest if you can access the generic WSDL using a browser
http://server:port/orawsv?wsdlYou should get prompted for a username and password. If you provide the username and password of a database user who was been granted the Web Services Roles you should see the query service WSDL
<definitions name="orawsv" targetNamespace="http://xmlns.oracle.com/orawsv"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://xmlns.oracle.com/orawsv"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schemas.xmlsoap.org/wsdl/ http://schemas.xmlsoap.org/wsdl/">
<types>
<xsd:schema
targetNamespace="http://xmlns.oracle.com/orawsv"
elementFormDefault="qualified">
<xsd:element name="query">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="DDL_text" type="xsd:string"
minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="query_text">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="type">
<xsd:simpleType>
<xsd:restriction base="xsd:NMTOKEN">
<xsd:enumeration value="SQL" />
<xsd:enumeration value="XQUERY" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="bind">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="name" type="xsd:string" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="bindXML">
<xsd:complexType>
<xsd:sequence>
<xsd:any/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:choice>
<xsd:element name="null_handling" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:NMTOKEN">
<xsd:enumeration value="DROP_NULLS" />
<xsd:enumeration value="NULL_ATTR" />
<xsd:enumeration value="EMPTY_TAG" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="max_rows" type="xsd:positiveInteger" minOccurs="0"/>
<xsd:element name="skip_rows" type="xsd:positiveInteger" minOccurs="0"/>
<xsd:element name="pretty_print" type="xsd:boolean" minOccurs="0"/>
<xsd:element name="indentation_width" type="xsd:positiveInteger" minOccurs="0"/>
<xsd:element name="rowset_tag" type="xsd:string" minOccurs="0"/>
<xsd:element name="row_tag" type="xsd:string" minOccurs="0"/>
<xsd:element name="item_tags_for_coll" type="xsd:boolean" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="queryOut">
<xsd:complexType>
<xsd:sequence>
<xsd:any/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</types>
<message name="QueryInput">
<part name="body" element="tns:query"/>
</message>
<message name="XMLOutput">
<part name="body" element="tns:queryOut"/>
</message>
<portType name="ORAWSVPortType">
<operation name="XMLFromQuery">
<input message="tns:QueryInput"/>
<output message="tns:XMLOutput"/>
</operation>
</portType>
<binding name="ORAWSVBinding" type="tns:ORAWSVPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="XMLFromQuery">
<soap:operation soapAction="http://localhost/orawsv"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="ORAWSVService">
<documentation>Oracle Web Service</documentation>
<port name="ORAWSVPort" binding="tns:ORAWSVBinding">
<soap:address location="http://localhost/orawsv"/>
</port>
</service>
</definitions>Edited by: mdrake on Jan 27, 2011 8:42 PM -
Return XML from MVC WebAPI Web Service
The tutorials to create a web service using MVC WebAPI (frmaework4.5) in VS 2013 is touted as being "very simple" to return JSON or XML.
But then, all you get is JSON. When you want to return a plain ole' string of XML ... there is no clear documentation. I see a bunch of posts where people are referencing the ActionResult method ... which is not in the APIController class... so that implies
to me that I need to roll my own from the Controller class. That doesn't seem right to me.
So ... how does one return an XML string from an MVC WebApi application?
* the list of "questions similar to yours" that this forum presents me either: a) are for ASMX in VS 2008 or b) do not work.
Any direction to some documentation is appreciated.
ThanksHi,
If this issue is related to MVC, you could ask this question in the ASP.NET forum:
http://forums.asp.net. If then, you could get an answer more quickly and professional. Maybe the
WCF, ASMX and other Web Services forum will be better for this issue. Thanks for your cooperation.
Have a nice day,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Database Native web services - load balancing, Instrumentation , security
Hello –
I’m proposing use of Database Native web service in our company. Our architects are asking following questions so appreciate your help
a. How do you load balance across the DB WS (is there a way to use the F5 to detect downtime and balance the load across the DB servers)? We will be using RAC configuration with 3 nodes.
b. Our architect have security concern as user id/password information are in the web service URL, which may prove to be an issue. Is there a way to mitigate this risk?
c. Instrumentation in this approach (db native services) is questionable due to development/auto gen of the service logic from the DB itself. We may investigate wrapping the services with OSB to give us an additional instrumentation, policy enforcement, endpoint mediation and security proxy. Thoughts??
d. Architect are curious regarding any potential performance issues this may have on the DB server.
ThanksHi
We've recently begun using Native Web Services, intending to roll out this approach across the enterprise, but we've encountered 2 significant problems so far, which you may want to consider before proceeding ...
1. NWS returns an exception if the underlying PL/SQL returns a null value - even if the PL/SQL has completed successfully, and null is a legitimate return value (see SR 3-6201969101 - it contains simple instructions to recreate the problem)
(I raised it in this forum but there were no replies - SOAP Fault when returning null from a Native Web Service Stored Procedure
2. The sequence of values returned in the NWS response message is the opposite to the sequence declared in the auto-generated wsdl - i.e. schema validation will fail (see SR 3-6209016991 - it also contains simple instructions to replicate)
We have coded a workaround for problem 1. where we return <EMPTY> in place of null, and check for it in the client, but without proper resolution we're not prepared to use NWS elsewhere
As a workaround for problem 2. we removed schema validation, again not ideal
Both SRs were escalated 9 days ago, but are still outstanding
Incidentally our database is 11.2.0.1, but I've tested on 11.2.0.3 and both problems are still present
We also wrap the NWS services using an OSB Proxy Service, and came across the same security issue that you describe (b) - to provide the credentials required for the NWS, simply create a Service Account (containing the credentials) inside OSB and attach it to the Business Service which invokes the NWS (http://docs.oracle.com/cd/E17904_01/doc.1111/e15867/service_accounts.htm)
HTH -
BEA Soap Faults and differentiating them from Normal Soap Faults
Hi,
I've written a webservice client that interfaces with an external soap service. The external soap service generates custom soap exceptions that I am already handling by catching remote exception and then getting the cause from this remote exception to obtain the soap fault.
However, I notice if for example the external webservice is down I get a BEA soap fault returned which is a different format to the faults returned from the external service
IS there a way to easily identify a BEA generated fault from a standard soap fault without interoggating the soap fault manually?Added the charset to web-service.xml
<web-services xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<handler-chains>
<handler-chain name="SOAPHandler">
<handler class-name="WebServiceHandler"/>
</handler-chain>
</handler-chains>
<web-service name="xxx"
uri="/uri"
targetNamespace="http://xxxx"
style="rpc"
ignoreAuthHeader="true"
exposeWSDL="true"
charset="UTF-8">
<components>
<java-class name="mainClass"
class-name="WebService">
</java-class>
</components>
<operations>
<operation method="x"
component="mainClass" handler-chain="SOAPHandler">
<params>
<param name="data" class-name="java.lang.String" style="in" type="xsd:string"/>
<return-param name="result" class-name="java.lang.String" type="xsd:string"/>
</params>
</operation>
</operations>
</web-service>
</web-services>
But it did not help.
This is beas issue probably because, everything works when I invoke service from some other system.
Any more ideas??? -
SOAP Fault Exception [Actor null]
Hi All,
Im trying to call a webservice from portal This web service is in ECC. When I try to call it, it throws the following error:
#1.5 #00E0ED0BA5EF005C000000C500001E350004532D85C22E36#1217354889571#com.sap.portal.SOAPLogger#sap.com/irj#com.sap.portal.SOAPLogger#TESTUSER#9868##n/a##4b8f60d05d9911dda9db00e0ed0ba5ef#SAPEngine_Application_Thread[impl:3]_4##0#0#Warning#1#/System/Server#Java###Call failed
[EXCEPTION]
{0}#1#SOAP Fault Exception [Actor null] : CX_ST_MATCH_ELEMENT:XSLT exception.System expected element 'ItItem'
<Host>undefined</Host>
<Component>APPL</Component>
<ChainedException>
<Exception_Name>CX_SOAP_CORE</Exception_Name>
<Exception_Text>CX_ST_MATCH_ELEMENT:XSLT exception.System expected element 'ItItem'</Exception_Text>
</ChainedException>
<ChainedException>
<Exception_Name>CX_SXMLP</Exception_Name>
<Exception_Text>XSLT exception</Exception_Text>
</ChainedException>
<ChainedException>
<Exception_Name>CX_ST_MATCH_ELEMENT</Exception_Name>
<Exception_Text>System expected element 'ItItem': Main Program:/1BCDWB/WSSC9FCD3336732797F332| Program:/1BCDWB/WSSC9FCD3336732797F332| Line: 11| Valid:X</Exception_Text>
</ChainedException>
#1.5 #00E0ED0BA5EF005C000000C700001E350004532D85C23109#1217354889572#System.err#sap.com/irj#System.err#BHARDWS#9868##n/a##4b8f60d05d9911dda9db00e0ed0ba5ef#SAPEngine_Application_Thread[impl:3]_4##0#0#Error##Plain###SOAP Fault Exception [Actor null] : CX_ST_MATCH_ELEMENT:XSLT exception.System expected element 'ItItem'
<Host>undefined</Host>
<Component>APPL</Component>
<ChainedException>
<Exception_Name>CX_SOAP_CORE</Exception_Name>
<Exception_Text>CX_ST_MATCH_ELEMENT:XSLT exception.System expected element 'ItItem'</Exception_Text>
</ChainedException>
<ChainedException>
<Exception_Name>CX_SXMLP</Exception_Name>
<Exception_Text>XSLT exception</Exception_Text>
</ChainedException>
<ChainedException>
<Exception_Name>CX_ST_MATCH_ELEMENT</Exception_Name>
<Exception_Text>System expected element 'ItItem': Main Program:/1BCDWB/WSSC9FCD3336732797F332| Program:/1BCDWB/WSSC9FCD3336732797F332| Line: 11| Valid:X</Exception_Text>
</ChainedException>
#1.5 #00E0ED0BA5EF005C000000C800001E350004532D85C231DF#1217354889572#System.err#sap.com/irj#System.err#BHARDWS#9868##n/a##4b8f60d05d9911dda9db00e0ed0ba5ef#SAPEngine_Application_Thread[impl:3]_4##0#0#Error##Plain###We are in Exception and got the message778: SOAP Fault Error (n.a) : CX_ST_MATCH_ELEMENT:XSLT exception.System expected element 'ItItem'#
Has anyone come across this? Please help by giving directions on how to fix this.
Thanks
SBHi Alex,
Please ignore the above bapi call, it is too complex since it is a custom BAPI that Im trying to call. For now, I am trying to call a very simple BAPI --> BAPI_CUSTOMER_GETDETAIL just to make sure that communication is happening.
Here is the WSDL:
<?xml version="1.0" encoding="utf-8" ?>
- <wsdl:definitions targetNamespace="urn:sap-com:document:sap:rfc:functions" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="urn:sap-com:document:sap:rfc:functions">
- <wsdl:documentation>
<sidl:sidl xmlns:sidl="http://www.sap.com/2007/03/sidl" />
</wsdl:documentation>
- <wsdl:types>
- <xsd:schema attributeFormDefault="qualified" targetNamespace="urn:sap-com:document:sap:rfc:functions">
- <xsd:simpleType name="char1">
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="1" />
</xsd:restriction>
</xsd:simpleType>
- <xsd:simpleType name="char10">
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="10" />
</xsd:restriction>
</xsd:simpleType>
- <xsd:simpleType name="char130">
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="130" />
</xsd:restriction>
</xsd:simpleType>
- <xsd:simpleType name="char16">
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="16" />
</xsd:restriction>
</xsd:simpleType>
- <xsd:simpleType name="char2">
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="2" />
</xsd:restriction>
</xsd:simpleType>
- <xsd:simpleType name="char20">
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="20" />
</xsd:restriction>
</xsd:simpleType>
- <xsd:simpleType name="char220">
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="220" />
</xsd:restriction>
</xsd:simpleType>
- <xsd:simpleType name="char3">
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="3" />
</xsd:restriction>
</xsd:simpleType>
- <xsd:simpleType name="char30">
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="30" />
</xsd:restriction>
</xsd:simpleType>
- <xsd:simpleType name="char31">
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="31" />
</xsd:restriction>
</xsd:simpleType>
- <xsd:simpleType name="char32">
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="32" />
</xsd:restriction>
</xsd:simpleType>
- <xsd:simpleType name="char35">
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="35" />
</xsd:restriction>
</xsd:simpleType>
- <xsd:simpleType name="char4">
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="4" />
</xsd:restriction>
</xsd:simpleType>
- <xsd:simpleType name="char5">
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="5" />
</xsd:restriction>
</xsd:simpleType>
- <xsd:simpleType name="char50">
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="50" />
</xsd:restriction>
</xsd:simpleType>
- <xsd:simpleType name="cuky5">
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="5" />
</xsd:restriction>
</xsd:simpleType>
- <xsd:simpleType name="date">
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="10" />
<xsd:pattern value="\d\d\d\d-\d\d-\d\d" />
</xsd:restriction>
</xsd:simpleType>
- <xsd:simpleType name="lang">
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="1" />
</xsd:restriction>
</xsd:simpleType>
- <xsd:simpleType name="numeric3">
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="3" />
<xsd:pattern value="\d*" />
</xsd:restriction>
</xsd:simpleType>
- <xsd:simpleType name="numeric6">
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="6" />
<xsd:pattern value="\d*" />
</xsd:restriction>
</xsd:simpleType>
- <xsd:complexType name="BAPIRET2">
- <xsd:sequence>
<xsd:element name="TYPE" type="tns:char1" />
<xsd:element name="ID" type="tns:char20" />
<xsd:element name="NUMBER" type="tns:numeric3" />
<xsd:element name="MESSAGE" type="tns:char220" />
<xsd:element name="LOG_NO" type="tns:char20" />
<xsd:element name="LOG_MSG_NO" type="tns:numeric6" />
<xsd:element name="MESSAGE_V1" type="tns:char50" />
<xsd:element name="MESSAGE_V2" type="tns:char50" />
<xsd:element name="MESSAGE_V3" type="tns:char50" />
<xsd:element name="MESSAGE_V4" type="tns:char50" />
<xsd:element name="PARAMETER" type="tns:char32" />
<xsd:element name="ROW" type="xsd:int" />
<xsd:element name="FIELD" type="tns:char30" />
<xsd:element name="SYSTEM" type="tns:char10" />
</xsd:sequence>
</xsd:complexType>
- <xsd:complexType name="BAPIKNA101">
- <xsd:sequence>
<xsd:element name="FORM_OF_AD" type="tns:char30" />
<xsd:element name="FIRST_NAME" type="tns:char35" />
<xsd:element name="NAME" type="tns:char35" />
<xsd:element name="NAME_3" type="tns:char35" />
<xsd:element name="NAME_4" type="tns:char35" />
<xsd:element name="DATE_BIRTH" type="tns:date" />
<xsd:element name="STREET" type="tns:char35" />
<xsd:element name="POSTL_CODE" type="tns:char10" />
<xsd:element name="CITY" type="tns:char35" />
<xsd:element name="REGION" type="tns:char3" />
<xsd:element name="COUNTRY" type="tns:char3" />
<xsd:element name="COUNTRNISO" type="tns:char3" />
<xsd:element name="COUNTRAISO" type="tns:char3" />
<xsd:element name="INTERNET" type="tns:char130" />
<xsd:element name="FAX_NUMBER" type="tns:char31" />
<xsd:element name="TELEPHONE" type="tns:char16" />
<xsd:element name="TELEPHONE2" type="tns:char16" />
<xsd:element name="LANGU" type="tns:lang" />
<xsd:element name="LANGU_ISO" type="tns:char2" />
<xsd:element name="CURRENCY" type="tns:cuky5" />
<xsd:element name="CURRENCY_ISO" type="tns:char3" />
<xsd:element name="COUNTRYISO" type="tns:char2" />
<xsd:element name="ONLY_CHANGE_COMADDRESS" type="tns:char1" />
</xsd:sequence>
</xsd:complexType>
- <xsd:complexType name="BAPIRETURN">
- <xsd:sequence>
<xsd:element name="TYPE" type="tns:char1" />
<xsd:element name="CODE" type="tns:char5" />
<xsd:element name="MESSAGE" type="tns:char220" />
<xsd:element name="LOG_NO" type="tns:char20" />
<xsd:element name="LOG_MSG_NO" type="tns:numeric6" />
<xsd:element name="MESSAGE_V1" type="tns:char50" />
<xsd:element name="MESSAGE_V2" type="tns:char50" />
<xsd:element name="MESSAGE_V3" type="tns:char50" />
<xsd:element name="MESSAGE_V4" type="tns:char50" />
</xsd:sequence>
</xsd:complexType>
- <xsd:element name="BAPI_TRANSACTION_COMMIT">
- <xsd:complexType>
- <xsd:sequence>
<xsd:element name="WAIT" type="tns:char1" minOccurs="0" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
- <xsd:element name="BAPI_TRANSACTION_COMMITResponse">
- <xsd:complexType>
- <xsd:sequence>
<xsd:element name="RETURN" type="tns:BAPIRET2" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
- <xsd:element name="BAPI_CUSTOMER_GETDETAIL">
- <xsd:complexType>
- <xsd:sequence>
<xsd:element name="CUSTOMERNO" type="tns:char10" />
<xsd:element name="PI_DISTR_CHAN" type="tns:char2" minOccurs="0" />
<xsd:element name="PI_DIVISION" type="tns:char2" minOccurs="0" />
<xsd:element name="PI_PASS_BUFFER" type="tns:char1" minOccurs="0" />
<xsd:element name="PI_SALESORG" type="tns:char4" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
- <xsd:element name="BAPI_CUSTOMER_GETDETAILResponse">
- <xsd:complexType>
- <xsd:sequence>
<xsd:element name="PE_ADDRESS" type="tns:BAPIKNA101" />
<xsd:element name="RETURN" type="tns:BAPIRETURN" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
- <wsdl:message name="BAPI_TRANSACTION_COMMIT">
<wsdl:part name="parameters" element="tns:BAPI_TRANSACTION_COMMIT" />
</wsdl:message>
- <wsdl:message name="BAPI_TRANSACTION_COMMITResponse">
<wsdl:part name="parameter" element="tns:BAPI_TRANSACTION_COMMITResponse" />
</wsdl:message>
- <wsdl:message name="BAPI_CUSTOMER_GETDETAIL">
<wsdl:part name="parameters" element="tns:BAPI_CUSTOMER_GETDETAIL" />
</wsdl:message>
- <wsdl:message name="BAPI_CUSTOMER_GETDETAILResponse">
<wsdl:part name="parameter" element="tns:BAPI_CUSTOMER_GETDETAILResponse" />
</wsdl:message>
- <wsdl:portType name="YCUST">
- <wsdl:operation name="BAPI_TRANSACTION_COMMIT">
<wsdl:input message="tns:BAPI_TRANSACTION_COMMIT" />
<wsdl:output message="tns:BAPI_TRANSACTION_COMMITResponse" />
</wsdl:operation>
- <wsdl:operation name="BAPI_CUSTOMER_GETDETAIL">
<wsdl:input message="tns:BAPI_CUSTOMER_GETDETAIL" />
<wsdl:output message="tns:BAPI_CUSTOMER_GETDETAILResponse" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="YCUST" type="tns:YCUST">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
- <wsdl:operation name="BAPI_TRANSACTION_COMMIT">
<soap:operation soapAction="" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="BAPI_CUSTOMER_GETDETAIL">
<soap:operation soapAction="" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="service">
- <wsdl:port name="YCUST" binding="tns:YCUST">
<soap:address location="http://myportal:8040/sap/bc/srt/rfc/sap/ycust/040/ycust/ycust" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
As you will see below in my portal component, Im populating the four fields that it requires:
public class WS_ECC_Service extends PageProcessorComponent {
public DynPage getPage(){
return new WS_ECC_ServiceDynPage();
public static class WS_ECC_ServiceDynPage extends JSPDynPage{
protected IPortalComponentRequest request;
protected IPortalComponentResponse response;
protected IPortalComponentSession session;
protected IPortalComponentContext context;
protected IPortalComponentProfile profile;
protected String userId;
// protected IUser epUser;
protected String sapSystem;
protected String fileName;
private DAO DAO = null;
// private FileUploadUtility FIU = null;
// private ReadExcelData RED = null;
private final static int SUCCESS_STATE = 0;
private final static int INITIAL_STATE = 1;
private final static int ERROR_STATE = 2;
private int state = INITIAL_STATE;
public void doInitialization(){
this.communicate();
// fill your bean with data here...
public void communicate()throws IllegalArgumentException{
try{
IPortalRuntimeResources runtimeResources = PortalRuntime.getRuntimeResources();
IYBAPI_Service myService = (IYBAPI_Service)runtimeResources.getService(IYBAPI_Service.KEY);
System.err.println("b4 passing object to service Anurag-"+IYBAPI_Service.KEY);
com.ybapi.BAPI_CUSTOMER_GETDETAIL param = new com.ybapi.BAPI_CUSTOMER_GETDETAIL();
com.ybapi.BAPI_CUSTOMER_GETDETAILResponse result1 = new com.ybapi.BAPI_CUSTOMER_GETDETAILResponse();
com.ybapi.Char10 custno = new com.ybapi.Char10();
custno.setValue("0000009702");
param.setCUSTOMERNO(custno);
com.ybapi.Char2 distr = new com.ybapi.Char2();
distr.setValue("12");
param.setPI_DISTR_CHAN(distr);
param.setPI_DIVISION(distr);
com.ybapi.Char1 buff = new com.ybapi.Char1();
buff.setValue("w");
param.setPI_PASS_BUFFER(buff);
com.ybapi.Char4 sorg = new com.ybapi.Char4();
sorg.setValue("0001");
param.setPI_SALESORG(sorg);
result1 = myService.BAPI_CUSTOMER_GETDETAIL(param);
System.err.println("message message dear message : - " + result1.getPE_ADDRESS().getNAME());
}catch (IllegalArgumentException ex){
System.err.println("Getting details2 " + ex.getMessage());
}catch (Exception e) {
e.printStackTrace();
System.err.println("We are in Exception and got the message778: " + e.getMessage());
}//end try catch
public void doProcessAfterInput() throws PageException {
public void doProcessBeforeOutput() throws PageException {
this.setJspName("uploadutility.jsp");
and this is what it is throwing the error, exactly the same that I got in my above post which I asked you to ignore.
#1.5 #00E0ED0BA5EF006E0000015A00001E350004533EB66A08B6#1217428720322#com.sap.portal.SOAPLogger#sap.com/irj#com.sap.portal.SOAPLogger#BHARDWS#17255##n/a##2aaa48605e4511ddbbf300e0ed0ba5ef#SAPEngine_Application_Thread[impl:3]_2##0#0#Warning#1#/System/Server#Java###Call failed
[EXCEPTION]
{0}#1#SOAP Fault Exception [Actor null] : CX_ST_MATCH_ELEMENT:XSLT exception.System expected element 'CUSTOMERNO'
<Host>undefined</Host>
<Component>APPL</Component>
<ChainedException>
<Exception_Name>CX_SOAP_CORE</Exception_Name>
<Exception_Text>CX_ST_MATCH_ELEMENT:XSLT exception.System expected element 'CUSTOMERNO'</Exception_Text>
</ChainedException>
<ChainedException>
<Exception_Name>CX_SXMLP</Exception_Name>
<Exception_Text>XSLT exception</Exception_Text>
</ChainedException>
<ChainedException>
<Exception_Name>CX_ST_MATCH_ELEMENT</Exception_Name>
<Exception_Text>System expected element 'CUSTOMERNO': Main Program:/1BCDWB/WSSB675FB6DBC9770445BC| Program:/1BCDWB/WSSB675FB6DBC9770445BC| Line: 19| Valid:X</Exception_Text>
</ChainedException>
#1.5 #00E0ED0BA5EF006E0000015C00001E350004533EB66A09BD#1217428720322#System.err#sap.com/irj#System.err#BHARDWS#17255##n/a##2aaa48605e4511ddbbf300e0ed0ba5ef#SAPEngine_Application_Thread[impl:3]_2##0#0#Error##Plain###$$$$$$$$$$$$$exex-SOAP Fault Error (n.a) : CX_ST_MATCH_ELEMENT:XSLT exception.System expected element 'CUSTOMERNO'#
#1.5 #00E0ED0BA5EF006E0000015D00001E350004533EB66A0B44#1217428720323#System.err#sap.com/irj#System.err#BHARDWS#17255##n/a##2aaa48605e4511ddbbf300e0ed0ba5ef#SAPEngine_Application_Thread[impl:3]_2##0#0#Error##Plain###SOAP Fault Exception [Actor null] : CX_ST_MATCH_ELEMENT:XSLT exception.System expected element 'CUSTOMERNO'
<Host>undefined</Host>
<Component>APPL</Component>
<ChainedException>
<Exception_Name>CX_SOAP_CORE</Exception_Name>
<Exception_Text>CX_ST_MATCH_ELEMENT:XSLT exception.System expected element 'CUSTOMERNO'</Exception_Text>
</ChainedException>
<ChainedException>
<Exception_Name>CX_SXMLP</Exception_Name>
<Exception_Text>XSLT exception</Exception_Text>
</ChainedException>
<ChainedException>
<Exception_Name>CX_ST_MATCH_ELEMENT</Exception_Name>
<Exception_Text>System expected element 'CUSTOMERNO': Main Program:/1BCDWB/WSSB675FB6DBC9770445BC| Program:/1BCDWB/WSSB675FB6DBC9770445BC| Line: 19| Valid:X</Exception_Text>
</ChainedException>
#1.5 #00E0ED0BA5EF006E0000015E00001E350004533EB66A0B93#1217428720323#System.err#sap.com/irj#System.err#TESTUSER#17255##n/a##2aaa48605e4511ddbbf300e0ed0ba5ef#SAPEngine_Application_Thread[impl:3]_2##0#0#Error##Plain###We are in Exception and got the message778: SOAP Fault Error (n.a) : CX_ST_MATCH_ELEMENT:XSLT exception.System expected element 'CUSTOMERNO'# -
Helpme I have error when I try connect from struts to web service
helpme I have error when I try connect from struts to web service using basic authentication . the error message is
[SOAP Exception: fault code= SOAP-ENV Protocol; msg=Unsupported response content type "text/html" must be "text/xml"; ] Response was <html><body> 401 Unauthorized </body></html>
I'm not using ldap for authentication only xml (jazx-data.xml) ... I already create user with jazn.jar for that user , and I dont know why it still error like that ..
Please helpme I don't have anytime more to find the mistake , ??
I'm using Jdeveloper 9i , and oc4j 9.0.4 Server (Not embedded with Jdev)
But when I use with sample java client it success .....
then I try with Struts the response is unsupported response content type text/html must be text/xml response was 401 Unauthorized1.The reason why this error occurs is, we are getting non SOAP response when the program is expecting a SOAP response. Did you set the proxy server correctly? Try to handle the exception and see the content type of the response in your program.
2. While creating the client stub u must check an option for authentication for webservice .should solve ur problem.
thanks
sirisha -
How to return multiple record with Oracle Native Web Service?
Dear all,
I would like to know that the oracle native web service can be able to return multiple records to client or not?
I successfully developed the oracle native web service for returning single record but the next challenge is to develop web service in order to return multiple record (like Employees data base on each department)
Thank and Regards,
ZenoniI successfully developed the oracle native web service for returning single record but the next challenge is to develop web service in order to return multiple record (like Employees data base on each department)You could return a list (multiple values/records) in XML format (using XMLType or CLOB), or CSV, or JSON, or whatever.
function get_employees (p_department_id in number) return clob
as
begin
return 'your_xml_string_here';
end get_employees;It would be up to the client (the caller of the web service) to extract the values from whatever format you decide upon, of course.
- Morten
http://ora-00001.blogspot.com -
SOAP Response from PL/SQL Web Service
My returned SOAP xml from PL/SQL web service has totally rearranged element order, which defined in WSDL and oracle database. It also changed all element name from mixed upper/lower case to pure lower case and makes them hard to read. Why is that? Is there any way to avoid these to happen?
My PL/SQL web service was generated by Oracle9i JDeveloper 9.0.3.
Thanks for any help.
YiHi,
we need more details
- it seems like you have both Return and OUT arguments; which SOAP stack are you using?
- which tools?
- What is the naming convention of your PL/SQL arguments?
Kuassi
Mike,
1. The SOAP is the result of publishing a stored procedure/function as a Web service.
2. The elements for returned data are re-ordered. The function returns no complex type.
3. The element tags containing returned data are all changed to lower case.
Here are what I expected for returning SOAP:
<return xmlns:ns2="http://oracle817/IDemogprofilews.xsd" xsi:type="ns2:oracle817_ODemog">
<OFipsCode xsi:type="xsd:string">51059</ OFipsCode >
<TotalPopulation xsi:type="xsd:double">818584.0</ TotalPopulation >
<PercentMinority xsi:type="xsd:double">22.5</ PercentMinority >
<PersonsBelowPovertyLevel xsi:type="xsd:double">28210.0</ PersonsBelowPovertyLevel >
<HouseholdsInArea xsi:type="xsd:double">292943.0</ HouseholdsInArea >
<HousingUnitsBuiltBefore1950 xsi:type="xsd:double">5.2</ HousingUnitsBuiltBefore1950 >
<White xsi:type="xsd:double">666349.0</ White >
<HispanicOrigin xsi:type="xsd:double">50526.0</ HispanicOrigin >
<AmericanIndian xsi:type="xsd:double">2318.0</ AmericanIndian >
<HighSchoolDiploma xsi:type="xsd:double">91675.0</ HighSchoolDiploma >
<BachelorAndHigher xsi:type="xsd:double">264673.0</ BachelorAndHigher >
<Adults18yearsAndOlder xsi:type="xsd:double">618989.0</ Adults18yearsAndOlder >
<Seniors65yearsAndOlder xsi:type="xsd:double">52977.0</ Seniors65yearsAndOlder >
Instead I get following back:
<return xmlns:ns2="http://oracle817/IDemogprofilews.xsd" xsi:type="ns2:oracle817_ODemog">
<totalpopulation xsi:type="xsd:double">818584.0</totalpopulation>
<americanindian xsi:type="xsd:double">2318.0</americanindian>
<housingunitsbuiltbefore1950 xsi:type="xsd:double">5.2</housingunitsbuiltbefore1950>
<hispanicorigin xsi:type="xsd:double">50526.0</hispanicorigin>
<highschooldiploma xsi:type="xsd:double">91675.0</highschooldiploma>
<adults18yearsandolder xsi:type="xsd:double">618989.0</adults18yearsandolder>
<seniors65yearsandolder xsi:type="xsd:double">52977.0</seniors65yearsandolder>
<householdsinarea xsi:type="xsd:double">292943.0</householdsinarea>
<personsbelowpovertylevel xsi:type="xsd:double">28210.0</personsbelowpovertylevel>
<ofipscode xsi:type="xsd:string">51059</ofipscode>
<bachelorandhigher xsi:type="xsd:double">264673.0</bachelorandhigher>
<white xsi:type="xsd:double">666349.0</white>
<percentminority xsi:type="xsd:double">22.5</percentminority>
You can see the element tag names are in different order/sequence and cases.
Thanks.
Yi -
11g Native Web Services Core Dump ( qmuwsPrintPackWSDL() )
I know that native PL/SQL web services are newer functionality, but I have not been able to find any information on the following issue on MetaLink or here on the forums. When creating 11g native web services when attempting to retrieve the WSDL documents from the server the document is only partially served (estimated at about 2/3rds) or not at all (blank document returned).
Banner: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
The alert log gains this entry:
<msg time='2009-03-30T13:23:21.843-04:00' org_id='oracle' comp_id='rdbms'
client_id='' type='UNKNOWN' level='16'
host_id='TEST_HOST1' host_addr='10.38.11.20' module=''
pid='16144'>
<txt>Exception [type: ACCESS_VIOLATION, UNABLE_TO_READ] [ADDR:0x98] [PC:0x37FAE2B, _qmuwsPrintPackWSDL()+1031]
</txt>
</msg>
<msg time='2009-03-30T13:23:21.906-04:00' org_id='oracle' comp_id='rdbms'
msg_id='1205222838' type='INCIDENT_ERROR' group='Access Violation'
level='1' host_id='TEST_HOST1' host_addr='10.38.11.20'
prob_key='ORA 7445 [qmuwsPrintPackWSDL()+1031]' upstream_comp='' downstream_comp=''
ecid='' errid='62733' detail_path='c:\app\diag\rdbms\orcl\orcl\trace\orcl_s001_16144.trc'>
<txt>Errors in file c:\app\diag\rdbms\orcl\orcl\trace\orcl_s001_16144.trc (incident=62733):
ORA-07445: exception encountered: core dump [qmuwsPrintPackWSDL()+1031] [ACCESS_VIOLATION] [ADDR:0x98] [PC:0x37FAE2B] [UNABLE_TO_READ] []
</txt>
</msg>
<msg time='2009-03-30T13:23:21.953-04:00' org_id='oracle' comp_id='rdbms'
msg_id='dbgexProcessError:1094:3370026720' type='TRACE' level='16'
host_id='TEST_HOST1' host_addr='10.38.11.20'>
<txt>Incident details in: c:\app\diag\rdbms\orcl\orcl\incident\incdir_62733\orcl_s001_16144_i62733.trc
</txt>
</msg>
<msg time='2009-03-30T13:23:23.250-04:00' org_id='oracle' comp_id='rdbms'
client_id='' type='UNKNOWN' level='16'
host_id='TEST_HOST1' host_addr='10.38.11.20' module=''
pid='3120'>
<txt>Trace dumping is performing id=[cdmp_20090330132323]
</txt>
</msg>
<msg time='2009-03-30T13:23:26.093-04:00' org_id='oracle' comp_id='rdbms'
msg_id='dbgrimswi_sweep_incident:1855:4220681759' type='ERROR' group='ami_comp'
level='8' host_id='TEST_HOST1' host_addr='10.38.11.20'>
<txt>Sweep Incident[62733]: completed
</txt>
</msg>
<msg time='2009-03-30T13:23:44.500-04:00' org_id='oracle' comp_id='rdbms'
client_id='' type='UNKNOWN' level='16'
host_id='TEST_HOST1' host_addr='10.38.11.20' module=''
pid='6724'>
<txt>found dead shared server 'S001', pid = (19, 3)
</txt>
</msg>The trace files contain the following:
Trace file c:\app\diag\rdbms\orcl\orcl\trace\orcl_s001_16144.trc
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Windows NT Version V5.2 Service Pack 2
CPU : 16 - type 586, 4 Physical Cores
Process Affinity : 0x00000000
Memory (Avail/Total): Ph:10902M/24571M, Ph+PgF:8218M/26299M, VA:349M/2047M
Instance name: orcl
Redo thread mounted by this instance: 1
Oracle process number: 19
Windows thread id: 16144, image: ORACLE.EXE (S001)
*** 2009-03-30 13:23:21.828
*** SESSION ID:(129.4177) 2009-03-30 13:23:21.828
*** CLIENT ID:() 2009-03-30 13:23:21.828
*** SERVICE NAME:(SYS$USERS) 2009-03-30 13:23:21.828
*** MODULE NAME:() 2009-03-30 13:23:21.828
*** ACTION NAME:() 2009-03-30 13:23:21.828
Exception [type: ACCESS_VIOLATION, UNABLE_TO_READ] [ADDR:0x98] [PC:0x37FAE2B, _qmuwsPrintPackWSDL()+1031]
Incident 62733 created, dump file: c:\app\diag\rdbms\orcl\orcl\incident\incdir_62733\orcl_s001_16144_i62733.trc
ORA-07445: exception encountered: core dump [qmuwsPrintPackWSDL()+1031] [ACCESS_VIOLATION] [ADDR:0x98] [PC:0x37FAE2B] [UNABLE_TO_READ] []I am at a loss on quickly resolving this issue. I will be attempting to find a solution via an SR, but I am not sure how responsive that will be. Any help is appreciated.
SR Number: 7504349.992Quick test for 11.1.0.7.0 (linux_x64) does not show a problem
SQL> connect sys/oracle as sysdba
Connected.
SQL> --
SQL> def USERNAME=WEB_API
SQL> --
SQL> def PASSWORD=WEB_API
SQL> --
SQL> DROP USER &USERNAME CASCADE
2 /
old 1: DROP USER &USERNAME CASCADE
new 1: DROP USER WEB_API CASCADE
DROP USER WEB_API CASCADE
ERROR at line 1:
ORA-01918: user 'WEB_API' does not exist
SQL> grant connect, resource to &USERNAME identified by &PASSWORD
2 /
old 1: grant connect, resource to &USERNAME identified by &PASSWORD
new 1: grant connect, resource to WEB_API identified by WEB_API
Grant succeeded.
SQL> begin
2 dbms_network_acl_admin.drop_acl('localhost.xml');
3 end;
4 /
begin
ERROR at line 1:
ORA-31001: Invalid resource handle or path name "/sys/acls/localhost.xml"
ORA-06512: at "XDB.DBMS_XDB", line 337
ORA-06512: at "SYS.DBMS_NETWORK_ACL_ADMIN", line 428
ORA-06512: at line 2
SQL> begin
2 dbms_network_acl_admin.create_acl('localhost.xml', 'ACL for 127.0.0.1', '&USERNAME', true, 'connect');
3 dbms_network_acl_admin.assign_acl('localhost.xml', '127.0.0.1');
4 end;
5 /
old 2: dbms_network_acl_admin.create_acl('localhost.xml', 'ACL for 127.0.0.1', '&USERNAME', true, 'connect');
new 2: dbms_network_acl_admin.create_acl('localhost.xml', 'ACL for 127.0.0.1', 'WEB_API', true, 'connect');
PL/SQL procedure successfully completed.
SQL> COMMIT
2 /
Commit complete.
SQL> GRANT XDB_WEBSERVICES TO &USERNAME
2 /
old 1: GRANT XDB_WEBSERVICES TO &USERNAME
new 1: GRANT XDB_WEBSERVICES TO WEB_API
Grant succeeded.
SQL> GRANT XDB_WEBSERVICES_OVER_HTTP TO &USERNAME
2 /
old 1: GRANT XDB_WEBSERVICES_OVER_HTTP TO &USERNAME
new 1: GRANT XDB_WEBSERVICES_OVER_HTTP TO WEB_API
Grant succeeded.
SQL> connect &USERNAME/&PASSWORD
Connected.
SQL> --
SQL> var url varchar2(700)
SQL> --
SQL> set pages 0 long 10000
SQL> --
SQL>
SQL> CREATE OR REPLACE TYPE ACCOUNT_O AS OBJECT
2 (
3 ACCOUNT_ID NUMBER(9, 0),
4 ACCOUNT_NUMBER VARCHAR2(100),
5 ACCOUNT_NAME VARCHAR2(50),
6 ACTIVE NUMBER(1, 0),
7 DEACTIVE_DATE DATE,
8 START_DATE DATE,
9 END_DATE DATE,
10 ROLLOVER_ACCOUNT_NUMBER VARCHAR2(100),
11 ROLLOVER_ACCOUNT_NAME VARCHAR2(50),
12 ROLLOVER_SPEED_CODE VARCHAR2(10),
13 LAST_UPDATE_DATE DATE
14 )
15 /
Type created.
SQL> CREATE OR REPLACE TYPE ACCOUNT_SK AS OBJECT( ACCOUNT_ID NUMBER(38) )
2 /
Type created.
SQL> CREATE OR REPLACE PACKAGE ACCOUNT_API AS
2 FUNCTION "NEW"(ACCOUNT_ID NUMBER,
3 ACCOUNT_NUMBER VARCHAR2,
4 ACCOUNT_NAME VARCHAR2 DEFAULT NULL,
5 ACTIVE NUMBER DEFAULT NULL,
6 DEACTIVE_DATE DATE DEFAULT NULL,
7 START_DATE DATE DEFAULT NULL,
8 END_DATE DATE DEFAULT NULL,
9 ROLLOVER_ACCOUNT_NUMBER VARCHAR2 DEFAULT NULL,
10 ROLLOVER_ACCOUNT_NAME VARCHAR2 DEFAULT NULL,
11 ROLLOVER_SPEED_CODE VARCHAR2 DEFAULT NULL,
12 LAST_UPDATE_DATE DATE DEFAULT NULL)
13 RETURN ACCOUNT_SK;
14 PROCEDURE "UPDATE"(ACCOUNT_ID NUMBER,
15 ACCOUNT_NUMBER VARCHAR2,
16 ACCOUNT_NAME VARCHAR2 DEFAULT NULL,
17 ACTIVE NUMBER DEFAULT NULL,
18 DEACTIVE_DATE DATE DEFAULT NULL,
19 START_DATE DATE DEFAULT NULL,
20 END_DATE DATE DEFAULT NULL,
21 ROLLOVER_ACCOUNT_NUMBER VARCHAR2 DEFAULT NULL,
22 ROLLOVER_ACCOUNT_NAME VARCHAR2 DEFAULT NULL,
23 ROLLOVER_SPEED_CODE VARCHAR2 DEFAULT NULL,
24 LAST_UPDATE_DATE DATE DEFAULT NULL);
25 PROCEDURE "DELETE"(ACCOUNT_ID NUMBER);
26 FUNCTION "GET"(ACCOUNT_ID NUMBER) RETURN ACCOUNT_O;
27 END ACCOUNT_API;
28 /
Package created.
SQL> BEGIN
2 :url := 'http://&USERNAME:&[email protected]:' || dbms_xdb.getHttpPort() || '/orawsv/&USERNAME/ACCOUNT_API';
3 end;
4 /
old 2: :url := 'http://&USERNAME:&[email protected]:' || dbms_xdb.getHttpPort() || '/orawsv/&USERNAME/ACCOUNT_API';
new 2: :url := 'http://WEB_API:[email protected]:' || dbms_xdb.getHttpPort() || '/orawsv/WEB_API/ACCOUNT_API';
PL/SQL procedure successfully completed.
SQL> print url
http://WEB_API:[email protected]:80/orawsv/WEB_API/ACCOUNT_API
SQL> --
SQL> select httpuritype( :url || '?wsdl' ).getXML() from dual
2 /
<definitions name="ACCOUNT_API" targetNamespace="http://xmlns.oracle.com/orawsv/
WEB_API/ACCOUNT_API" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://
xmlns.oracle.com/orawsv/WEB_API/ACCOUNT_API" xmlns:xsd="http://www.w3.org/2001/X
MLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<types>
<xsd:schema targetNamespace="http://xmlns.oracle.com/orawsv/WEB_API/ACCOUNT_
API" elementFormDefault="qualified">
<xsd:element name="UPDATEInput">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="START_DATE-DATE-IN" minOccurs="0" maxOccurs="1" t
ype="xsd:date"/>
<xsd:element name="ROLLOVER_SPEED_CODE-VARCHAR2-IN" minOccurs="0" ma
xOccurs="1" type="xsd:string"/>
<xsd:element name="ROLLOVER_ACCOUNT_NUMBER-VARCHAR2-IN" minOccurs="0
" maxOccurs="1" type="xsd:string"/>
<xsd:element name="ROLLOVER_ACCOUNT_NAME-VARCHAR2-IN" minOccurs="0"
maxOccurs="1" type="xsd:string"/>
<xsd:element name="LAST_UPDATE_DATE-DATE-IN" minOccurs="0" maxOccurs
="1" type="xsd:date"/>
<xsd:element name="END_DATE-DATE-IN" minOccurs="0" maxOccurs="1" typ
e="xsd:date"/>
<xsd:element name="DEACTIVE_DATE-DATE-IN" minOccurs="0" maxOccurs="1
" type="xsd:date"/>
<xsd:element name="ACTIVE-NUMBER-IN" minOccurs="0" maxOccurs="1" typ
e="xsd:double"/>
<xsd:element name="ACCOUNT_NUMBER-VARCHAR2-IN" type="xsd:string"/>
<xsd:element name="ACCOUNT_NAME-VARCHAR2-IN" minOccurs="0" maxOccurs
="1" type="xsd:string"/>
<xsd:element name="ACCOUNT_ID-NUMBER-IN" type="xsd:double"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="UPDATEOutput">
<xsd:complexType>
<xsd:sequence>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="CACCOUNT_SK-NEWInput">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="START_DATE-DATE-IN" minOccurs="0" maxOccurs="1" t
ype="xsd:date"/>
<xsd:element name="ROLLOVER_SPEED_CODE-VARCHAR2-IN" minOccurs="0" ma
xOccurs="1" type="xsd:string"/>
<xsd:element name="ROLLOVER_ACCOUNT_NUMBER-VARCHAR2-IN" minOccurs="0
" maxOccurs="1" type="xsd:string"/>
<xsd:element name="ROLLOVER_ACCOUNT_NAME-VARCHAR2-IN" minOccurs="0"
maxOccurs="1" type="xsd:string"/>
<xsd:element name="LAST_UPDATE_DATE-DATE-IN" minOccurs="0" maxOccurs
="1" type="xsd:date"/>
<xsd:element name="END_DATE-DATE-IN" minOccurs="0" maxOccurs="1" typ
e="xsd:date"/>
<xsd:element name="DEACTIVE_DATE-DATE-IN" minOccurs="0" maxOccurs="1
" type="xsd:date"/>
<xsd:element name="ACTIVE-NUMBER-IN" minOccurs="0" maxOccurs="1" typ
e="xsd:double"/>
<xsd:element name="ACCOUNT_NUMBER-VARCHAR2-IN" type="xsd:string"/>
<xsd:element name="ACCOUNT_NAME-VARCHAR2-IN" minOccurs="0" maxOccurs
="1" type="xsd:string"/>
<xsd:element name="ACCOUNT_ID-NUMBER-IN" type="xsd:double"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="NEWOutput">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="RETURN" type="tns:ACCOUNT_SKType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="CACCOUNT_O-GETInput">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ACCOUNT_ID-NUMBER-IN" type="xsd:double"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="GETOutput">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="RETURN" type="tns:ACCOUNT_OType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="DELETEInput">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ACCOUNT_ID-NUMBER-IN" type="xsd:double"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="DELETEOutput">
<xsd:complexType>
<xsd:sequence>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="ACCOUNT_SKType">
<xsd:sequence>
<xsd:element name="ACCOUNT_SK">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ACCOUNT_ID" type="xsd:double"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ACCOUNT_OType">
<xsd:sequence>
<xsd:element name="ACCOUNT_O">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ACCOUNT_ID" type="xsd:double"/>
<xsd:element name="ACCOUNT_NUMBER">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="100"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ACCOUNT_NAME">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="50"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ACTIVE" type="xsd:double"/>
<xsd:element name="DEACTIVE_DATE" type="xsd:date"/>
<xsd:element name="START_DATE" type="xsd:date"/>
<xsd:element name="END_DATE" type="xsd:date"/>
<xsd:element name="ROLLOVER_ACCOUNT_NUMBER">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="100"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ROLLOVER_ACCOUNT_NAME">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="50"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ROLLOVER_SPEED_CODE">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="10"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LAST_UPDATE_DATE" type="xsd:date"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</types>
<message name="UPDATEInputMessage">
<part name="parameters" element="tns:UPDATEInput"/>
</message>
<message name="UPDATEOutputMessage">
<part name="parameters" element="tns:UPDATEOutput"/>
</message>
<message name="NEWInputMessage">
<part name="parameters" element="tns:CACCOUNT_SK-NEWInput"/>
</message>
<message name="NEWOutputMessage">
<part name="parameters" element="tns:NEWOutput"/>
</message>
<message name="GETInputMessage">
<part name="parameters" element="tns:CACCOUNT_O-GETInput"/>
</message>
<message name="GETOutputMessage">
<part name="parameters" element="tns:GETOutput"/>
</message>
<message name="DELETEInputMessage">
<part name="parameters" element="tns:DELETEInput"/>
</message>
<message name="DELETEOutputMessage">
<part name="parameters" element="tns:DELETEOutput"/>
</message>
<portType name="ACCOUNT_APIPortType">
<operation name="UPDATE">
<input message="tns:UPDATEInputMessage"/>
<output message="tns:UPDATEOutputMessage"/>
</operation>
<operation name="NEW">
<input message="tns:NEWInputMessage"/>
<output message="tns:NEWOutputMessage"/>
</operation>
<operation name="GET">
<input message="tns:GETInputMessage"/>
<output message="tns:GETOutputMessage"/>
</operation>
<operation name="DELETE">
<input message="tns:DELETEInputMessage"/>
<output message="tns:DELETEOutputMessage"/>
</operation>
</portType>
<binding name="ACCOUNT_APIBinding" type="tns:ACCOUNT_APIPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/ht
tp"/>
<operation name="UPDATE">
<soap:operation soapAction="UPDATE"/>
<input>
<soap:body parts="parameters" use="literal"/>
</input>
<output>
<soap:body parts="parameters" use="literal"/>
</output>
</operation>
<operation name="NEW">
<soap:operation soapAction="NEW"/>
<input>
<soap:body parts="parameters" use="literal"/>
</input>
<output>
<soap:body parts="parameters" use="literal"/>
</output>
</operation>
<operation name="GET">
<soap:operation soapAction="GET"/>
<input>
<soap:body parts="parameters" use="literal"/>
</input>
<output>
<soap:body parts="parameters" use="literal"/>
</output>
</operation>
<operation name="DELETE">
<soap:operation soapAction="DELETE"/>
<input>
<soap:body parts="parameters" use="literal"/>
</input>
<output>
<soap:body parts="parameters" use="literal"/>
</output>
</operation>
</binding>
<service name="ACCOUNT_APIService">
<documentation>Oracle Web Service</documentation>
<port name="ACCOUNT_APIPort" binding="tns:ACCOUNT_APIBinding">
<soap:address location="http://127.0.0.1/orawsv/WEB_API/ACCOUNT_API"/>
</port>
</service>
</definitions>But I think you said it was intermittant -
Database Native Web Services : XMLTYPE parameter in PL/SQL with XMLSCHEMA?
Hi,
I would like to build a function with a XMLTYPE parameter which is schema based, something like this:
CREATE FUNCTION xy (p_xml XMLTYPE XMLSCHEMA 'http://myschema.com') ...
At the moment I do the following inside the code:
l_xml := p_xml.createSchemaBasedXML('http://myschema.com');
l_xml.schemavalidate();
/* validate XML against XSD */
l_nbr := l_xml.isschemavalidated();
The purpose why I would like to directly put the schema in the declaration is that I would like to use this function as a Oracle Native Web Service. The web service doesn't know the structure of the xml parameter as the schema is not knows in the declaration.
Thanks and kind regards,
Andreas
Edited by: mdrake on Nov 8, 2009 9:55 PMJust for kicks here's the best I can come up with..
SQL> connect &USERNAME/&PASSWORD
Connected.
SQL> --
SQL> --
SQL> --
SQL> declare
2 XMLSCHEMA XMLTYPE := XMLTYPE(
3 '<!-- edited with XML Spy v4.0 U (http://www.xmlspy.com) by Mark (Drake) -->
4 <xs:schema targetNamespace="http://xmlns.example.com/xsd/purchaseOrder"
5 xmlns="http://xmlns.example.com/xsd/purchaseOrder"
6 xmlns:xs="http://www.w3.org/2001/XMLSchema"
7 xmlns:xdb="http://xmlns.oracle.com/xdb" version="1.0" xdb:storeVarrayAsTable="true">
8 <xs:element name="PurchaseOrder" type="PurchaseOrderType" xdb:defaultTable="PURCHASEORDER"/>
9 <xs:complexType name="PurchaseOrderType" xdb:SQLType="PURCHASEORDER_T">
10 <xs:sequence>
11 <xs:element name="Reference" type="ReferenceType" xdb:SQLName="REFERENCE"/>
12 <xs:element name="Actions" type="ActionsType" xdb:SQLName="ACTIONS"/>
13 <xs:element name="Reject" type="RejectionType" minOccurs="0" xdb:SQLName="REJECTION"/>
14 <xs:element name="Requestor" type="RequestorType" xdb:SQLName="REQUESTOR"/>
15 <xs:element name="User" type="UserType" xdb:SQLName="USERID"/>
16 <xs:element name="CostCenter" type="CostCenterType" xdb:SQLName="COST_CENTER"/>
17 <xs:element name="ShippingInstructions" type="ShippingInstructionsType" xdb:SQLName="SHIPPING_INSTRUCTIONS"/>
18 <xs:element name="SpecialInstructions" type="SpecialInstructionsType" xdb:SQLName="SPECIAL_INSTRUCTIONS"/>
19 <xs:element name="LineItems" type="LineItemsType" xdb:SQLName="LINEITEMS"/>
20 </xs:sequence>
21 </xs:complexType>
22 <xs:complexType name="LineItemsType" xdb:SQLType="LINEITEMS_T">
23 <xs:sequence>
24 <xs:element name="LineItem" type="LineItemType" maxOccurs="unbounded" xdb:SQLName="LINEITEM" xdb:SQLCollType="LINEITEM_V"/>
25 </xs:sequence>
26 </xs:complexType>
27 <xs:complexType name="LineItemType" xdb:SQLType="LINEITEM_T">
28 <xs:sequence>
29 <xs:element name="Description" type="DescriptionType" xdb:SQLName="DESCRIPTION"/>
30 <xs:element name="Part" type="PartType" xdb:SQLName="PART"/>
31 </xs:sequence>
32 <xs:attribute name="ItemNumber" type="xs:integer" xdb:SQLName="ITEMNUMBER" xdb:SQLType="NUMBER"/>
33 </xs:complexType>
34 <xs:complexType name="PartType" xdb:SQLType="PART_T">
35 <xs:attribute name="Id" xdb:SQLName="PART_NUMBER" xdb:SQLType="VARCHAR2">
36 <xs:simpleType>
37 <xs:restriction base="xs:string">
38 <xs:minLength value="10"/>
39 <xs:maxLength value="14"/>
40 </xs:restriction>
41 </xs:simpleType>
42 </xs:attribute>
43 <xs:attribute name="Quantity" type="moneyType" xdb:SQLName="QUANTITY"/>
44 <xs:attribute name="UnitPrice" type="quantityType" xdb:SQLName="UNITPRICE"/>
45 </xs:complexType>
46 <xs:simpleType name="ReferenceType">
47 <xs:restriction base="xs:string">
48 <xs:minLength value="18"/>
49 <xs:maxLength value="30"/>
50 </xs:restriction>
51 </xs:simpleType>
52 <xs:complexType name="ActionsType" xdb:SQLType="ACTIONS_T">
53 <xs:sequence>
54 <xs:element name="Action" maxOccurs="4" xdb:SQLName="ACTION" xdb:SQLCollType="ACTION_V">
55 <xs:complexType xdb:SQLType="ACTION_T">
56 <xs:sequence>
57 <xs:element name="User" type="UserType" xdb:SQLName="ACTIONED_BY"/>
58 <xs:element name="Date" type="DateType" minOccurs="0" xdb:SQLName="DATE_ACTIONED"/>
59 </xs:sequence>
60 </xs:complexType>
61 </xs:element>
62 </xs:sequence>
63 </xs:complexType>
64 <xs:complexType name="RejectionType" xdb:SQLType="REJECTION_T">
65 <xs:all>
66 <xs:element name="User" type="UserType" minOccurs="0" xdb:SQLName="REJECTED_BY"/>
67 <xs:element name="Date" type="DateType" minOccurs="0" xdb:SQLName="DATE_REJECTED"/>
68 <xs:element name="Comments" type="CommentsType" minOccurs="0" xdb:SQLName="REASON_REJECTED"/>
69 </xs:all>
70 </xs:complexType>
71 <xs:complexType name="ShippingInstructionsType" xdb:SQLType="SHIPPING_INSTRUCTIONS_T">
72 <xs:sequence>
73 <xs:element name="name" type="NameType" minOccurs="0" xdb:SQLName="SHIP_TO_NAME"/>
74 <xs:element name="address" type="AddressType" minOccurs="0" xdb:SQLName="SHIP_TO_ADDRESS"/>
75 <xs:element name="telephone" type="TelephoneType" minOccurs="0" xdb:SQLName="SHIP_TO_PHONE"/>
76 </xs:sequence>
77 </xs:complexType>
78 <xs:simpleType name="moneyType">
79 <xs:restriction base="xs:decimal">
80 <xs:fractionDigits value="2"/>
81 <xs:totalDigits value="12"/>
82 </xs:restriction>
83 </xs:simpleType>
84 <xs:simpleType name="quantityType">
85 <xs:restriction base="xs:decimal">
86 <xs:fractionDigits value="4"/>
87 <xs:totalDigits value="8"/>
88 </xs:restriction>
89 </xs:simpleType>
90 <xs:simpleType name="UserType">
91 <xs:restriction base="xs:string">
92 <xs:minLength value="1"/>
93 <xs:maxLength value="10"/>
94 </xs:restriction>
95 </xs:simpleType>
96 <xs:simpleType name="RequestorType">
97 <xs:restriction base="xs:string">
98 <xs:minLength value="0"/>
99 <xs:maxLength value="128"/>
100 </xs:restriction>
101 </xs:simpleType>
102 <xs:simpleType name="CostCenterType">
103 <xs:restriction base="xs:string">
104 <xs:minLength value="1"/>
105 <xs:maxLength value="4"/>
106 </xs:restriction>
107 </xs:simpleType>
108 <xs:simpleType name="VendorType">
109 <xs:restriction base="xs:string">
110 <xs:minLength value="0"/>
111 <xs:maxLength value="20"/>
112 </xs:restriction>
113 </xs:simpleType>
114 <xs:simpleType name="PurchaseOrderNumberType">
115 <xs:restriction base="xs:integer"/>
116 </xs:simpleType>
117 <xs:simpleType name="SpecialInstructionsType">
118 <xs:restriction base="xs:string">
119 <xs:minLength value="0"/>
120 <xs:maxLength value="2048"/>
121 </xs:restriction>
122 </xs:simpleType>
123 <xs:simpleType name="NameType">
124 <xs:restriction base="xs:string">
125 <xs:minLength value="1"/>
126 <xs:maxLength value="20"/>
127 </xs:restriction>
128 </xs:simpleType>
129 <xs:simpleType name="AddressType">
130 <xs:restriction base="xs:string">
131 <xs:minLength value="1"/>
132 <xs:maxLength value="256"/>
133 </xs:restriction>
134 </xs:simpleType>
135 <xs:simpleType name="TelephoneType">
136 <xs:restriction base="xs:string">
137 <xs:minLength value="1"/>
138 <xs:maxLength value="24"/>
139 </xs:restriction>
140 </xs:simpleType>
141 <xs:simpleType name="DateType">
142 <xs:restriction base="xs:date"/>
143 </xs:simpleType>
144 <xs:simpleType name="CommentsType">
145 <xs:restriction base="xs:string">
146 <xs:minLength value="1"/>
147 <xs:maxLength value="2048"/>
148 </xs:restriction>
149 </xs:simpleType>
150 <xs:simpleType name="DescriptionType">
151 <xs:restriction base="xs:string">
152 <xs:minLength value="1"/>
153 <xs:maxLength value="256"/>
154 </xs:restriction>
155 </xs:simpleType>
156 </xs:schema>');
157 begin
158 dbms_xmlschema.registerSchema( SCHEMAURL => '/xsd/purchaseOrder.xsd', SCHEMADOC => XMLSCHEMA);
159 end;
160 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:01.94
SQL> VAR URL VARCHAR2(1024)
SQL> VAR RESULT CLOB;
SQL> --
SQL> create or replace package TESTPROC
2 as
3 function getPurchaseOrder(P_REFERENCE VARCHAR2) return XMLTYPE;
4 function expandWSDL return XMLTYPE;
5 end;
6 /
Package created.
Elapsed: 00:00:00.02
SQL> --
SQL> create or replace package body TESTPROC
2 as
3 --
4 function getPurchaseOrder(P_REFERENCE VARCHAR2)
5 return XMLType
6 as
7 V_RESULT XMLTYPE;
8 begin
9 select object_value
10 into V_RESULT
11 from PURCHASEORDER
12 where XMLEXISTS('$p/PurchaseOrder[Reference=$ref]' passing P_REFERENCE as "ref");
13 return V_RESULT;
14 end;
15 --
16 function getWSDL
17 return XMLType
18 as
19 V_WSDL_URL VARCHAR2(700) := 'http://&USERNAME:&PASSWORD@localhost:' || dbms_xdb.getHttpPort() || '/orawsv/&USERNAME/TESTPROC/GETPURCHASEORDER';
20 V_WSDL XMLTYPE;
21 begin
22 select httpuritype( V_WSDL_URL || '?wsdl' ).getXML()
23 into V_WSDL
24 from dual;
25 return V_WSDL;
26 end;
27 --
28 function expandWSDL
29 return XMLTYPE
30 as
31 V_INTERNAL_URL VARCHAR2(700);
32 V_EXTERNAL_URL VARCHAR2(700);
33 V_NAMESPACE VARCHAR2(4000);
34 V_WSDL XMLTYPE := getWSDL();
35 V_XSD XMLTYPE;
36 begin
37 -- Need to provide real logic to determine which XSD goes with which parameter...
38
39 -- get the TARGETNAMESPACE for the import element (Not sure how this would work with a noNamespace Schema since we'd be in Chamelian Land)
40 select SCHEMA_URL,
41 XMLCAST
42 (
43 XMLQUERY
44 (
45 'declare namespace xsd = "http://www.w3.org/2001/XMLSchema"; (::)
46 $xsd/xsd:schema/@targetNamespace'
47 passing SCHEMA as "xsd" returning content
48 )
49 as VARCHAR2(4000)
50 )
51 into V_INTERNAL_URL, V_NAMESPACE
52 from USER_XML_SCHEMAS
53 where SCHEMA_URL = '/xsd/purchaseOrder.xsd';
54
55 V_EXTERNAL_URL := '/sys/schemas/&USERNAME' || V_INTERNAL_URL;
56
57 -- Add <xsd:import namespace="http://xmlns.example.com/xsd/purchaseOrder" schemaLocation="http://localhost:80/sys/schemas/WSDLTEST/xsd/purchaseOrder.xsd
"/>
58
59 select insertXMLBefore
60 (
61 V_WSDL,
62 '//xsd:schema/child::*[1]',
63 xmlElement("xsd:import",xmlAttributes('http://www.w3.org/2001/XMLSchema' as "xmlns:xsd",V_NAMESPACE as "namespace",V_EXTERNAL_URL as "schemaLoc
ation")),
64 'xmlns:xsd="http://www.w3.org/2001/XMLSchema"'
65 )
66 into V_WSDL
67 from dual;
68
69 select updateXML
70 (
71 V_WSDL,
72 '//xsd:schema/xsd:element[@name="GETPURCHASEORDEROutput"]/xsd:complexType/xsd:sequence/xsd:element[@name="RETURN"]/xsd:complexType',
73 XMLElement
74 (
75 "xsd:complexType",
76 XMLAttributes('http://www.w3.org/2001/XMLSchema' as "xmlns:xsd"),
77 XMLElement
78 (
79 "xsd:sequence",
80 XMLElement
81 (
82 "xsd:element",
83 xmlAttributes('http://xmlns.example.com/xsd/purchaseOrder' as "xmlns:po",'po:PurchaseOrder' as "ref")
84 )
85 )
86 ),
87 'xmlns:xsd="http://www.w3.org/2001/XMLSchema"'
88 )
89 into V_WSDL
90 from dual;
91
92 return V_WSDL;
93 end;
94 --
95 end;
96 /
old 19: V_WSDL_URL VARCHAR2(700) := 'http://&USERNAME:&PASSWORD@localhost:' || dbms_xdb.getHttpPort() || '/orawsv/&USERNAME/TESTPROC/GETPURCHASEORDER';
new 19: V_WSDL_URL VARCHAR2(700) := 'http://WSDLTEST:WSDLTEST@localhost:' || dbms_xdb.getHttpPort() || '/orawsv/WSDLTEST/TESTPROC/GETPURCHASEORDER';
old 55: V_EXTERNAL_URL := '/sys/schemas/&USERNAME' || V_INTERNAL_URL;
new 55: V_EXTERNAL_URL := '/sys/schemas/WSDLTEST' || V_INTERNAL_URL;
Package body created.
Elapsed: 00:00:00.05
SQL> show errors
No errors.
SQL> --
SQL> BEGIN
2 :URL := 'http://&USERNAME:&PASSWORD@localhost:' || dbms_xdb.getHttpPort() || '/orawsv/&USERNAME/TESTPROC';
3 end;
4 /
old 2: :URL := 'http://&USERNAME:&PASSWORD@localhost:' || dbms_xdb.getHttpPort() || '/orawsv/&USERNAME/TESTPROC';
new 2: :URL := 'http://WSDLTEST:WSDLTEST@localhost:' || dbms_xdb.getHttpPort() || '/orawsv/WSDLTEST/TESTPROC';
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
SQL> print url
URL
http://WSDLTEST:WSDLTEST@localhost:80/orawsv/WSDLTEST/TESTPROC
SQL> --
SQL> set long 10000000 pages 0 lines 160
SQL> --
SQL> select httpuritype( :URL || '?wsdl' ).getXML()
2 from dual
3 /
<definitions name="TESTPROC" targetNamespace="http://xmlns.oracle.com/orawsv/WSDLTEST/TESTPROC" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://xmlns
.oracle.com/orawsv/WSDLTEST/TESTPROC" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<types>
<xsd:schema targetNamespace="http://xmlns.oracle.com/orawsv/WSDLTEST/TESTPROC" elementFormDefault="qualified">
<xsd:element name="CXMLTYPE-GETPURCHASEORDERInput">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="P_REFERENCE-VARCHAR2-IN" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="GETPURCHASEORDEROutput">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="RETURN">
<xsd:complexType>
<xsd:sequence>
<xsd:any/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="CXMLTYPE-EXPANDWSDLInput">
<xsd:complexType>
<xsd:sequence>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="EXPANDWSDLOutput">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="RETURN">
<xsd:complexType>
<xsd:sequence>
<xsd:any/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</types>
<message name="GETPURCHASEORDERInputMessage">
<part name="parameters" element="tns:CXMLTYPE-GETPURCHASEORDERInput"/>
</message>
<message name="GETPURCHASEORDEROutputMessage">
<part name="parameters" element="tns:GETPURCHASEORDEROutput"/>
</message>
<message name="EXPANDWSDLInputMessage">
<part name="parameters" element="tns:CXMLTYPE-EXPANDWSDLInput"/>
</message>
<message name="EXPANDWSDLOutputMessage">
<part name="parameters" element="tns:EXPANDWSDLOutput"/>
</message>
<portType name="TESTPROCPortType">
<operation name="GETPURCHASEORDER">
<input message="tns:GETPURCHASEORDERInputMessage"/>
<output message="tns:GETPURCHASEORDEROutputMessage"/>
</operation>
<operation name="EXPANDWSDL">
<input message="tns:EXPANDWSDLInputMessage"/>
<output message="tns:EXPANDWSDLOutputMessage"/>
</operation>
</portType>
<binding name="TESTPROCBinding" type="tns:TESTPROCPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="GETPURCHASEORDER">
<soap:operation soapAction="GETPURCHASEORDER"/>
<input>
<soap:body parts="parameters" use="literal"/>
</input>
<output>
<soap:body parts="parameters" use="literal"/>
</output>
</operation>
<operation name="EXPANDWSDL">
<soap:operation soapAction="EXPANDWSDL"/>
<input>
<soap:body parts="parameters" use="literal"/>
</input>
<output>
<soap:body parts="parameters" use="literal"/>
</output>
</operation>
</binding>
<service name="TESTPROCService">
<documentation>Oracle Web Service</documentation>
<port name="TESTPROCPort" binding="tns:TESTPROCBinding">
<soap:address location="http://localhost:80/orawsv/WSDLTEST/TESTPROC"/>
</port>
</service>
</definitions>
Elapsed: 00:00:00.33
SQL> select TESTPROC.expandWSDL()
2 from dual
3 /
<definitions name="GETPURCHASEORDER" targetNamespace="http://xmlns.oracle.com/orawsv/WSDLTEST/TESTPROC/GETPURCHASEORDER" xmlns="http://schemas.xmlsoap.org/wsdl/
" xmlns:tns="http://xmlns.oracle.com/orawsv/WSDLTEST/TESTPROC/GETPURCHASEORDER" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.
org/wsdl/soap/">
<types>
<xsd:schema targetNamespace="http://xmlns.oracle.com/orawsv/WSDLTEST/TESTPROC/GETPURCHASEORDER" elementFormDefault="qualified">
<xsd:import xmlns:xsd="http://www.w3.org/2001/XMLSchema" namespace="http://xmlns.example.com/xsd/purchaseOrder" schemaLocation="/sys/schemas/WSDLTEST/xsd/
purchaseOrder.xsd"/>
<xsd:element name="CXMLTYPE-GETPURCHASEORDERInput">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="P_REFERENCE-VARCHAR2-IN" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="GETPURCHASEORDEROutput">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="RETURN">
<xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:sequence>
<xsd:element xmlns:po="http://xmlns.example.com/xsd/purchaseOrder" ref="po:PurchaseOrder"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</types>
<message name="GETPURCHASEORDERInputMessage">
<part name="parameters" element="tns:CXMLTYPE-GETPURCHASEORDERInput"/>
</message>
<message name="GETPURCHASEORDEROutputMessage">
<part name="parameters" element="tns:GETPURCHASEORDEROutput"/>
</message>
<portType name="GETPURCHASEORDERPortType">
<operation name="GETPURCHASEORDER">
<input message="tns:GETPURCHASEORDERInputMessage"/>
<output message="tns:GETPURCHASEORDEROutputMessage"/>
</operation>
</portType>
<binding name="GETPURCHASEORDERBinding" type="tns:GETPURCHASEORDERPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="GETPURCHASEORDER">
<soap:operation soapAction="GETPURCHASEORDER"/>
<input>
<soap:body parts="parameters" use="literal"/>
</input>
<output>
<soap:body parts="parameters" use="literal"/>
</output>
</operation>
</binding>
<service name="GETPURCHASEORDERService">
<documentation>Oracle Web Service</documentation>
<port name="GETPURCHASEORDERPort" binding="tns:GETPURCHASEORDERBinding">
<soap:address location="http://localhost:80/orawsv/WSDLTEST/TESTPROC/GETPURCHASEORDER"/>
</port>
</service>
</definitions>
Elapsed: 00:00:00.11
SQL> BEGIN
2 :URL := 'http://&USERNAME:&PASSWORD@localhost:' || dbms_xdb.getHttpPort() || '/orawsv/&USERNAME/TESTPROC/EXPANDWSDL';
3 end;
4 /
old 2: :URL := 'http://&USERNAME:&PASSWORD@localhost:' || dbms_xdb.getHttpPort() || '/orawsv/&USERNAME/TESTPROC/EXPANDWSDL';
new 2: :URL := 'http://WSDLTEST:WSDLTEST@localhost:' || dbms_xdb.getHttpPort() || '/orawsv/WSDLTEST/TESTPROC/EXPANDWSDL';
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
SQL> print url
http://WSDLTEST:WSDLTEST@localhost:80/orawsv/WSDLTEST/TESTPROC/EXPANDWSDL
SQL> --
SQL> set serveroutput on
SQL> --
SQL> VAR WSDL_TEXT CLOB
SQL> --
SQL> DECLARE
2 V_SOAP_REQUEST XMLTYPE := XMLTYPE(
3 '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
4 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
5 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
7 <SOAP-ENV:Body>
8 <m:CXMLTYPE-EXPANDWSDLInput xmlns:m="http://xmlns.oracle.com/orawsv/WSDLTEST/TESTPROC"/>
9 </SOAP-ENV:Body>
10 </SOAP-ENV:Envelope>');
11 V_SOAP_REQUEST_TEXT CLOB := V_SOAP_REQUEST.getClobVal();
12 V_REQUEST UTL_HTTP.REQ;
13 V_RESPONSE UTL_HTTP.RESP;
14 V_BUFFER VARCHAR2(1024);
15 V_RESPONSE_TEXT CLOB;
16 V_RESPONSE_XML XMLTYPE;
17 V_WSDL XMLTYPE;
18 BEGIN
19 DBMS_LOB.CREATETEMPORARY(V_RESPONSE_TEXT, TRUE);
20
21 begin
22 V_REQUEST := UTL_HTTP.BEGIN_REQUEST(URL => :URL, METHOD => 'POST');
23 UTL_HTTP.SET_HEADER(V_REQUEST, 'User-Agent', 'Mozilla/4.0');
24 V_REQUEST.METHOD := 'POST';
25 UTL_HTTP.SET_HEADER (R => V_REQUEST, NAME => 'Content-Length', VALUE => DBMS_LOB.GETLENGTH(V_SOAP_REQUEST_TEXT));
26 UTL_HTTP.WRITE_TEXT (R => V_REQUEST, DATA => V_SOAP_REQUEST_TEXT);
27 V_RESPONSE := UTL_HTTP.GET_RESPONSE(V_REQUEST);
28 LOOP
29 UTL_HTTP.READ_LINE(V_RESPONSE, V_BUFFER, TRUE);
30 DBMS_LOB.WRITEAPPEND(V_RESPONSE_TEXT,LENGTH(V_BUFFER),V_BUFFER);
31 END LOOP;
32 UTL_HTTP.END_RESPONSE(V_RESPONSE);
33 EXCEPTION
34 WHEN UTL_HTTP.END_OF_BODY THEN
35 UTL_HTTP.END_RESPONSE(V_RESPONSE);
36 END;
37
38 V_RESPONSE_XML := XMLTYPE(V_RESPONSE_TEXT);
39
40 select XMLQUERY
41 (
42 'declare namespace SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; (::)
43 declare namespace SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"; (::)
44 declare namespace xsi="http://www.w3.org/2001/XMLSchema-instance"; (::)
45 declare namespace xsd="http://www.w3.org/2001/XMLSchema"; (::)
46 declare namespace m="http://xmlns.oracle.com/orawsv/WSDLTEST/TESTPROC"; (::)
47 $resp/SOAP-ENV:Envelope/SOAP-ENV:Body/m:EXPANDWSDLOutput/m:RETURN/*'
48 passing V_RESPONSE_XML as "resp" returning content
49 )
50 into V_WSDL
51 from DUAL;
52
53 select V_WSDL.getClobVal()
54 into :WSDL_TEXT
55 from dual;
56
57 DBMS_LOB.FREETEMPORARY(V_RESPONSE_TEXT);
58
59 END;
60 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.10
SQL> --
SQL> set pages 0 lines 160 long 10000
SQL> column WSDL format A160
SQL> --
SQL> select xmlserialize(document XMLTYPE(:WSDL_TEXT) as CLOB indent size=2) WSDL
2 from dual
3 /
<definitions name="GETPURCHASEORDER" targetNamespace="http://xmlns.oracle.com/orawsv/WSDLTEST/TESTPROC/GETPURCHASEORDER" xmlns="http://schemas.xmlsoap.org/wsdl/
" xmlns:tns="http://xmlns.oracle.com/orawsv/WSDLTEST/TESTPROC/GETPURCHASEORDER" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.
org/wsdl/soap/">
<types>
<xsd:schema targetNamespace="http://xmlns.oracle.com/orawsv/WSDLTEST/TESTPROC/GETPURCHASEORDER" elementFormDefault="qualified">
<xsd:import xmlns:xsd="http://www.w3.org/2001/XMLSchema" namespace="http://xmlns.example.com/xsd/purchaseOrder" schemaLocation="/sys/schemas/WSDLTEST/xsd/
purchaseOrder.xsd"/>
<xsd:element name="CXMLTYPE-GETPURCHASEORDERInput">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="P_REFERENCE-VARCHAR2-IN" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="GETPURCHASEORDEROutput">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="RETURN">
<xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:sequence>
<xsd:element xmlns:po="http://xmlns.example.com/xsd/purchaseOrder" ref="po:PurchaseOrder"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</types>
<message name="GETPURCHASEORDERInputMessage">
<part name="parameters" element="tns:CXMLTYPE-GETPURCHASEORDERInput"/>
</message>
<message name="GETPURCHASEORDEROutputMessage">
<part name="parameters" element="tns:GETPURCHASEORDEROutput"/>
</message>
<portType name="GETPURCHASEORDERPortType">
<operation name="GETPURCHASEORDER">
<input message="tns:GETPURCHASEORDERInputMessage"/>
<output message="tns:GETPURCHASEORDEROutputMessage"/>
</operation>
</portType>
<binding name="GETPURCHASEORDERBinding" type="tns:GETPURCHASEORDERPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="GETPURCHASEORDER">
<soap:operation soapAction="GETPURCHASEORDER"/>
<input>
<soap:body parts="parameters" use="literal"/>
</input>
<output>
<soap:body parts="parameters" use="literal"/>
</output>
</operation>
</binding>
<service name="GETPURCHASEORDERService">
<documentation>Oracle Web Service</documentation>
<port name="GETPURCHASEORDERPort" binding="tns:GETPURCHASEORDERBinding">
<soap:address location="http://localhost:80/orawsv/WSDLTEST/TESTPROC/GETPURCHASEORDER"/>
</port>
</service>
</definitions>
Elapsed: 00:00:00.03
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
C:\xdb\examples\DBNWS> -
Native Web Services - Java client
Hi.
Is there any example of how to consume a Native Web Service (11g) using a java client? I am having a trouble with this, and I couldn't find any clue so far.
I've been using NetBeans.
Any help would be appreciated.
ThanksI have tried using Axis2. Created the Stub from the WSDL.
Code:
import com.oracle.xmlns.orawsv.bi_demo.filial_cotacao.FILIAL_COTACAOServiceStub;
import org.apache.axis2.client.Options;
import org.apache.axis2.transport.http.HTTPConstants;
import org.apache.axis2.transport.http.HttpTransportProperties;
class FILIAL_COTACAO {
public void filialCOTACAO(){
try { // Call Web Service Operation
FILIAL_COTACAOServiceStub stub = new FILIAL_COTACAOServiceStub();
Options options = stub._getServiceClient().getOptions();
HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator();
auth.setPreemptiveAuthentication(true);
auth.setPassword("bi_demo");
auth.setUsername("bi_demo");
options.setProperty(HTTPConstants.AUTHENTICATE,auth);
FILIAL_COTACAOServiceStub.SVARCHAR2FILIAL_COTACAOInput dados = new
FILIAL_COTACAOServiceStub.SVARCHAR2FILIAL_COTACAOInput();
FILIAL_COTACAOServiceStub.FILIAL_COTACAOOutput resp = new FILIAL_COTACAOServiceStub.FILIAL_COTACAOOutput();
String user = "TESTE";
dados.setUSUARIO$VARCHAR2IN(user);
resp = stub.fILIAL_COTACAO(dados);
System.out.println("Resposta " + resp.getRETURN());
System.out.println("TESTE");
} catch (Throwable e1) {e1.printStackTrace();}
public static void main(String[] args) throws Exception {
FILIAL_COTACAO t = new FILIAL_COTACAO();
t.filialCOTACAO();
But it returns me:
[INFO] Deploying module: metadataExchange-1.5.1 - file:/Users/CInglez/MSV/NetBeansProjects/FILIAL_COTACAO_Axis/dist/lib/mex-1.5.1.jar
org.apache.axiom.soap.SOAPProcessingException: Only Characters are allowed here
at org.apache.axiom.soap.impl.builder.SOAP11BuilderHelper.processText(SOAP11BuilderHelper.java:153)
at org.apache.axiom.soap.impl.builder.SOAP11BuilderHelper.handleEvent(SOAP11BuilderHelper.java:63)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:390)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:227)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElement(StAXSOAPModelBuilder.java:196)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:207)
at org.apache.axiom.om.impl.llom.OMElementImpl.buildNext(OMElementImpl.java:664)
at org.apache.axiom.om.impl.llom.OMNodeImpl.getNextOMSibling(OMNodeImpl.java:141)
at org.apache.axiom.om.impl.traverse.OMChildrenQNameIterator.findNextElementWithQName(OMChildrenQNameIterator.java:96)
at org.apache.axiom.om.impl.traverse.OMChildrenQNameIterator.<init>(OMChildrenQNameIterator.java:53)
at org.apache.axiom.om.impl.llom.OMElementImpl.getFirstChildWithName(OMElementImpl.java:270)
at org.apache.axiom.soap.impl.llom.soap11.SOAP11FaultImpl.getCode(SOAP11FaultImpl.java:124)
at org.apache.axis2.AxisFault.initializeValues(AxisFault.java:202)
at org.apache.axis2.AxisFault.<init>(AxisFault.java:196)
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:435)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:371)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at com.oracle.xmlns.orawsv.bi_demo.filial_cotacao.FILIAL_COTACAOServiceStub.fILIAL_COTACAO(FILIAL_COTACAOServiceStub.java:181)
at FILIAL_COTACAO.filialCOTACAO(FILIAL_COTACAO.java:56)
at FILIAL_COTACAO.main(FILIAL_COTACAO.java:68)
Any clues?
Thanks -
Pulling Data from an imported web service into a data grid - Flex 3.0
Hi all,
I have created a web service from Oracle using JDeveloper and imported it into my Fex 3 project, and I am trying to populate a data grid with the data from the web service. I was trying to emulate the example found in my Adobe Flex 3.0 for Dummies book (see http://dougmccune.com/flexfordummies/chapter14/srcview/index.html), and while the code from the book with that data service works fine, I can't get my application to work. My issue is with the part of code mx:DataGrid dataProvider="(service)" - I do not know how to specify what to use for the data source to populate the data grid from my imported web service. Any suggestions or examples would be helpful, as I am a newcomer to Adobe Flex. My code is as follows:
<?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"xmlns:webservices="
generated.webservices.*">
<mx:Script>
<![CDATA[
private function getData():void {service.getPdRec(ageDt.text);
]]>
</mx:Script>
<webservices:PD_Pct_Web_Service id="service" />
<mx:VBox>
<mx:HBox width="100%">
<mx:TextInput id="ageDt" width="100%" />
<mx:Button id="submitButton" label="Search" click="getData()" />
</mx:HBox>
<mx:DataGrid dataProvider="(service.getPdRec_lastResult
" rowHeight="
58" width="100%" height="300">
<mx:columns>
<mx:DataGridColumn dataField="creditManager" headerText="Credit Manager" width="40" />
<mx:DataGridColumn dataField="pdTarget" headerText="PD Target" width="40" />
<mx:DataGridColumn dataField="totalPd" headerText="Total PD" width="40" />
<mx:DataGridColumn dataField="pdPct" headerText="PD Percent" width="50" />
</mx:columns>
</mx:DataGrid>
</mx:VBox>
</mx:Application>
My web service returns the following when invoked:
<env:Envelope
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns0="http://erec_db/PD_Pct_Web_Service.wsdl/types/">
<env:Body>
<ns0:getPdRecResponseElement>
<ns0:result>
<ns0:creditManager>Cobb</ns0:creditManager>
<ns0:pdTarget>10</ns0:pdTarget>
<ns0:totalPd>147.65</ns0:totalPd>
<ns0:pdPct>26.77</ns0:pdPct>
</ns0:result>
<ns0:result>
<ns0:creditManager>Collova</ns0:creditManager>
<ns0:pdTarget>10</ns0:pdTarget>
<ns0:totalPd>27.71</ns0:totalPd>
<ns0:pdPct>21.67</ns0:pdPct>
</ns0:result>
<ns0:result>
<ns0:creditManager>Lee</ns0:creditManager>
<ns0:pdTarget>10</ns0:pdTarget>
<ns0:totalPd>33.61</ns0:totalPd>
<ns0:pdPct>72.38</ns0:pdPct>
</ns0:result>
<ns0:result>
<ns0:creditManager>Maynard</ns0:creditManager>
<ns0:pdTarget>10</ns0:pdTarget>
<ns0:totalPd>74.19</ns0:totalPd>
<ns0:pdPct>33.69</ns0:pdPct>
</ns0:result>
<ns0:result>
<ns0:creditManager>Ong</ns0:creditManager>
<ns0:pdTarget>10</ns0:pdTarget>
<ns0:totalPd>13.26</ns0:totalPd>
<ns0:pdPct>46.06</ns0:pdPct>
</ns0:result>
</ns0:getPdRecResponseElement>
</env:Body>
</env:Envelope>Use data binding. <mx:DataGrid dataProvider="{service.getPdRec_lastResult}"
-Radhakrishna -
11G - XDB Native Web Services - how to create a web service proxy
Hi,
I am working on XDB Native web Services (http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28369/xdb_web_services.htm#CHDDBCHB). I want to create a proxy web service for orawsv service (http://server:port/orawsv?wsdl), which is protected by an user/password
In Jdeveloper 10133:
+ copy orawsv wsdl (http://server:port/orawsv?wsdl) in local file
+ create a proxy web service form the local wsdl (from the wizard)
+ implement the client (http://www.oracle.com/technology/obe/11gr1_db/datamgmt/xmldb2_b/xmldb2_b.htm)
==> OK
In Jdeveloper 11g
+ copy orawsv wsdl (http://server:port/orawsv?wsdl) in local file
+ create a proxy web service form the local wsdl (from the wizard)
+ how to implement the client : there is no method to set a password
any ideas?
Thanks for your help,
Cyryl
Edited by: cbalmati on Oct 21, 2008 6:26 AMI'm working on getting a proxy web service working in 11g and the contents of this thread is close to answering my question.
The web service proxy is accessing a service that requires a SOAP Security header.
In looking at the previous post, I thought that by using the BindingProvider API I could add the security settings. But when I invoke the proxy I consistently get the following error response from the (PeopleSoft) web service: "com.sun.xml.ws.client.ClientTransportException: request requires HTTP authentication: Unauthorized'
In contrast to that error, when I use JDeveloper's HTTP Analyzer, I get a successful response from the web service. Below is what the raw HTTP looks like:
POST https://isiswebdev.services.wisc.edu:7002/PSIGW/PeopleSoftServiceListeningConnector HTTP/1.1
Content-Type: text/xml; charset=UTF-8
Host: isiswebdev.services.wisc.edu:7002
SOAPAction: "CI_U_FA_CSA_STDTA_CI_G.V2"
Content-Length: 548
X-HTTPAnalyzer-Rules: 1
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:ns2="http://xmlns.oracle.com/Enterprise/Tools/schemas/M183895.V1">
<env:Header>
<ns1:Security>
<ns1:UsernameToken>
<ns1:Username>UserName</ns1:Username>
<ns1:Password>XXXXXXX</ns1:Password>
</ns1:UsernameToken>
</ns1:Security>
</env:Header>
<env:Body>
<ns2:Get__CompIntfc__U_FA_CSA_STDTA_CI>
<ns2:EMPLID>012345678912</ns2:EMPLID>
</ns2:Get__CompIntfc__U_FA_CSA_STDTA_CI>
</env:Body>
</env:Envelope>
Here's the Java code that I'm using to try to make the same call:
public void callIWebservice(String emplId){
cSA_STDNT_DATA = new CSA_STDNT_DATA();
CI_U_FA_CSA_STDTA_CI_PortType port = cSA_STDNT_DATA.getCI_U_FA_CSA_STDTA_CI_Port();
Map<String, Object> requestContext = ((BindingProvider)port).getRequestContext();
requestContext.put(BindingProvider.USERNAME_PROPERTY, "UserName");
requestContext.put(BindingProvider.PASSWORD_PROPERTY,"XXXXXXX");
GetCompIntfcUFACSASTDTACITypeShape CiType = new GetCompIntfcUFACSASTDTACITypeShape();
EMPLIDTypeShape emplIDType = new EMPLIDTypeShape();
emplIDType.setValue(emplId);
CiType.setEMPLID(emplIDType);
try {
GetCompIntfcUFACSASTDTACIResponseTypeShape response = port.getDATA(CiType);
System.out.println(response.getCUMGPA());
} catch (M464939V1 e) {
System.out.println(e.getFaultInfo());
But, alas, I just get the ClientTransportException.
Is the Bindingprovider interface the correct way to add the soap security headers? Or am I following the wrong path?
Any help will be greatly appreciated. -
XDB Native Web Services - Collection of object types
Hello,
my DB 11g (11.1.0.6.0) is enabled to use XDB Native Web Services, everything works as it should. I already use it successfully to publish a web service with object types as OUT parameter. They are created as complex types in the XML response as described here: [http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28369/xdb_web_services.htm#CHDGBFID]
But what I need is a collection of these object types, e.g.
I have a type FLIGHT with some information elements (departure, arrival, date, time, price) and I have a web service function GET_AVAILABILITY with parameters departure, arrival and date. What I want is to return a collection of FLIGHT objects, it could be none, one or many flights for a request.
For the moment I create another object type which contains a fix number of FLIGHT objects to work around the collection issue:
create flight_tab_typ as object (
fl1 flight_typ
,fl2 flight_typ
,fl3 flight_typ
I tried to build a PL/SQL table of object type and also a VARRAY of object type but for both the WSDL of the web service cannot be build up correctly in the web browser. For me it seems that this is not supported by the Native Web Services.
I know I can build up my own XMLTYPE with XML structure as OUT parameter but to use object types is much easier and it builds up the XML structure automatically.
Does anybody know how to use collections (VARRAY or PL/SQL Tables) with the Native XML DB Web Services?
Thanks,
AndreasHi flea,
I use complex types with XDB native webservices. Here is an example. Using people/groups objects. I haven't compiled this so there may be some typos etc, but it should give you the idea.
Beware!I have had problems with the created WSDL file in that it doesn't always include the namespace from all types. In many client packages ( JDevloper , SOAPUI etc) this causes a wsdl import failure.
You can add the missing namespace by hand a load the WSDL file locally and then it should work. I haven't raised an SR with Oracle about this yet.
Assume you create the following under SCoTT schema on machine host.com on port 8080.
The webservice[WSDL] will be available from
http://host.com:8080/orawsv/SCOTT/WEBSERVCIES/GET_GROUP[?wsdl]
For other peoples sanity it took me a little while to realise the WSDL url is case specific. E.g. the schema, package and functions have to be UPPER case.
create table people_groups_tab (group_name varchar2(40 char),first_name varchar2(40 char),last_name varchar2(40 char))
insert into people_groups_tab values ('FINANCE','Joe','Bloggs')
insert into people_groups_tab values ('FINANCE','Bob','Jones')
insert into people_groups_tab values ('IT','Alan','Andrews')
create or replace type person_obj
as object
first_name people_groups_tab.first_name%type
,last_name people_groups_tab.last_name%type
create or replace type people_obj
as table of person_obj
create or replace type people_groups_obj
as object
group_name varchar2(40 char)
people people_obj
create or replace package webservices
as
function get_group
p_group_name varchar2
) return people_groups_obj;
end;
create or replace package body webservices
as
function get_group
p_group_name varchar2
) return people_groups_obj
as
l_group people_groups_obj;
l_people people_obj;
begin
select person_obj
first_name
,last_name
bulk collect into l_people
from people_groups_tab
where group_name p_group_name;
l_group := people_groups_obj(p_group_name,l_people);
return l_group;
end;
end;
/
Maybe you are looking for
-
Posting Payroll results to FI with special G/L account
Hi, We need to post some payroll results to special G/L accounts. SAP documentation say it's not possible. How can we manage that? any solution or suggestion is welcome. Thanks K.
-
OIM 11gR1 Design Console displays nothing
The Design Console stopped displaying anything: we can successfully connect to it, but it doesn't show anything at all, no object nor tree on the left/navigation pane, and all menu items are greyed-out. Any ideas what might be going on? All Authoriza
-
Hi guys, I currently have an odd problem. I am finally using Netbeans on my Mac. I currently use it on my Windows machine as well. On my Windows machine if gives you this option up by the toolbar to either have Design or Source showing. I mainly want
-
When I upgrade to Snow Leopard, do I need to reinstall all of my programs?
When I upgrade to Snow Leopard from OS x 10.4.11, do I need to reinstall all of my programs, such as Microsoft Office Suite?
-
Safari 3.1.1 crashes all the time
I just downloaded the newest version of safari. My system is 10.4 and my computer a bit older--a 1.33ghz powerbook G4. Immediately after installing the newest safari, I've found that it crashes all the time when I'm going to websites that I regularly