Using non_build_in data type in web service
Hi everybody,
Can anyone tell me the process of using a data type which is not supported in java web services(data types such as "DATE",...)???
Any examples can be helpful.
Thanks in advance
Hi everybody,
Can anyone tell me the process of using a data type which is not supported in java web services(data types such as "DATE",...)???
Any examples can be helpful.
Thanks in advance
Similar Messages
-
Problem with datetime data type in Web Service
Hi,
I created local ABAP proxy based on a WSDL and some of the fields for the SOAP methods has data type datetime:
name="MsgEndTimeStamp" type="s:dateTime" />
name="MsgStatus" type="s:string"/>
Since ABAP stack doesnt support dataTime data type it has created the proxy method with data type STRING. Now when I call the proxy method (consuming the service) I get an error:
<CODE>SoapFaultCode:4</CODE>
<ERRORTEXT>Server was unable to read request. --> There is an error in XML document (1, 626). --> String was not recognized as a valid DateTime.</ERRORTEXT>
I am sure others have faced the same issue. Can someone help?
ThanksThanks but I dont think that link is much relevant to the problems I am facing, because I cannot change the web service definition as it is used by many others. Also the target application runs on oracle so thats why some of the fields are datetime and I dont want to change that, even if I could.
I am just stuck in creating the wrapper program to call the service since the SAP converts datetime data type to string and when the messages gets to the application it cannot convert string -> datetime.
thanks anyway -
Working with complex data types in web services ...
Hi All,
I have created a webservice and created an interface for that in ADF. Now as my web service returns a complex data type, i followed the steps given in this article "http://www.oracle.com/technology/products/jdev/howtos/1013/wsadf/adfcomplexwstypes.html" and it works fine, my results also get displayed. But only issue is i get a warning "JBO-25009: Cannot create an object of type:java.util.calendar with value:2008-09-23T23:51:30.000+05:30" and if i replace all the java.util.Date with oracle.jbo.domain.Date then i get a warning "JBO-25009: Cannot create an object of type:oracle.jbo.domain.Date with value:2008-09-23T23:51:30.000+05:30". Now i am unable to understand this although i believe it is a data type mapping issue, but not sure how to rectify it.
Anybody knows the wayout?
Regards
LokeshAndre,
Thanks for youe response. I also tried makeing data type as string in place of date in data control.xml and it worked fine. So it confirms that i am facing with exactly similar issue as yours.
I tried solution 2 mentioned in Frank's mail but its not helping[in fact i am already using web proxy as i am delaing with complex data types]. I created a web proxy and in java bean i placed break points to check the control flow[in order to check the root cause] but control never reaches the java bean!! I am not sure about the cause for it...control should pass through java bean isn't it??
I am quite new to SOA...so can somebody just elaborate on how to rectify this using web proxy. I have been using this rl "http://www.oracle.com/technology/products/jdev/howtos/1013/wsadf/adfcomplexwstypes.html" to work with web proxies" to work with proxies.
Regards
Lokesh -
Custom/Complex data types in web services
Hi,
I've read in several articles here on otn that JDev 9.0.3 would have better support for
creating web services with complex datatypes (like java.util.LinkedList), but still (in the 9.0.3 Preview)
theese methods are greyed out on the web service wizard. Am I missing something?
Until now I've worked with Custom Serializers, but they are time consuming and hard to work with.
/MattiasHere are the two articles that will help:
JavaBeans as Web services parameter types:
http://otn.oracle.com/tech/webservices/htdocs/samples/customtype/content.html
Registering Web services custom serializers:
http://otn.oracle.com/tech/webservices/htdocs/samples/serialize/content.html
The new support in JDev 9.0.3 is that JavaBean parameters are now recognized by the JDev publishing wizards whereas in JDev 9.0.2 there was the workaround pointed to by the first article. In 9.0.2 the publishing support was only for primitive data types.
The upside of the custom serializers, is you can re-use your existing serializers if they happen to have been written to Apache SOAP.
Mike. -
Custom data types for Web Service services
Instead of language primitives (int, double) or Strings, is it possible to define custom data types (i.e. classes) for use in a service method argument or as a service return type? For example, if I create a class called MyClass then could I use it as an argument n a service as follows: someServiceMethod( MyClass myClassInstance). A service returning the custom type might look like this: MyClass getTheClassServiceMethod(String someString). Are either of these ideas possible?
Hi there,
you can use your own classes as service method argument or return type. But you should not forget to do a type mapping on both the service and client side.
I can tell you, how I am sending and receiving my own datatype called "FileBean" which is a simple JavaBean with getter() and setter() methods for the properties.
I'm using axis for deployment and tomcat as the web server, where my service runs on (currently only local but in future this will be remote).
Service class: "InstallationService.java"
Bean class: "FileBean.java"
Client class: "FileSaving.java"
My deploy.wsdd file has the following entry:
<beanMapping qname="myNS:FileBean"
xmlns:myNS="http://packageDelarationBackwards"
languageSpecificType="java:packageDeclaration.FileBean"/>
...The method header in my service:
public FileBean storeAttachments(FileBean file)The important part of my Client:
QName qnFileBean = new QName("http://packageDelcarationBackwards", "FileBean");
call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpointURL) );
call.setOperationName(new QName("InstallationService","storeAttachments"));
call.setReturnType(qnFileBean);
call.registerTypeMapping(
FileBean.class,
qnFileBean,
new BeanSerializerFactory(FileBean.class, qnFileBean),
new BeanDeserializerFactory(FileBean.class, qnFileBean));
....After deploying the service and starting the server I can send my "FileBean", work with it and give it back.
Hope this helped. If you need more information, just let me know.
Steffi -
Support for xs:date types in web services generated from EJB components
I need to generate a Web Service from an EJB session bean based upon EJB entities generated from the Oracle 11g database that contain DATE type columns.
JDeveloper creates java.sql.Timestamp types in the EJB Session bean and this results in an exception error when I try to generate a web service from this bean via webservice annotations:
java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
java.sql.Timestamp does not have a no-arg default constructor
I expected the web service wizard to generate argument types xs:dateTime or xs:date so this was an unwelcomed surprise.
I tried manually adding a method to the session bean with java.util.date arguments and had no problems with the web service wizard that correctly created xs:dateTime arguments. Is there any particular reason why the EJB wizard does not generate java.util.date arguments or handle java.sql.Timestamp without failing with an exception?
Since I begin with database tables and generate EJB entity classes and then web services with the Jdeveloper wizards it seems to me that there is a problem here in JDeveloper. Would you agree?
There are several possible more or less appealing workarounds, such as doing manually adding methods to the EJB facade with java.util.date arguments and doing the conversion from/to java.sql.timestamp manually. Is this a reasonable approach or does JDeveloper support date/time for Date columns in some other way that I have missed?
Very Grateful for any comments or suggestions.
Edited by: user10601664 on May 2, 2009 1:14 PM
Edited by: user10601664 on May 2, 2009 1:43 PMCheckout this example:
http://www.manojc.com/?sample3
public class HelloWorldService{
* @wlws:exclude
public void dontExpose(){
Regards,
-manoj
http://manojc.com
"Jacob Anderson" <[email protected]> wrote in message
news:4036581e$[email protected]..
>
hello,
I created the descriptor file for a web service that had a protectedmethod in
it and noticed the protected method showed up in the descriptor file!Should
the "source2wsdd" task only output PUBLIC methods as service actions? Isthere
any way to specify methods to be 'ignored' when generating the webservices descriptor
file?
here was the generated descriptor XML:
<web-service name="BindingService"
protocol="https"
style="document"
targetNamespace="http://www.foo.com/ws/BindingService/"
portName="BindingServicePort"
uri="/BindingService"
portTypeName="BindingServicePort">
<types>
</types>
<wsdd:type-mappingxmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdd="http://www.bea.com/servers/wls70">
<wsdd:type-mapping-entrydeserializer="weblogic.xml.schema.binding.internal.builtin.DocumentCodec"
type="xsd:anyType"
class-name="org.w3c.dom.Document"
serializer="weblogic.xml.schema.binding.internal.builtin.DocumentCodec">
</wsdd:type-mapping-entry>
</wsdd:type-mapping>
<components>
<java-class name="BindingService"
class-name="com.arrow.ws.vendor.BindingService">
</java-class>
</components>
<operations>
<operation name="getConfigName"
component="BindingService"
method="getConfigName()">
<params>
<return-param xmlns:typeNS="http://www.w3.org/2001/XMLSchema"
location="body"
type="typeNS:string"
name="result"
class-name="java.lang.String">
</return-param>
</params>
</operation>
</operations>
</web-service> -
How to Use SOAPArray to Exchanged Data with a Web Service
The method of a prototype Web service I created is defined to take many parameters
and return an object of a user defined class. Furthermore, the user defined class
includes data elements of another user defined class and the Java ArrayList class.
This works with a Java client referencing the WebLogic created client.jar file
but I don't know how well it will work with a non-Java client. In particular,
with Perl which is the language that will be used by the developer who first will
test with the prototype.
In posts to this newsgroup use of "language-specific, generic containers" has
been discouraged and the "language-agnostic" SOAPArray recommended. I have searched
this newgsroup and the Web for examples of how to use a SOAPArray in a Web service
EJB to receive parameters and return results but found none.
Will someone refer me to an example or give an overview of how a Java Web service
EJB running in WebLogic 6.1 would use SOAPArray to get parameter values and return
results?
Also, I would like confirmation that it is best to use SOAPArray to exchange data
with a Web service to achieve the goal of a service accessible by any language.
Thank you.Replies in-line:
How are the structures, e.g. gltrans-workType, defined in the Web service?The structure is made up of nested Java Beans, but this does not mean that the
client for your web service has to be written in Java. The WSDL that I sent contains
everything that a .NET-based (or Perl-based, or Python-based, or VB-based, or
C++ based) Web Service Stack needs to correctly create all the data types in the
web services' signature! That's the beauty of XML Schema! It's programming language
independent :-)
In
other words, what definition in Java resulted in the WSDL statements?The WSDL wasn't produced by WLS 6.1, but it (WLS 6.1) can consume it.
What is the signature of method submitGLTransWorkAsJavaBean() in the
Web service?public void submitGLTransWorkAsJavaBean(GlTransactionsCpyType glTransactionsCpyType)
GlTransactionsCpyType is the outer-most Java Bean. WLS 6.1 does not generate
Java Beans for you, but it will use ones that you defined. See the Java Bean tutorial
on the Javasoft sitem for details on how to create a Java Bean.
Was the WSDL generated using the WL tools for creating a Web service?No.
Conclusion:
You asked for someone to provide you with an example of how to use SOAP array
in a WSDL, which is what the attached file contained :-) What you want to do now
is find a tool that can generate Java Bean code from this WSDL (Apache Axis has
a wsdl2java tool that should work), or create the Java Beans yourself. Afterwards,
create a WLS 6.1 Web Service a expose it for a Perl or .NET client.
Regards,
Mike Wooten
"Jeff Carey" <[email protected]> wrote:
>
Please elaborate.
How are the structures, e.g. gltrans-workType, defined in the Web service?
In
other words, what definition in Java resulted in the WSDL statements?
What is the signature of method submitGLTransWorkAsJavaBean() in the
Web service?
Was the WSDL generated using the WL tools for creating a Web service?
Thank you.
"Michael Wooten" <[email protected]> wrote:
Hi Jeff,
Sounds like a pretty cool prototype :-)
I have attached a WSDL (at the bottom of this post) that contains a<schema>
that
uses a SOAPArray to create an array of a <complexType>.
HTH,
Mike Wooten
"Jeff Carey" <[email protected]> wrote:
The method of a prototype Web service I created is defined to take
many
parameters
and return an object of a user defined class. Furthermore, the user
defined class
includes data elements of another user defined class and the Java ArrayList
class.
This works with a Java client referencing the WebLogic created client.jar
file
but I don't know how well it will work with a non-Java client. Inparticular,
with Perl which is the language that will be used by the developerwho
first will
test with the prototype.
In posts to this newsgroup use of "language-specific, generic containers"
has
been discouraged and the "language-agnostic" SOAPArray recommended.
I have searched
this newgsroup and the Web for examples of how to use a SOAPArray in
a Web service
EJB to receive parameters and return results but found none.
Will someone refer me to an example or give an overview of how a Java
Web service
EJB running in WebLogic 6.1 would use SOAPArray to get parameter values
and return
results?
Also, I would like confirmation that it is best to use SOAPArray toexchange
data
with a Web service to achieve the goal of a service accessible by any
language.
Thank you. -
Data Federator - Building Web Services Data Source - Request Guidance
Hello -
I am trying to build a web services data source in Data Federator.
I have:
1. In ECC, I have created a web service, proxy, port, endpoint, etc. and am testing it with WS Navigator
2. I have created a Project in Data Federator of the type web service
a. Here I have assigned the WSDL URL (generated in ECC) as the URL
b. I have setup web service authentication using the same userid, pwd in the web services definition (note: I have set the
web services authentication to 'NONE' to avoing authorization issues)\
c. I am now trying to "Generate Operations"
I keep getting the error :
The File Access Parameters are not valid (directory path = <HERE IS THE PATH TO THE WSDL WITH THE HOST/PORT stripped OUT>; file pattern = document
I believe that it is finding the WSDL, becuase when I change the WSDL from 'Document' to 'RPC', the error changes with the file pattern = rpc.
What needs to be done to the file access parameter piece.
PLEASE provide guidance. Thanks.
- abhiAnanya,
We are using XI to load data to BI from source system. XI basically uses the same concept as Web Services - Real time data concept via RFC embeded in Proxies.
I was using web services to test data load - eventually we will use XI.
KJs blog is pretty good. I was able to get data loaded - after several iterations and several OSS notes. It is still not perfect - there are several manual steps . I am going to pick KJs brain on that.
We are on SP10 and looks like there are several bugs in RSRDA. Some of these are addressed in SP11 an SP12.
Some notes to consider are
0001003963, 0001008276,0001009260 and 001003265.
Let me know if you have any questions. -
Trying to pass xml data to a web service
I'm working on an Apex application that is required to pass data to a web service for loading into another (non Oracle) system. The web service expects two stings as input, the first string is simply an ID, the second string is an xml document. I generate an xml 'string' using PL/SQL in an on-submit process prior to invoking the web service. If I pass regular text for the second parameter, the web service returns an error message which is stored in the response collection and displayed on the page as expected. When I pass the the xml data, I get a no data found error and the response collection is empty. I have tried this in our development environment on Apex 3.1.2 (database version 10.2). I also tried this on our Apex 4.0.2 sandbox (with the same Oracle 10.2 database). I have found that once I have nested xml, I get the no data found message, if I pass partial xml data, I get the error response from the web service. Perhaps I am not generating the xml correctly to pass to the web service (this only just occurred to me as I write this)? Or is there an issue passing xml data from Apex to the web service? Any help will be greatly appreciated! here is the code I use to generate the xml string:
declare
cursor build_data is
select u_catt_request_buid,u_catt_request_name,u_catt_cassette_buid,u_catt_cassette_name
,u_project_name,u_sub_project,replace(u_nominator,'ERROR ','') u_nominator
,replace(replace(u_going_to_vqc,'Yes','true'),'No','false') u_going_to_vqc
,u_promoter,u_cds,u_terminator
,u_primary_trait,u_source_mat_prvd,u_pro_resistance_1,u_vector_type
,nvl(u_my_priority,'Medium') u_my_priority
,replace(replace(u_immediate_trafo,'Yes','true'),'No','false') u_immediate_trafo
,replace(replace(u_new_bps_cmpnt,'Yes','true'),'No','false') u_new_bps_cmpnt
,u_compnt_name,u_new_cmpt_desc,initcap(u_target_crop) u_target_crop,u_corn_line
,u_plant_selection,u_num_of_ind_events,u_num_plants_per_event,u_molecular_quality_events
,replace(replace(u_field,'Yes','true'),'No','false') u_field
,u_t1_seed_request,u_potential_phenotype,u_submission_date
,u_sequence_length,u_trait,u_frst_parent,u_frst_parent_vshare_id,u_cds_vshare_id
,constructid,cassetteid,description
from temp_constructs_lims
order by constructid,description;
v_xml_info varchar2(350);
v_xml_header varchar2(1000);
v_xml_data clob;
v_xml_footer varchar2(50);
v_create_date varchar2(10);
v_scientist_name v_users.full_name%type;
v_scientist_email v_users.email_address%type;
v_primas_code construct.fkprimas%type;
v_nominator_name v_nominators.full_name%type;
v_file_length number;
begin
-- initialize variables
v_create_date := to_char(sysdate,'YYYY-MM-DD');
v_xml_data := null;
-- get name and email address
begin
select full_name,email_address
into v_scientist_name,v_scientist_email
from v_users
where ldap_account = :F140_USER_ID;
exception when no_data_found then
v_scientist_name := '';
v_scientist_email := '';
v_scientist_name := 'Test, Christine';
v_scientist_email := '[email protected]';
end;
-- set up xml file
if :OWNER like '%DEV%' then
v_xml_info := '
<?xml version="1.0" encoding="utf-8"?>
<exchange xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="deService"
xsi:schemaLocation="deService http://mycompany.com/webservices/apexdataexchange/schemas/RTPCATT.xsd">
else
v_xml_info := '
<?xml version="1.0" encoding="utf-8"?>
<exchange xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="deService"
xsi:schemaLocation="deService http://mycompanyprod.com/webservices/apexdataexchange/schemas/RTPCATT.xsd">
end if;
-- populate xml header records
v_xml_header := '<header xmlns="">
<stdXmlVer>2.0</stdXmlVer>
<sendingUnit>'||:P36_UNIT_NUMBER||'</sendingUnit>
<sendingPerson>'||v_scientist_name||'</sendingPerson>
<notification>'||v_scientist_email||'</notification>
<creationDate>'||v_create_date||'</creationDate>
</header>
<entities xmlns="">
for rec in build_data loop
begin
-- get primas code for current construct
select fkprimas
into v_primas_code
from construct
where constructid = rec.constructid;
exception when no_data_found then
v_primas_code := null;
end;
begin
-- get nominator name for current construct
select full_name
into v_nominator_name
from v_nominators
where nominator_id = rec.u_nominator;
exception
when no_data_found then
v_nominator_name := null;
when invalid_number then
v_nominator_name := catt_pkg.full_name_from_user_id(p_user_id => rec.u_nominator);
v_nominator_name := 'Test, Christine';
end;
v_xml_data := v_xml_data||'
<Construct>
<requestBUID>'||rec.u_catt_request_buid||'</requestBUID>
<requestName>'||rec.u_catt_request_name||'</requestName>
<cassetteBUID>'||rec.u_catt_cassette_buid||'</cassetteBUID>
<cassetteName>'||rec.u_catt_cassette_name||'</cassetteName>
<scientist>'||v_scientist_name||'</scientist>
<projectNumber>'||v_primas_code||'</projectNumber>
<subProject>'||rec.u_sub_project||'</subProject>
<comments>'||rec.description||'</comments>
<nominator>'||v_nominator_name||'</nominator>
<goingToVqc>'||rec.u_going_to_vqc||'</goingToVqc>
<primaryTrait>'||rec.u_primary_trait||'</primaryTrait>
<sourceMatPrvd>'||rec.u_source_mat_prvd||'</sourceMatPrvd>
<prokaryoticResistance>'||rec.u_pro_resistance_1||'</prokaryoticResistance>
<vectorType>'||rec.u_vector_type||'</vectorType>
<priority>'||rec.u_my_priority||'</priority>
<immediateTrafo>'||rec.u_immediate_trafo||'</immediateTrafo>
<newComponent>'||rec.u_new_bps_cmpnt||'</newComponent>
<componentName>'||rec.u_compnt_name||'</componentName>
<newComponentDescription>'||rec.u_new_cmpt_desc||'</newComponentDescription>
<targetCrop>'||rec.u_target_crop||'</targetCrop>
<Line>'||rec.u_corn_line||'</Line>
<plantSelection>'||rec.u_plant_selection||'</plantSelection>
<numOfIndEvents>'||rec.u_num_of_ind_events||'</numOfIndEvents>
<numOfPlantsPerEvent>'||rec.u_num_plants_per_event||'</numOfPlantsPerEvent>
<molecularQualityEvents>'||rec.u_molecular_quality_events||'</molecularQualityEvents>
<toField>'||rec.u_field||'</toField>
<potentialPhenotype>'||rec.u_potential_phenotype||'</potentialPhenotype>
</Construct>
end loop;
-- complete xml data
v_xml_footer := '
</entities>
</exchange>
-- complete submission data
:P36_XML_SUBMISSION := null;
:P36_XML_SUBMISSION := v_xml_info||v_xml_header||v_xml_data||v_xml_footer;
:P36_XML_SUBMISSION := trim(:P36_XML_SUBMISSION);
end;Here is an example of :P36_XML_SUBMISSION:
<?xml version="1.0" encoding="utf-8"?> <exchange xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="deService" xsi:schemaLocation="deService http://mycompany.com/webservices/apexdataexchange/schemas/RTPCATT.xsd"> <header xmlns=""> <stdXmlVer>2.0</stdXmlVer> <sendingUnit>10</sendingUnit> <sendingPerson>Test, Christine</sendingPerson> <notification>[email protected]</notification> <creationDate>2011-12-20</creationDate> </header> <entities xmlns=""> <Construct> <requestBUID>150000123</requestBUID> <requestName>AA0000123</requestName> <cassetteBUID>160000123</cassetteBUID> <cassetteName>AB000123</cassetteName> <scientist>Test, Christine</scientist> <projectNumber>T000123</projectNumber> <subProject>Discovery Plus</subProject> <comments>AA0000123 From CATT on 20-DEC-11 </comments> <nominator>Test, Christine</nominator> <goingToVqc>true</goingToVqc> <primaryTrait>promoter::intron::transit:gene::terminator</primaryTrait> <sourceMatPrvd>seed - stuff</sourceMatPrvd> <prokaryoticResistance></prokaryoticResistance> <vectorType>Plant Vector</vectorType> <priority>Medium</priority> <immediateTrafo>true</immediateTrafo> <newComponent></newComponent> <componentName>gene</componentName> <newComponentDescription>unknown function; sequence has some similarity to others</newComponentDescription> <targetCrop>Crop</targetCrop> <Line>Inbred</Line> <plantSelection>smidge ver2</plantSelection> <numOfIndEvents>6</numOfIndEvents> <numOfPlantsPerEvent>1</numOfPlantsPerEvent> <molecularQualityEvents>NA</molecularQualityEvents> <toField>true</toField> <potentialPhenotype></potentialPhenotype> </Construct> </entities> </exchange>My application page is accessed by an action from another page. The user reviews the data in a sql report region. When the use clicks on the Upload (SUBMIT) button, the xml string is generated first and then the web service is invoked. I have tried passing a simple string as the second parameter ("dummydata") and partial data in the xml string ("<sendingPerson>Test, Christine</sendingPerson>") the web service returns this error in both cases:
Error[Validate Data]: (XML) = Data at the root level is invalid. Line 1, position 1.. Cannot validate the XML! Data Exchange not accepted!Once I pass the entire xml string above, I get an Oracle-01403: no data found error. I have opened the web service in IE and pasted my xml input string and received a valid, verified result, so I am sure that the generated xml is correct. I have spoken with the web service developer; there are no log entries created by the web service when I submit the full xml string, so I suspect the failure is in the Apex application.
Thanks,
Christine
I should add that once I have nested tags in the xml, I get the Oracle no data found error ("<header xmlns=""> <stdXmlVer>2.0</stdXmlVer> <sendingUnit>10</sendingUnit> </header>"). I f I do not have nested tags in the xml ("<notification>[email protected]</notification> <creationDate>2011-12-20</creationDate>"), I get the web service response (error).
Edited by: ChristineD on Dec 20, 2011 9:54 AMOk, I think I'm getting closer to thinking this all the way through. When I have used clobs in the past, I've always used the DBMS_CLOB package. I use this to create a temp clob and then make the above calls. I had to go find an example in my own code to remember all of this. So, here is another suggestion... feel free to disregard all the previous code snippets..
declare
cursor build_data is
select u_catt_request_buid,u_catt_request_name,u_catt_cassette_buid,u_catt_cassette_name
,u_project_name,u_sub_project,replace(u_nominator,'ERROR ','') u_nominator
,replace(replace(u_going_to_vqc,'Yes','true'),'No','false') u_going_to_vqc
,u_promoter,u_cds,u_terminator
,u_primary_trait,u_source_mat_prvd,u_pro_resistance_1,u_vector_type
,nvl(u_my_priority,'Medium') u_my_priority
,replace(replace(u_immediate_trafo,'Yes','true'),'No','false') u_immediate_trafo
,replace(replace(u_new_bps_cmpnt,'Yes','true'),'No','false') u_new_bps_cmpnt
,u_compnt_name,u_new_cmpt_desc,initcap(u_target_crop) u_target_crop,u_corn_line
,u_plant_selection,u_num_of_ind_events,u_num_plants_per_event,u_molecular_quality_events
,replace(replace(u_field,'Yes','true'),'No','false') u_field
,u_t1_seed_request,u_potential_phenotype,u_submission_date
,u_sequence_length,u_trait,u_frst_parent,u_frst_parent_vshare_id,u_cds_vshare_id
,constructid,cassetteid,description
from temp_constructs_lims
order by constructid,description;
v_xml_info varchar2(350);
v_xml_header varchar2(1000);
v_xml_data clob;
v_xml_footer varchar2(50);
v_create_date varchar2(10);
v_scientist_name v_users.full_name%type;
v_scientist_email v_users.email_address%type;
v_primas_code construct.fkprimas%type;
v_nominator_name v_nominators.full_name%type;
v_file_length number;
v_xml_body varchar2(32767); --added by AustinJ
v_page_item varchar2(32767); --added by AustinJ
begin
-- initialize variables
v_create_date := to_char(sysdate,'YYYY-MM-DD');
--v_xml_data := null; --commented out by AustinJ
dbms_lob.createtemporary( v_xml_data, FALSE, dbms_lob.session ); --added by AustinJ
dbms_lob.open( v_xml_data, dbms_lob.lob_readwrite ); --added by AustinJ
-- get name and email address
begin
select full_name,email_address
into v_scientist_name,v_scientist_email
from v_users
where ldap_account = :F140_USER_ID;
exception when no_data_found then
v_scientist_name := '';
v_scientist_email := '';
v_scientist_name := 'Test, Christine';
v_scientist_email := '[email protected]';
end;
-- set up xml file
if :OWNER like '%DEV%' then
v_xml_info := '
<?xml version="1.0" encoding="utf-8"?>
<exchange xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="deService"
xsi:schemaLocation="deService http://mycompany.com/webservices/apexdataexchange/schemas/RTPCATT.xsd">
else
v_xml_info := '
<?xml version="1.0" encoding="utf-8"?>
<exchange xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="deService"
xsi:schemaLocation="deService http://mycompanyprod.com/webservices/apexdataexchange/schemas/RTPCATT.xsd">
end if;
-- populate xml header records
v_xml_header := '<header xmlns="">
<stdXmlVer>2.0</stdXmlVer>
<sendingUnit>'||:P36_UNIT_NUMBER||'</sendingUnit>
<sendingPerson>'||v_scientist_name||'</sendingPerson>
<notification>'||v_scientist_email||'</notification>
<creationDate>'||v_create_date||'</creationDate>
</header>
<entities xmlns="">
for rec in build_data loop
begin
-- get primas code for current construct
select fkprimas
into v_primas_code
from construct
where constructid = rec.constructid;
exception when no_data_found then
v_primas_code := null;
end;
begin
-- get nominator name for current construct
select full_name
into v_nominator_name
from v_nominators
where nominator_id = rec.u_nominator;
exception
when no_data_found then
v_nominator_name := null;
when invalid_number then
v_nominator_name := catt_pkg.full_name_from_user_id(p_user_id => rec.u_nominator);
v_nominator_name := 'Test, Christine';
end;
v_xml_body := '
<Construct>
<requestBUID>'||rec.u_catt_request_buid||'</requestBUID>
<requestName>'||rec.u_catt_request_name||'</requestName>
<cassetteBUID>'||rec.u_catt_cassette_buid||'</cassetteBUID>
<cassetteName>'||rec.u_catt_cassette_name||'</cassetteName>
<scientist>'||v_scientist_name||'</scientist>
<projectNumber>'||v_primas_code||'</projectNumber>
<subProject>'||rec.u_sub_project||'</subProject>
<comments>'||rec.description||'</comments>
<nominator>'||v_nominator_name||'</nominator>
<goingToVqc>'||rec.u_going_to_vqc||'</goingToVqc>
<primaryTrait>'||rec.u_primary_trait||'</primaryTrait>
<sourceMatPrvd>'||rec.u_source_mat_prvd||'</sourceMatPrvd>
<prokaryoticResistance>'||rec.u_pro_resistance_1||'</prokaryoticResistance>
<vectorType>'||rec.u_vector_type||'</vectorType>
<priority>'||rec.u_my_priority||'</priority>
<immediateTrafo>'||rec.u_immediate_trafo||'</immediateTrafo>
<newComponent>'||rec.u_new_bps_cmpnt||'</newComponent>
<componentName>'||rec.u_compnt_name||'</componentName>
<newComponentDescription>'||rec.u_new_cmpt_desc||'</newComponentDescription>
<targetCrop>'||rec.u_target_crop||'</targetCrop>
<Line>'||rec.u_corn_line||'</Line>
<plantSelection>'||rec.u_plant_selection||'</plantSelection>
<numOfIndEvents>'||rec.u_num_of_ind_events||'</numOfIndEvents>
<numOfPlantsPerEvent>'||rec.u_num_plants_per_event||'</numOfPlantsPerEvent>
<molecularQualityEvents>'||rec.u_molecular_quality_events||'</molecularQualityEvents>
<toField>'||rec.u_field||'</toField>
<potentialPhenotype>'||rec.u_potential_phenotype||'</potentialPhenotype>
</Construct>
'; --modified by AustinJ
dbms_lob.writeappend( v_xml_data, length(v_xml_body), v_xml_body); --added by AustinJ
end loop;
-- complete xml data
v_xml_footer := '
</entities>
</exchange>
-- complete submission data
v_page_item := null;
v_page_item := v_xml_info||v_xml_header||wwv_flow.do_substitutions(wwv_flow_utilities.clob_to_varchar2(v_xml_data))||v_xml_footer; --added by AustinJ
:P36_XML_SUBMISSION := trim(v_page_item); --added by AustinJ
dbms_lob.close( v_xml_data); --added by AustinJ
if v_xml_data is not null then
dbms_lob.freetemporary(v_xml_data); --added by AustinJ
end if; --added by AustinJ
end;This code will use the Database to construct your clob and then convert it back to a varchar2 for output to your webservice. This makes more sense to me now and hopefully you can follow what the process is doing.
You don't technically need the two varchar2(36767) variables. I used two for naming convention clarity sake. You could use just one multipurpose variable instead.
If you have any questions, just ask. I'll help if I can.
Austin
Edited by: AustinJ on Dec 20, 2011 12:17 PM
Fixed spelling mistakes. -
Hi,
I'm currently trying to consume in VC a CAF Application Service exposed as a Web Service. I'm able to retrieve what I want but I have a problem with dates format.
The web service returns dates in the following format: YYYY-MM-DDTHH:NN:SS
When I test my data service in VC it works fine. When I run my iview, VC swap the month and the day and compute the new date...
It's not just a problem of formatting with DVAL and DSTR because the date is already computed.
Example:
Date returned from web service: 2007-09-21T00:00:01
Date returned from test data service in VC: 21.09.2007
Date returned at runtime: 09.09.2008
VC understand 21.09.2007 not like DD.MM.YYYY but like MM.DD.YYYY so 21.09.2007 becomes 09.09.2008
I also tried to check on the server Regional and Language option but it doesn't come from there.
Have you ever faced this problem?
ThxHi,
It is a Web Service generated by NWDS (to expose my CAF Application Service)and deployed on the server.
The url si like http://<hostname>:<port>/mywebservice/Config1?wsdl
The Web Service runs correctly.
When I call a method of my web service to retrieve a list of objects (CAF Entity Services) and their attributes, it returns attributes of type String and Dates of type 'java.util.GregorianCalendar'.
It seems that VC doesn't correctly understand this type of Date at runtime
Regards,
Thomas -
Retrieve data from a web service.
Hi,
I need to retrieve the data from Oracle CRM On Demand therefore I downloaded the web service "CustomObject15" from Oracle CRM On Demand then used the netbeans Tool to generate XML files then call Web Service "CustomObject15" then I created small java code to retrieve the data through a web service but the data did not retrieved.
Only retrieved "CustomObject15Data.CustomObject15Data@1be0799a"
Kindly, Can you help me and provide me small java code to the data through a web service "CustomObject15".
Best Regards.Hi,
just create a skeleton for the Web Service. In JDeveloper, create a new project and then use the "NEW" context menu option.
Navigate to "Business Tier" --> Web Services and select "Web Service Proxy"
In teh following, provide the WSDL reference to create the Java proxy. This gives you accss to the WS without having to parse the XML yourself
Frank -
How to retrieve data from a web service
Hi
i am at very beginner level about web services.
I am searching for a simple example of retrieving data from a web services, but cant find.
How can i get xml data from a web service. i dont need to develop the web service it is already ready, i just need how could i fetch data from it.
Can somebody point out or give an example?
Thanks in advanceHi,
just create a skeleton for the Web Service. In JDeveloper, create a new project and then use the "NEW" context menu option.
Navigate to "Business Tier" --> Web Services and select "Web Service Proxy"
In teh following, provide the WSDL reference to create the Java proxy. This gives you accss to the WS without having to parse the XML yourself
Frank -
Unzip data received from web service?
In my Apex 3.0.1 application I am trying to obtain data from a web service. The problem is that the returned data is first zipped and then encoded using base 64 coding.
I can decode the data using the utl_encode package and if I download the result, I can unzip it using winzip to get the original XML message. However, I need to unzip the message within Apex in order to process the content. The Oracle package utl_compress provides uncompression functions for the LZ compression algorithm but this does not seem to be the same as winzip etc.
Thanks for any suggestions anyone might have.One way would be to use a Java stored procedure to perform the unzipping.
-
Using CLOB data type - Pros and Cons
Dear Gurus,
We are designing a database that will be receiving comments from external data source. These comments are stored as CLOB in the external database. We found that only 1% of incoming data will be larger than 4000 characters and are now evaluating the Pros and Cons of storing only 4000 characters of incoming comments in VARCHAR2 data type or using CLOB data type.
Some of the concerns brought up during discussion were:
- having to store CLOBs in separate tablespace;
- applications, such Toad require changing defaults settings to display CLOBs in the grid. Default value is not to display them;
- applications that build web page with CLOBs will be struggling to fit 18 thousand chararcters of which 17 thousand are blank lines;
- cashing CLOBs in memory will consume big chunk of data buffers which will affect performance;
- to manipulate CLOBs you need PL/SQL anonymous block or procedure;
- bind variables cannot be assigned CLOB value;
- dynamic SQL cannot use CLOBs;
- temp tables don't work very well with CLOBs;
- fuzzy logic search on CLOBs is ineffective;
- not all ODBC drivers support Oracle CLOBs
- UNION, MINUS, INTERSECT don't work with CLOBs
I have not delt with CLOB data type in the past, so I am hoping to hear from you of any possible issues/hastles we may encounter?848428 wrote:
Dear Gurus,
We are designing a database that will be receiving comments from external data source. These comments are stored as CLOB in the external database. We found that only 1% of incoming data will be larger than 4000 characters and are now evaluating the Pros and Cons of storing only 4000 characters of incoming comments in VARCHAR2 data type or using CLOB data type.
Some of the concerns brought up during discussion were:
- having to store CLOBs in separate tablespace;They can be stored inline too. Depends on requirements.
- applications, such Toad require changing defaults settings to display CLOBs in the grid. Default value is not to display them;Toad is a developer tool so that shouldn't matter. What should matter is how you display the data to end users etc. but that will depend on the interface. Some can handle CLOBs and others not. Again, it depends on the requirements.
- applications that build web page with CLOBs will be struggling to fit 18 thousand chararcters of which 17 thousand are blank lines;Why would they struggle? 18,000 characters is only around 18k in file size, that's not that big to a web page.
- cashing CLOBs in memory will consume big chunk of data buffers which will affect performance;Who's caching them in memory? What are you planning on doing with these CLOBs? There's no real reason they should impact performance any more than anything else, but it depends on your requirements as to how you plan to use them.
- to manipulate CLOBs you need PL/SQL anonymous block or procedure;You can manipulate CLOBs in SQL too, using the DBMS_LOB package.
- bind variables cannot be assigned CLOB value;Are you sure?
- dynamic SQL cannot use CLOBs;Yes it can. 11g supports CLOBs for EXECUTE IMMEDIATE statements and pre 11g you can use the DBMS_SQL package with CLOB's split into a VARCHAR2S structure.
- temp tables don't work very well with CLOBs;What do you mean "don't work well"?
- fuzzy logic search on CLOBs is ineffective;Seems like you're pulling information from various sources without context. Again, it depends on your requirements as to how you are going to use the CLOB's
- not all ODBC drivers support Oracle CLOBs not all, but there are some. Again, it depends what you want to achieve.
- UNION, MINUS, INTERSECT don't work with CLOBsTrue.
I have not delt with CLOB data type in the past, so I am hoping to hear from you of any possible issues/hastles we may encounter?You may have more hassle if you "need" to accept more than 4000 characters and you are splitting it into seperate columns or rows, when a CLOB would do it easily.
It seems as though you are trying to find all the negative aspects of CLOBs and ignoring all the positive aspects, and also ignoring the negative aspects of not using CLOB's.
Without context you're assumptions are just that, assumptions, so nobody can tell you if it will be right or wrong to use them. CLOB's do have their uses, just as XMLTYPE's have their uses etc. If you're using them for the right reasons then great, but if you're ignoring them for the wrong reasons then you'll suffer. -
Using Complex Data Types in Import JavaBean Model
Hi,
I have searched and read forums and weblogs related to import javabean model.
But I am not clear about how to use complex data types like ArrayList, Collection etc in my java bean.
If I use these complex datatypes in my bean, when creating model in WDF it displays the Complex data elements in Model Relation. I dont know how to use this model relation in my WD project.
Anyone please explain the<b> step by step solution</b> about using complex data type(used in Bean) in WD Project.
Thanks,
Krishna KumarHi Krishna,
Valery`s blog contains sample code ( http://www.jroller.com/resources/s/silaev/Employees.zip )
Another blogs from this area:
/people/anilkumar.vippagunta2/blog/2005/09/02/java-bean-model-importer-in-web-dynpro
/people/valery.silaev/blog/2005/08/30/javabean-model-import-when-it-really-works
And forum topics:
Import JavaBean Model
Problem Importing JavaBean Model in NetWeaver Developer Studio
Issue on "Import JavaBean Model"
import JavaBean Model: no executable Methods?
JavaBeans Model Import
POLL : JavaBean Model Importer
JavaBean-Model
Invalid Class - Javabean not available for import
WebDynpro Using JavaBean Model ->Please Help
Best regards, Maksim Rashchynski.
Maybe you are looking for
-
F.16 Balance Carry Forward
Hi All, I have a requirement that, we are using F.16 tcode for carry forward for a particular year. F.16 uses T030 a table to carry forward the balances to balance sheet account and profit and loss accounts. Since T030 contains balance sheet accounts
-
Hi All, If the port of discharge of high sea sales comes under one registration and the high sea billing is done under some other registration.. is it legally right? regards, Archana
-
how do i insert a pdf file in between every page of a pdf or word file; i have pdf pack.
-
Hello, Looking for ways to change the appearence of the Print Dialog Box. Hope this makes sense. In the Print Dialog Box the drop down menu that list: "Copies & Pages", "Layout", "Output Options", ..... "Printer Features"....... I want it to list "Pr
-
How do I import list of favorites from iexplorer to bookmarks in mozilla?
How do I import list of favorites from iexplorer to bookmarks in mozilla?