Generating Webservices from PL/SQL Problem

Hello,
when I try to automatically generate a webservice from my pl/sql package, I cannot choose a specific procedure.
The "why not" button tells me, that there is no xml schema mapping or serializer available.
my question:
The pl/sql procedures output parameter are tables, like:
Spec:
TYPE my_type IS TABLE OF t_my_table.id%TYPE
INDEX BY NATURAL;
Body:
procedure .... (
out_param OUT my_type;
Is it generally possible to autogenerate this kind of output parameter as webservice or have I missed something ?
Do I have to use java instead ?
Thank you for your help,
Frank

Hi,
Within the package dbms_xmlquery there is a procedure called setDateFormat which you can use to set a format mask.
But the format mask must be one recognised by the java.text.SimpleDateFormat class. an example would be.
dbms_xmlquery.setDateFormat(lc_xmlgen_contex, 'dd.MM. yyyy');
Hope this helps

Similar Messages

  • Trouble when creating webservice from PL/SQL via jdeveloper

    Hi,I'm new comer of this world,
    I've a pl/sql like this:
    package MY_WS_API is
    type record_set is ref cursor;
    PROCEDURE Get_User_Info(p_user_id VARCHAR2,
    p_rep_id VARCHAR2,
    p_flag out number,
    p_msg out varchar2,
    p_recordset out record_set);
    end MY_WS_API;
    when I using jdeveloper trying to publish it as a webservice, in the step 4 of the wizzard poping me choose the program unit to expose, the PROCEDURE Get_User_Info is not available and told me "Ref cursor Type is not supported due to a jdbc limitation and Ref Cursor Types are only supported for use of return type".
    THE QUESTION is:
    1.the cursor I used is of return type,I'm not very understanding the "why not" message upon.
    2.in such case , need I trans the return cursor into Object[] if have to?
    3.any other limitation for generating WS from PL/SQL using jdeveloper?
    Thanks!

    I had the same problem and found that JDeveloper uses the thin driver to connect to oracle, this driver doesn't support ref cursors or xmltypes etc. You have to assemble your own web service using the webservicesassembler command line utility (i.e. wsa.jar). This link should provide you with all you need:
    http://download-west.oracle.com/docs/cd/B25221_04/web.1013/b14434/wsassemble.htm

  • Generating reports from PL/SQL

    I'm new to the world of BI Publisher - so far I'm impressed with what I've seen. I've managed to create a report and an RTF template and generate some nice looking PDF's :)
    What I need to do now is to have a nightly job that produces PDF shipment reports using my template for all new shipments generated during the day and I'm having a little difficulty putting it all together.
    I've looked at the BI Publisher API's that allow me to generate an XSL from my RTF template and the using the FO engine merge the XSL and XML data to produce the PDF. Then using the delivery manager API's I can send these reports out via email.
    I'm a little unsure of how to get the XML source - I've played around with the DataEngine API to generate XML from a SQL query so I think that's where I should be heading.
    Does this all sounds right ? Ideally, I want to be able to do all of this from within a scheduled PL/SQL job every night but all the interaction with the BI server seems to be via Java.
    Is there an easy(ish) way to run all of this from within PL/SQL ?
    And should I be going about this by:
    1/ generate XML data using dataengine API
    2/ create an RTF template using word and the xml data generated above
    3/ use the RTF processor to generate an XSL-FO from my RTF template
    (1-3 will only need to be done once)
    4/ Then my nightly job will use the dataengine to generate new shipment XML data
    5/ use FO processor to generate PDF's from each
    6/ use delivery manager API's to email out
    All sounds very cumbersome and intense -is there no easier way ?! :) Also, I'm thinking i should be using the bursting engine to split one query containing all the new shipment data and generate/mail a PDF for each shipment ? Is that necessary if all going to the same email address ?
    Help/guidance/suggestions greatly appreciated !
    Many thanks,
    Brent

    repost .... Has anyone successfully called BIP web services from within the database using Java stored procedures ?
    Still struggling to work out how to generate my reports from PL/SQL ! :((

  • Problem in generate Java  from PL SQL package in Jdeveloper

    Hi
    i have problem in create java class from PL SQL package in JDeveloper.
    I use Database navigator of jdeveloper and right click on a package and choose Generate Java then in Jpublisher window choose my view Controller and accept other default values.
    I call methods of generated class in the Action of a button in my JSP page, but when I click the button it  throw null pointer exception !!! i fund one of generated method return null and it lead to this exception.
    protected DefaultContext __tx = null;
    public DefaultContext getConnectionContext() throws SQLException  {
    if (__tx==null){
    __tx = (getConnection()==null) ? DefaultContext.getDefaultContext() : new DefaultContext(getConnection());
        return __tx;
      public Connection getConnection() throws SQLException
        if (__onn!=null) return __onn;
         else if (__tx!=null) return __tx.getConnection();
         else if (__dataSource!=null) __onn= __dataSource.getConnection();
         return __onn;
    i try to generate class in Model project and create DataControl for that and use method action but noting change and i get null pointer again!!
    Jdeveloper Versino = 11.1.1.7.0

    Let me ask you another question: Why do you generate java from the package at all?
    Where do you want to call the package?
    Back to your question: you should see code like
        public void setDataSourceLocation(String dataSourceLocation) throws SQLException {
            javax.sql.DataSource dataSource;
            try {
                Class cls = Class.forName("javax.naming.InitialContext");
                Object ctx = cls.newInstance();
                java.lang.reflect.Method meth = cls.getMethod("lookup", new Class[] { String.class });
                dataSource = (javax.sql.DataSource) meth.invoke(ctx, new Object[] { "java:comp/env/" + dataSourceLocation });
                setDataSource(dataSource);
            } catch (Exception e) {
                throw new java.sql.SQLException("Error initializing DataSource at " + dataSourceLocation + ": " + e.getMessage());
    in the generated code. This code look up a datasource (which you have defined e.g. on the Weblogic Server) by calling the method
    setDataSourceLocaltion("jdbc/HRConnDS");
    This look up the datasource nad stores it in the class variable.
    Timo

  • Issue generating java from pl/sql package

    Hi,
    In JDeveloper (11.1.1.6) I am having an issue generating java from a pl/sql package. When I am in the database navigator I right click on the package and select "generate java". This produces some java files, some sqlj files and a <package_name>.javatmp file. When a collegue does the same all files are generated with a .java extension. Can anyone tell me what I can do to generate all java files?
    Thanks,
    Graeme

    It turns out that I was running against a 64-bit JDK. (1.6.0_41.)
    When I changed this to run against a 32 bit JDK (also 1.6.0_41) my problem went away.
    It might be worth noting that my machine is 64 bit.

  • How to generate WebServices for PL/SQL Packages

    I have the following issue trying to generate WS for a selected set of operations within a PL/SQL package
    If I use the option -sql PKG_TEST then I am getting all operations within a package.
    I just want to expose a certain number of procedures ( e.g. PROC1 and PROC2 )
    It works only if I specify
    -sql PKG_TEST(PROC1)
    when I use -sql PKG_TEST(PROC1, PROC2) it gives me errors.
    I have Oracle JDeveloper (10.1.3.2) (Build 4066) .
    I used wsa with an plsqlAssemble option
    java -jar wsa.jar -plsqlAssemble
    -appName myApp
    -packageName myPckg
    -sql PKG_TEST(PROC1)
    -dataSource jdbc/ds
    -dbConnection jdbc:oracle:thin:@zzzz:1521:mydb -dbUser user/passw
    -style rpc
    -use literal
    Thanks,
    Michael Hitrik

    Eric,
    Thanks a lot for your help.
    I was able to follow all of your recommendations
    I was able to produce the single ear file for multiple PL/SQL packages .
    Now I have the last step ( I hope :-) - WS-SECURITY
    What is your recomendation for Security - specifically for WebServices for PL/SQL Packages ?
    I would like to do the following:
    CLIENT CODE:
    * Create a XML element with user name, password, &
    * datasource as child elements.
    * Element will look like this:
    * <credetials>
    * <username>scott</username>
    * <password>tiger</password>
    * <datasource>jdbc/OracleCoreDS</datasource>
    * </credentials>
    Document doc = new XMLDocument();
    Element elAdd = doc.createElement( "credentials");
    Element elA = doc.createElement( "username");
    Element elB = doc.createElement("password");
    Element elC = doc.createElement("datasource");
    elA.appendChild(doc.createTextNode("scott"));
    elB.appendChild(doc.createTextNode("tiger"));
    elC.appendChild(doc.createTextNode("jdbc/OracleCoreDS"));;
    elAdd.appendChild(elA);
    elAdd.appendChild(elB);
    elAdd.appendChild(elC);
    doc.appendChild(elAdd);
    Element e = doc.getDocumentElement();
    // Create an intance of the proxy
    EmployeeProxy proxy = new EmployeeProxy();
    // Create a Header objecy
    Vector v = new Vector();
    v.add (e);
    Header hdr = new Header();
    hdr.setHeaderEntries(v);
    // Set the Header
    proxy._setSOAPRequestHeaders(hdr);
    SERVER CODE:
    public void processHeaders(Header header)
    throws java.io.IOException,
    oracle.xml.parser.v2.XSLException
    // Get all the Elements
    Vector entries = header.getHeaderEntries();
    Element e = (Element) entries.firstElement();
    System.out.println("Element received from SOAP header is: " );
    ((XMLElement)e).print(System.out);
    // Get independent nodes and retrieve node values.
    Node userNode;
    userNode = ((XMLNode)e).selectSingleNode("username");
    userName = ((XMLElement)userNode).getText();
    Node passwordNode;
    passwordNode = ((XMLNode)e).selectSingleNode("password");
    password = ((XMLElement)passwordNode).getText();
    Node dsNode;
    dsNode = ((XMLNode)e).selectSingleNode("datasource");
    datasourceName = ((XMLElement)dsNode).getText();
    System.out.println("User name is: " + userName);
    System.out.println("Password is: " + password);
    System.out.println("Datasource is: " + datasourceName);
    How can this be done with the generated code using wsa tool ?
    Any other suggestions ?
    Thanks,
    Michael

  • Creating a webservice from PL/SQL Package in JDev 11g

    Hi All...
    I have a PL/SQl package and I am using JDEv 11g. I want to create it as a webservice. I want to deploy it in a remote server. Can I deploy it from my client machine. In server Weblogic already started. What are the prerequisites, that we need to deploy a wbservice. I done the following steps.
    1. Create an application.
    2. Right click the package and select Generate Java option.
    3. It create a Java class in the Application sources.
    4. Double click the class and select Create Web Service. It created the web service.
    5. When I select the webservice and click Run it shows the following error. It going to the Default \server. Actually I need it in a remote server.
    [Running application NewWebService on Server Instance DefaultServer...]
    ---- Deployment started. ---- Apr 20, 2009 1:15:40 PM
    Target platform is (Weblogic 10.3).
    Running dependency analysis...
    2009-04-20 13:15:40.205: Writing WAR file to D:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\o.j2ee\drs\NewWebService\NewWebService-LastNoWebService-webapp
    2009-04-20 13:15:40.222: Wrote WAR file to D:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\o.j2ee\drs\NewWebService\NewWebService-LastNoWebService-webapp
    2009-04-20 13:15:40.357: Writing EAR file to D:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\o.j2ee\drs\NewWebService
    2009-04-20 13:15:40.374: Wrote EAR file to D:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\o.j2ee\drs\NewWebService
    Deploying Application...
    <Apr 20, 2009 1:15:40 PM IST> <Warning> <J2EE> <BEA-160195> <The application version lifecycle event listener oracle.security.jps.wls.listeners.JpsAppVersionLifecycleListener is ignored because the application NewWebService is not versioned.>
    <Apr 20, 2009 1:15:40 PM IST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1240213540593' for task '3'. Error is: 'java.lang.ClassNotFoundException: sqlj.runtime.ref.DefaultContext'
    java.lang.ClassNotFoundException: sqlj.runtime.ref.DefaultContext
         at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
         at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         Truncated. see log file for complete stacktrace
    java.lang.ClassNotFoundException: sqlj.runtime.ref.DefaultContext
         at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
         at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         Truncated. see log file for complete stacktrace
    >
    <Apr 20, 2009 1:15:40 PM IST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'NewWebService'.>
    <Apr 20, 2009 1:15:40 PM IST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
    java.lang.ClassNotFoundException: sqlj.runtime.ref.DefaultContext
         at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
         at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         Truncated. see log file for complete stacktrace
    java.lang.ClassNotFoundException: sqlj.runtime.ref.DefaultContext
         at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
         at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         Truncated. see log file for complete stacktrace
    >
    [Deployer:149034]An exception occurred for task [Deployer:149026]deploy application NewWebService on DefaultServer.: sqlj.runtime.ref.DefaultContext.
    weblogic.application.WrappedDeploymentException: sqlj.runtime.ref.DefaultContext
    #### Deployment incomplete. #### Apr 20, 2009 1:15:40 PM
    oracle.jdeveloper.deploy.DeployException
         at oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer.doDeploymentAction(Jsr88RemoteDeployer.java:247)
         at oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer.deployImpl(Jsr88RemoteDeployer.java:157)
         at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
         at oracle.jdevimpl.deploy.fwk.WrappedDeployer.deployImpl(WrappedDeployer.java:39)
         at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
         at oracle.jdeveloper.deploy.common.BatchDeployer.deployImpl(BatchDeployer.java:82)
         at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
         at oracle.jdevimpl.deploy.fwk.WrappedDeployer.deployImpl(WrappedDeployer.java:39)
         at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
         at oracle.jdevimpl.deploy.fwk.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:436)
         at oracle.jdeveloper.deploy.DeploymentManager.deploy(DeploymentManager.java:209)
         at oracle.jdevimpl.runner.adrs.AdrsStarter$5$1.run(AdrsStarter.java:1365)
    Caused by: oracle.jdeveloper.deploy.DeployException
         at oracle.jdevimpl.deploy.common.Jsr88DeploymentHelper.deployApplication(Jsr88DeploymentHelper.java:413)
         at oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer.doDeploymentAction(Jsr88RemoteDeployer.java:238)
         ... 11 more
    Caused by: oracle.jdeveloper.deploy.DeployException: Deployment Failed
         at oracle.jdevimpl.deploy.common.Jsr88DeploymentHelper.deployApplication(Jsr88DeploymentHelper.java:395)
         ... 12 more
    #### Cannot run application NewWebService due to error deploying to DefaultServer.
    [Application NewWebService stopped and undeployed from Server Instance DefaultServer]
    6. when i goto the consoleof weblogic server, already an instance created. But nothing displayed under WebServices.
    7. Select the instance and press 'Start'. While deploying an error came.
    java.lang.Exception: [DeploymentService:290049]Deploy failed for id '1,240,213,727,265' since no targets are reachable.
    Please help me..
    its very urgent...
    Regards,
    Resmi.

    Oh, no - another very urgent question. The world must be about to end ;)
    Resmi, Have a read of [url http://forums.oracle.com/forums/thread.jspa?threadID=883293]this - JDeveloper 11g, as of today, doesn't (at least is not supposed to) support publishing PL/SQL procedures/packages as a web service.
    John

  • Error to generate webservice from java file with JAXWS

    I need to build a webservice to run on Glassfish, but I have problems, I did downloaded the latest JAX-WS recently(2 days).
    I have the follow class to generate a wsdl file:
    package com.dudhoo.farmacopedia.web;
    import com.dudhoo.farmacopedia.web.hibernate.FarmacopediaKey;
    import com.dudhoo.farmacopedia.web.key.KeyGenerator;
    import java.util.Calendar;
    import java.util.Date;
    import javax.jws.WebMethod;
    import javax.jws.WebService;
    @WebService(serviceName="FarmacoWebService", name="nomeservice")  
    public class FarmacoWebService {
        public FarmacoWebService() {
        @WebMethod()
        public Date getServerTime(){
            return Calendar.getInstance().getTime();
        public FarmacopediaKey generateSerial(Date ini, int dias){
            return new KeyGenerator().generateKey(ini, dias);
    }I have the follow ant code:
    <?xml version="1.0" encoding="windows-1252" ?>
    <!--Ant buildfile generated by Oracle JDeveloper 10g-->
    <!--Generated 01/08/2006 22:56:00-->
    <project name="FarmacoWeb" default="all" basedir=".">
      <property file="build.properties"/>
      <path id="classpath">
        <fileset dir="../libs/" includes="**/*.jar"/>   
      </path>
      <path id="jaxws.classpath">
        <fileset dir="../libs/jaxws" includes="**/*.jar"/>   
      </path>
      <target name="init">
        <tstamp/>
        <mkdir dir="${output.dir}"/>
        <mkdir dir="${output.dir}/new"/>
        <mkdir dir="${output.dir}/res"/>
      </target>
      <target name="all" description="Build the project" depends="compile,copy"/>
      <target name="clean" description="Clean the project">
        <delete includeemptydirs="true" quiet="true">
          <fileset dir="${output.dir}" includes="**/*"/>
        </delete>
      </target>
      <target name="compile" description="Compile Java source files" depends="init">
        <javac destdir="${output.dir}" classpathref="classpath"
               debug="${javac.debug}" nowarn="${javac.nowarn}"
               deprecation="${javac.deprecation}" encoding="Cp1252" source="1.5"
               target="1.5">
          <src path="src"/>
        </javac>
      </target>
      <target name="copy" description="Copy files to output directory"
              depends="init">
        <patternset id="copy.patterns">
          <include name="**/*.gif"/>
          <include name="**/*.GIF"/>
          <include name="**/*.jpg"/>
          <include name="**/*.JPG"/>
          <include name="**/*.jpeg"/>
          <include name="**/*.JPEG"/>
          <include name="**/*.png"/>
          <include name="**/*.PNG"/>
          <include name="**/*.properties"/>
          <include name="**/*.xml"/>
          <include name="**/*-apf.xml"/>
          <include name="**/*.ejx"/>
          <include name="**/*.xcfg"/>
          <include name="**/*.cpx"/>
          <include name="**/*.dcx"/>
          <include name="**/*.wsdl"/>
          <include name="**/*.ini"/>
          <include name="**/*.tld"/>
          <include name="**/*.tag"/>
        </patternset>
        <copy todir="${output.dir}">
          <fileset dir="src">
            <patternset refid="copy.patterns"/>
          </fileset>
        </copy>
      </target>
      <target name="-pre-dist" >
            <taskdef name="wsgen" classname="com.sun.tools.ws.ant.WsGen">
                <classpath refid="classpath"/>
            </taskdef>
            <wsgen
                debug="true"
                keep="true"
                destdir="${output.dir}/new"
                resourcedestdir="${output.dir}/res"
                sei="com.dudhoo.farmacopedia.web.FarmacoWebService">
                <classpath>
                    <pathelement path="${jaxws.classpath}"/>
                    <pathelement location="${output.dir}"/>               
                </classpath>
            </wsgen>
        </target>
    </project>When I run ant the the follow error is throwed:
    Buildfile: /home/duduzera/jdevhome/mywork/Farmaco/FarmacoWeb/build.xml
    -pre-dist:
        [wsgen] Problem encountered during annotation processing;
        [wsgen] see stacktrace below for more information.
        [wsgen] java.lang.NoSuchMethodError: javax.jws.WebMethod.exclude()Z
        [wsgen]      at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.hasWebMethods(WebServiceVisitor.java:373)
        [wsgen]      at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.shouldProcessWebService(WebServiceVisitor.java:349)
        [wsgen]      at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.visitClassDeclaration(WebServiceVisitor.java:143)
        [wsgen]      at com.sun.tools.apt.mirror.declaration.ClassDeclarationImpl.accept(ClassDeclarationImpl.java:95)
        [wsgen]      at com.sun.tools.ws.processor.modeler.annotation.WebServiceAP.buildModel(WebServiceAP.java:345)
        [wsgen]      at com.sun.tools.ws.processor.modeler.annotation.WebServiceAP.process(WebServiceAP.java:230)
        [wsgen]      at com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.process(AnnotationProcessors.java:60)
        [wsgen]      at com.sun.tools.apt.comp.Apt.main(Apt.java:454)
        [wsgen]      at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:448)
        [wsgen]      at com.sun.tools.apt.main.Main.compile(Main.java:1075)
        [wsgen]      at com.sun.tools.apt.main.Main.compile(Main.java:938)
        [wsgen]      at com.sun.tools.apt.Main.processing(Main.java:95)
        [wsgen]      at com.sun.tools.apt.Main.process(Main.java:85)
        [wsgen]      at com.sun.tools.apt.Main.process(Main.java:67)
        [wsgen]      at com.sun.tools.ws.wscompile.CompileTool.buildModel(CompileTool.java:603)
        [wsgen]      at com.sun.tools.ws.wscompile.CompileTool.run(CompileTool.java:536)
        [wsgen]      at com.sun.tools.ws.util.ToolBase.run(ToolBase.java:54)
        [wsgen]      at com.sun.tools.ws.ant.WsGen.execute(WsGen.java:457)
        [wsgen]      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        [wsgen]      at org.apache.tools.ant.Task.perform(Task.java:364)
        [wsgen]      at org.apache.tools.ant.Target.execute(Target.java:341)
        [wsgen]      at org.apache.tools.ant.Target.performTasks(Target.java:369)
        [wsgen]      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        [wsgen]      at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        [wsgen]      at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
        [wsgen]      at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        [wsgen]      at oracle.jdevimpl.ant.runner.AntLauncher.launch(AntLauncher.java:321)
        [wsgen]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        [wsgen]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        [wsgen]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        [wsgen]      at java.lang.reflect.Method.invoke(Method.java:585)
        [wsgen]      at oracle.jdevimpl.ant.runner.InProcessAntStarter.runAnt(InProcessAntStarter.java:293)
        [wsgen]      at oracle.jdevimpl.ant.runner.InProcessAntStarter.mav$runAnt(InProcessAntStarter.java)
        [wsgen]      at oracle.jdevimpl.ant.runner.InProcessAntStarter$1.run(InProcessAntStarter.java:71)
        [wsgen] error: compilation failed, errors should have been reported
        [wsgen]
    BUILD SUCCESSFUL
    Total time: 3 secondsI'm using JDeveloper 10g. Did someone had problems like this?
    I think the problem maybe is caused by jar lib concurrences...
    thanks

    You get that error when response headers have already been sent to the client (browser). This can happen in two ways that I know of:
    - you flushed data to the client, or somewhere the data was automatically flushed
    - you already did a redirect/forward and are attempting to do a second one.
    So if you want to prevent yourself from getting the error, you'll need to make sure that neither of the situations has occurred. Don't output content unless you are absolutely certain that you won't need to foward/redirect later and don't do a redirect/forward twice in the same resource.

  • Jdeveloper 11.1.1.0.0 - Error when generating webservice from Collection or

    Hello.
    I get the error when I like to publish a method which return a Collection..
    for example I have a Class:
    package in2;
    import java.sql.Connection;
    import java.util.ArrayList;
    import java.util.List;
    import java.util.*;
    import javax.jws.WebMethod;
    import javax.jws.WebService;
    public class servis {
        public servis() {
        public String hello() {
            return "PETER";
        public Collection vrniPodatke() {
            Collection l = new ArrayList();
            l.add ( new OptionList("PTER","VALENCIC"));
            return l;
        public int sestej (int a , int b) {
            return a+b;
    ==========
    package in2;
        public class OptionList {
            String a;
            String b;
            public OptionList(String a, String b) {
                this.a = a;
                this.b = b;
            public void setA(String newa) {
                this.a = newa;
            public String getA() {
                return a;
            public void setB(String newb) {
                this.b = newb;
            public String getB() {
                return b;
        }The error I get is:
    java.lang.RuntimeException: Cannot find namespace for: ns1
         at oracle.j2ee.ws.wsdl.extensions.oracle.schema.BaseSchemaElement.getQNameFromValue(BaseSchemaElement.java:185)
         at oracle.j2ee.ws.wsdl.extensions.oracle.schema.BaseSchemaElement.getAttributeValueAsQNameOrNull(BaseSchemaElement.java:173)
         at oracle.j2ee.ws.wsdl.extensions.oracle.schema.ElementSchemaElement.getTypeAsQName(ElementSchemaElement.java:63)
         at oracle.j2ee.ws.common.processor.modeler.wsdl.SchemaValidator.validate(SchemaValidator.java:145)
         at oracle.j2ee.ws.common.processor.modeler.wsdl.SchemaValidator.validateSequence(SchemaValidator.java:414)
         at oracle.j2ee.ws.common.processor.modeler.wsdl.SchemaValidator.validateComplexType(SchemaValidator.java:224)
         at oracle.j2ee.ws.common.processor.modeler.wsdl.SchemaValidator.validate(SchemaValidator.java:157)
         at oracle.j2ee.ws.common.processor.modeler.wsdl.WSDLValidator.validateElement(WSDLValidator.java:709)
         at oracle.j2ee.ws.common.processor.modeler.wsdl.WSDLValidator.validateParts(WSDLValidator.java:667)
         at oracle.j2ee.ws.common.processor.modeler.wsdl.WSDLValidator.validateMessage(WSDLValidator.java:644)
         at oracle.j2ee.ws.common.processor.modeler.wsdl.WSDLValidator.validateOutput(WSDLValidator.java:604)
         at oracle.j2ee.ws.common.processor.modeler.wsdl.WSDLValidator.validateOperations(WSDLValidator.java:596)
         at oracle.j2ee.ws.common.processor.modeler.wsdl.WSDLValidator.validatePortType(WSDLValidator.java:585)
         at oracle.j2ee.ws.common.processor.modeler.wsdl.WSDLValidator.validateDefinition(WSDLValidator.java:97)
         at oracle.j2ee.ws.common.processor.modeler.wsdl.WSDLValidator.validate(WSDLValidator.java:68)
         at oracle.j2ee.ws.common.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:247)
         at oracle.j2ee.ws.common.processor.config.ModelInfo.buildModel(ModelInfo.java:171)
         at oracle.j2ee.ws.common.processor.Processor.runModeler(Processor.java:73)
         at oracle.j2ee.ws.tools.wsa.AssemblerTool.run(AssemblerTool.java:126)
         at oracle.j2ee.ws.tools.wsa.WsdlToJavaTool.createModel(WsdlToJavaTool.java:471)
         at oracle.j2ee.ws.tools.wsa.Util.createDeploymentDescriptors(Util.java:913)
         at oracle.jdeveloper.webservices.model.generator.GenerateDescriptors.action(GenerateDescriptors.java:146)
         at oracle.jdeveloper.webservices.model.java.generator.JavaEjbGenerateDescriptors.action(JavaEjbGenerateDescriptors.java:78)
         at oracle.jdeveloper.webservices.model.generator.GeneratorAction.run(GeneratorAction.java:151)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
         at java.awt.Dialog$1.run(Dialog.java:525)
         at java.awt.Dialog$2.run(Dialog.java:553)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.awt.Dialog.show(Dialog.java:551)
         at java.awt.Component.show(Component.java:1300)
         at java.awt.Component.setVisible(Component.java:1253)
         at oracle.bali.ewt.dialog.JEWTDialog.runDialog(Unknown Source)
         at oracle.bali.ewt.dialog.JEWTDialog.runDialog(Unknown Source)
         at oracle.ide.dialogs.ProgressBar.start(ProgressBar.java:358)
         at oracle.ide.dialogs.ProgressBar.start(ProgressBar.java:222)
         at oracle.ide.dialogs.ProgressBar.start(ProgressBar.java:194)
         at oracle.jdeveloper.webservices.model.Model.saveEditSync(Model.java:226)
         at oracle.jdevimpl.webservices.wizard.jaxrpc.WebServicesEditor.showDialog(WebServicesEditor.java:296)
         at oracle.jdevimpl.webservices.WebServicesAddin.findAndInvokeWizard(WebServicesAddin.java:1408)
         at oracle.jdevimpl.webservices.WebServicesAddin.handleEvent(WebServicesAddin.java:837)
         at oracle.ide.controller.IdeAction.performAction(IdeAction.java:506)
         at oracle.ide.controller.IdeAction.actionPerformedImpl(IdeAction.java:779)
         at oracle.ide.controller.IdeAction.actionPerformed(IdeAction.java:479)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
         at java.awt.Component.processMouseEvent(Component.java:5501)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
         at java.awt.Component.processEvent(Component.java:5266)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3968)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1778)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    ======================
    What I'am doing wrong?

    I don't know what is happening with Jdeveloper ?!?!
    I have tryed the same example at home with Jdeveloper 11.1.1.0.0 Build JDEVADF_MAIN.DROP5_GENERIC_071218.2321.4796
    All works fine.....
    What you think could be wrong (in my first post)? Why I have received the error? and why the same project works on other computer?
    can someone reply to my post?

  • Calling a webservice from Pl/SQL

    Hi,
    I have created a function to call a webservice but I am getting the following error
    ORA-20000: soap:Client - System.Web.Services.Protocols.SoapException: Server
    did not recognize the value of HTTP Header SOAPAction: ConversionRate.
    at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest()
    at
    System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage
    message)
    at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
    at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type,
    HttpContext context, HttpRequest request, HttpResponse response, Boolean&amp;
    abortProcessing)
    ORA-06512: at "APPS.SOAP_API", line 54
    ORA-06512: at "APPS.SOAP_API", line 81
    ORA-06512: at "APPS.PKG_MY_WEBSERVICE", line 12
    The Packages code are as follow:
    CREATE OR REPLACE PACKAGE soap_api AS
    TYPE t_request IS RECORD (
    method VARCHAR2(256),
    namespace VARCHAR2(256),
    body VARCHAR2(32767),
    envelope_tag VARCHAR2(30)
    TYPE t_response IS RECORD
    doc XMLTYPE,
    envelope_tag VARCHAR2(30)
    FUNCTION new_request(p_method IN VARCHAR2,
    p_namespace IN VARCHAR2,
    p_envelope_tag IN VARCHAR2 DEFAULT 'SOAP-ENV')
    RETURN t_request;
    PROCEDURE add_parameter(p_request IN OUT NOCOPY t_request,
    p_name IN VARCHAR2,
    p_type IN VARCHAR2,
    p_value IN VARCHAR2);
    FUNCTION invoke(p_request IN OUT NOCOPY t_request,
    p_url IN VARCHAR2,
    p_action IN VARCHAR2)
    RETURN t_response;
    FUNCTION get_return_value(p_response IN OUT NOCOPY t_response,
    p_name IN VARCHAR2,
    p_namespace IN VARCHAR2)
    RETURN VARCHAR2;
    END soap_api;
    CREATE OR REPLACE PACKAGE BODY soap_api AS
    FUNCTION new_request(p_method IN VARCHAR2,
    p_namespace IN VARCHAR2,
    p_envelope_tag IN VARCHAR2 DEFAULT 'SOAP-ENV')
    RETURN t_request AS
    l_request t_request;
    BEGIN
    l_request.method := p_method;
    l_request.namespace := p_namespace;
    l_request.envelope_tag := p_envelope_tag;
    RETURN l_request;
    END;
    PROCEDURE add_parameter(p_request IN OUT NOCOPY t_request,
    p_name IN VARCHAR2,
    p_type IN VARCHAR2,
    p_value IN VARCHAR2) AS
    BEGIN
    p_request.body := p_request.body||'<'||p_name||' xsi:type="'||p_type||'">'||p_value||'</'||p_name||'>';
    END;
    PROCEDURE generate_envelope(p_request IN OUT NOCOPY t_request,
              p_env IN OUT NOCOPY VARCHAR2) AS
    BEGIN
    p_env := '<'||p_request.envelope_tag||':Envelope xmlns:'||p_request.envelope_tag||'="http://schemas.xmlsoap.org/soap/envelope/" ' ||
    'xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">' ||
    '<'||p_request.envelope_tag||':Body>' ||
    '<'||p_request.method||' '||p_request.namespace||' '||p_request.envelope_tag||':encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">' ||
    p_request.body ||
    '</'||p_request.method||'>' ||
    '</'||p_request.envelope_tag||':Body>' ||
    '</'||p_request.envelope_tag||':Envelope>';
    END;
    PROCEDURE show_envelope(p_env IN VARCHAR2) AS
    i PLS_INTEGER;
    l_len PLS_INTEGER;
    BEGIN
    i := 1; l_len := LENGTH(p_env);
    WHILE (i <= l_len) LOOP
    DBMS_OUTPUT.put_line(SUBSTR(p_env, i, 60));
    i := i + 60;
    END LOOP;
    END;
    PROCEDURE check_fault(p_response IN OUT NOCOPY t_response) AS
    l_fault_node XMLTYPE;
    l_fault_code VARCHAR2(256);
    l_fault_string VARCHAR2(32767);
    BEGIN
    l_fault_node := p_response.doc.extract('/'||p_response.envelope_tag||':Fault',
    'xmlns:'||p_response.envelope_tag||'="http://schemas.xmlsoap.org/soap/envelope/');
    IF (l_fault_node IS NOT NULL) THEN
    l_fault_code := l_fault_node.extract('/'||p_response.envelope_tag||':Fault/faultcode/child::text()',
    'xmlns:'||p_response.envelope_tag||'="http://schemas.xmlsoap.org/soap/envelope/').getstringval();
    l_fault_string := l_fault_node.extract('/'||p_response.envelope_tag||':Fault/faultstring/child::text()',
    'xmlns:'||p_response.envelope_tag||'="http://schemas.xmlsoap.org/soap/envelope/').getstringval();
    RAISE_APPLICATION_ERROR(-20000, l_fault_code || ' - ' || l_fault_string);
    END IF;
    END;
    FUNCTION invoke(p_request IN OUT NOCOPY t_request,
    p_url IN VARCHAR2,
    p_action IN VARCHAR2)
    RETURN t_response AS
    l_envelope VARCHAR2(32767);
    l_http_request UTL_HTTP.req;
    l_http_response UTL_HTTP.resp;
    l_response t_response;
    BEGIN
    generate_envelope(p_request, l_envelope);
    show_envelope(l_envelope);
    l_http_request := UTL_HTTP.begin_request(p_url, 'POST','HTTP/1.1');
    UTL_HTTP.set_header(l_http_request, 'Content-Type', 'text/xml');
    UTL_HTTP.set_header(l_http_request, 'Content-Length', LENGTH(l_envelope));
    UTL_HTTP.set_header(l_http_request, 'SOAPAction', p_action);
    UTL_HTTP.write_text(l_http_request, l_envelope);
    l_http_response := UTL_HTTP.get_response(l_http_request);
    UTL_HTTP.read_text(l_http_response, l_envelope);
    UTL_HTTP.end_response(l_http_response);
    l_response.doc := XMLTYPE.createxml(l_envelope);
    l_response.envelope_tag := p_request.envelope_tag;
    l_response.doc := l_response.doc.extract('/'||l_response.envelope_tag||':Envelope/'||l_response.envelope_tag||':Body/child::node()',
    'xmlns:'||l_response.envelope_tag||'="http://schemas.xmlsoap.org/soap/envelope/"');
    -- show_envelope(l_response.doc.getstringval());
    check_fault(l_response);
    RETURN l_response;
    END;
    FUNCTION get_return_value(p_response IN OUT NOCOPY t_response,
    p_name IN VARCHAR2,
    p_namespace IN VARCHAR2)
    RETURN VARCHAR2 AS
    BEGIN
    RETURN p_response.doc.extract('//'||p_name||'/child::text()',p_namespace).getstringval();
    END;
    END soap_api;
    SHOW ERRORS
    CREATE OR REPLACE PACKAGE pkg_my_webservice IS
    FUNCTION call_myfunction(vp_parameter1 VARCHAR2,vp_parameter2 VARCHAR2) RETURN VARCHAR2;
    END pkg_my_webservice;
    CREATE OR REPLACE PACKAGE BODY pkg_my_webservice IS
    vg_funciton_fnc VARCHAR2(256):='ConversionRate';
    vg_ws_address VARCHAR2(255):='http://www.webservicex.net/CurrencyConvertor.asmx';
    FUNCTION call_myfunction(vp_parameter1 VARCHAR2,vp_parameter2 VARCHAR2)
    RETURN VARCHAR2 AS
    ol_req soap_api.t_request;
    ol_resp soap_api.t_response;
    BEGIN
    ol_req:=soap_api.new_request(vg_funciton_fnc,'xmlns="'||vg_ws_address||'"');
    soap_api.add_parameter(ol_req,'string1','partns:string',vp_parameter1);
    soap_api.add_parameter(ol_req,'string2','partns:string',vp_parameter1);
    ol_resp:=soap_api.invoke(ol_req,vg_ws_address,vg_funciton_fnc);
    RETURN soap_api.get_return_value(ol_resp,'result','xmlns:m="'||vg_ws_address||'"');
    END call_myfunction;
    END pkg_my_webservice;
    -----------------------------------------------------------------------------------------------------------------------------------

    Hi,
    The soap_api package internally uses the utl_http api. I used the utl_http package directly and it works for me. Below is the code for the call, you will have to substitute the variables to suit your setup..
    Hope this Helps
    Thanks
    CREATE OR REPLACE FUNCTION get_webservice_dets(p_emp_number IN VARCHAR2
    ,p_eff_date IN DATE)
    RETURN VARCHAR2
    IS
    lc_proc VARCHAR2(50) := 'get_webservice_dets';
    ln_error_stg NUMBER := 0;
    lc_eff_date VARCHAR2(50) := NULL;
    soap_request VARCHAR2(32767);
    soap_respond VARCHAR2(32767);
    -- HTTP variables
    req utl_http.req;
    resp utl_http.resp;
    -- Store the Webservice URL in a Profile Option and change for each environment
    lc_wsdl_url VARCHAR2(32767) := FND_PROFILE.VALUE('XXERP_WEBSRVC_URL');
    -- return Values
    lc_retval VARCHAR2(32767);
    lc_response VARCHAR2(32767);
    lc_xml_ext_str VARCHAR2(100) := '/env:Envelope/env:Body/OutputParameters/';
    lc_xml_ext_unit VARCHAR2(50) := '/text()';
    lc_xmlns_ns1_url VARCHAR2(240) := 'xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/db/APPS/XXERP_SOA_HCM_PKG/GET_SUPERVISOR_NO/"';
    lc_xmlns_env_url VARCHAR2(240) := 'xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"';
    lc_xmlns_xsi_url VARCHAR2(240) := 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"';
    lc_xmlns_url VARCHAR2(240) := 'xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/APPS/XXERP_SOA_HCM_PKG/GET_SUPERVISOR_NO/"';
    lc_xml_namespace VARCHAR2(5000) := lc_xmlns_env_url||' '||lc_xmlns_xsi_url||' '||lc_xmlns_url;
    lc_xmlns_soap_url VARCHAR2(240) := 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"';
    lx_Response XMLTYPE;
    BEGIN
    ln_error_stg := 10;
    IF NVL(lc_wsdl_url,'X') <> 'X' THEN
    -- Format the date received as required by the Webservice i.e. - 'YYYY-MM-DDTHH:MI:SS+01:00'
    lc_eff_date := REPLACE(TRIM(TO_CHAR(TRUNC(p_eff_date),'YYYY-MM-DD HH:MI:SS')),' ','T')||'+01:00';
    -- Form a SOAP Envelope - Exact envelope can be obtained by invoking the above EndPoint URL in a browser session with required
    -- parameters and then clicking on the XML Source
    soap_request:= '<soap:Envelope '||lc_xmlns_soap_url||'>
    <soap:Body '||lc_xmlns_ns1_url||'>
    <ns1:InputParameters>
    <ns1:P_EMPLOYEE_NUMBER>'||p_emp_number||'</ns1:P_EMPLOYEE_NUMBER>
    <ns1:P_DATE>'||lc_eff_date||'</ns1:P_DATE>
    </ns1:InputParameters>
    </soap:Body>
    </soap:Envelope>';
    -- Initiate the HTTP request, don't forget to pass in the POST and HTTP/1.1
    req := UTL_HTTP.BEGIN_REQUEST(lc_wsdl_url, 'POST','HTTP/1.1');
    ln_error_stg := 20;
    -- Set the HTTP Request Headers
    UTL_HTTP.SET_HEADER(req, 'Content-Type', 'text/xml'); -- since we are dealing with plain text in XML documents
    ln_error_stg := 40;
    UTL_HTTP.SET_HEADER(req, 'Content-Length', LENGTH(soap_request));
    ln_error_stg := 50;
    -- Set the SOAP Action to the Operation Name
    -- The function Name <getSupervisorID> should match the Webservice Operation Name in SOA
    UTL_HTTP.SET_HEADER(req, 'SOAPAction','getSupervisorID'); -- required to specify this is a SOAP communication
    ln_error_stg := 60;
    -- Append the SOAP Envelope to the HTTP request Header
    UTL_HTTP.WRITE_TEXT(req, soap_request);
    ln_error_stg := 70;
    -- Fetch the HTTP response from the Webservice - This will contain the SOAP Envelope response
    -- that needs to be processed downstream
    resp := UTL_HTTP.GET_RESPONSE(req);
    ln_error_stg := 80;
    -- Extract the HTTP response and store in a String Variable
    -- READ_TEXT is a specific method exposed to read the SOAP envelope returned from Webservice
    -- READ_LINE will read the entire HTML response back from the Server..
    UTL_HTTP.READ_TEXT(resp, lc_retval);
    ln_error_stg := 90;
    -- Create an XML Document from the String returned by the HTTP response..
    lx_Response := SYS.XMLTYPE.CREATEXML(lc_retval);
    ln_error_stg := 110;
    -- If the response is not null then extract the string value of the required output parameter
    -- the env: tag needs to be qualified with a corresponding namespace.
    IF lx_Response IS NOT NULL THEN
    lc_response := lx_Response.extract(lc_xml_ext_str||'PERSON_ID'||lc_xml_ext_unit,lc_xml_namespace).getstringval();
    ELSE
    DBMS_OUTPUT.PUT_LINE('XMLTYPE Doc returns NULL !!');
    lc_response := NULL;
    END IF;
    ln_error_stg := 120;
    -- End the response, otherwise you get
    -- UTL_HTTP.TOO_MANY_REQUESTS exception after 5 tries
    UTL_HTTP.END_RESPONSE(resp);
    ELSE
    DBMS_OUTPUT.PUT_LINE('Web Service URL not populated, please provide a value for the Profile Option XXERP: Web Service URL');
    lc_response := NULL;
    END IF;
    RETURN lc_response;
    EXCEPTION
    WHEN UTL_HTTP.TOO_MANY_REQUESTS THEN
    UTL_HTTP.END_RESPONSE(resp);
    RETURN NULL;
    WHEN UTL_HTTP.END_OF_BODY THEN
    UTL_HTTP.END_RESPONSE(resp);
    RETURN NULL;
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('ERROR @'||ln_error_stg||': '||SQLERRM);
    UTL_HTTP.END_RESPONSE(resp);
    RETURN NULL;
    END get_webservice_dets;

  • Calling Webservice from Pl/sql

    Hi All,
    Can any one give me a detailed example, to call a web service from a pl/sql package. preferably by POSt method.
    Thank you!

    check this out for some ideas: http://www.bloggingaboutoracle.org/archives/calling-web-services-from-plsql

  • Modified "Create error table" from CKM SQL problem

    Hi guys!
    I have a strange problem while creating error table by the CKM. I've changed in the interface from flow control to static control and now the command to create error table looks like:
    create table STG_TMP.E$_I_D_ASSORTMENT_S
    ERR_TYPE VARCHAR2(1 CHAR) NULL,
    ERR_MESS VARCHAR2(250 CHAR) NULL,
    CHECK_DATE DATE NULL,
    ORIGIN VARCHAR2(100 CHAR) NULL,
    CONS_NAME VARCHAR2(35 CHAR) NULL,
    CONS_TYPE VARCHAR2(2 CHAR) NULL
    the create error table(it should create table with all the columns varchar2 and handle the situation when column is number(0,0) => varchar2(255)) step from CKM is:
    <%=snpRef.getColList("<?\t", "int vL[POS]=[LONGC]+[SCALE]; if(\u0022[DEST_DT]\u0022.equals(\u0022DATE\u0022)) {vL[POS]=20;}; if(\u0022[DEST_DT]\u0022.equals(\u0022NUMBER\u0022) && vL[POS]==0) {vL[POS]=255;};", "\n \t", "\n?>", "INS")%>
    create table <%=snpRef.getTable("L","ERR_NAME", "W")%>
    ERR_TYPE <%=snpRef.getDataType("DEST_VARCHAR", "1", "")%> <%=snpRef.getInfo("DEST_DDL_NULL")%>,
    ERR_MESS <%=snpRef.getDataType("DEST_VARCHAR", "250", "")%> <%=snpRef.getInfo("DEST_DDL_NULL")%>,
    CHECK_DATE <%=snpRef.getDataType("DEST_DATE", "", "")%> <%=snpRef.getInfo("DEST_DDL_NULL")%>,
    <%=snpRef.getColList("", "[COL_NAME]\t varchar2 (<?=vL[POS]?>) " + snpRef.getInfo("DEST_DDL_NULL"), ",\n\t", "", "INS")%>,
    ORIGIN <%=snpRef.getDataType("DEST_VARCHAR", "100", "")%> <%=snpRef.getInfo("DEST_DDL_NULL")%>,
    CONS_NAME <%=snpRef.getDataType("DEST_VARCHAR", "35", "")%> <%=snpRef.getInfo("DEST_DDL_NULL")%>,
    CONS_TYPE <%=snpRef.getDataType("DEST_VARCHAR", "2", "")%> <%=snpRef.getInfo("DEST_DDL_NULL")%>
    Do you know whats the problem??
    Thanks in advance :)
    With regards,
    PsmakR

    What version of ODI are you using ?
    Are you still using Sunopsis ?
    Try using ODI 10.1.3.5
    Also, follow the solution in post
    Issue with Create Target Table in CKM Oracle

  • Developing Webservice from PL/SQL package

    Oracle 10.2.0.1.0
    Oracle JDeveloper 10.1.3.1.0
    Oracle APEX 3.2
    Oracle HTTP server w/ mod_plsql
    Hello! I'm not sure if this is the right forum for this post, if not please direct me to the more appropriate forum...
    I have a need to create a webservice for packaged procs in our database. The purpose is to allow other systems to be able to utilize this webservice in order to pass information to our Oracle APEX application. I have attempted to follow the example provided in the following link:
    http://st-curriculum.oracle.com/obe/jdev/obe1013jdev/10131/wsfromplsqlpackage/devwsfrom%20plsql.htm
    However, being new to webservices, I'm having trouble understanding what needs to be done in order to publish the webservice. I'm not sure what steps our DBA needs to perform in order to install and configure OC4J. Any suggestions or references on how to get started with this?
    Your help and guidance is appreciated!
    -- Chirayu

    You need to have an instance of OC4J running on a server. Then you can deploy to it directly from insider JDeveloper.
    A basic how-to that show deployment with 10.1.3 is here:
    http://www.oracle.com/technetwork/testcontent/deployment-100609.html
    The Oracle Application Server documentation library will have instructions about installing OC4J on the server and configuring it.

  • Generate PDF from SmartForm Style Problem

    Hi everyone,
    I am a starter at ABAP.I made document with SmartForms.There is a 3 pages.According to Table Information SmartForms tables can be changed. I coded a how to transfer informations to pdf. My problem is  the field values included 'ğ,ş,i' letter.But this letters doesn't shown in pdf.This letters show like a 'X' .  How can solve this problem ?

    Hello,
    Firstly you need to check if the correct fonts used in the form.
    You can check the SAP note:
    776507 SAPscript/SmartForms: Which fonts for which languages?
    Also check if you are using the correct device type for the PDF output, if your system is a unicode system you can use
    device type SWINCF or PDFUC as per SAP notes: 812821 and 999712.
    Regards,
    David

  • Calling Webservices from Oracle PL/SQL

    Hi,
    I am trying to call a webservice from PL/SQL using Oracle-10g database.
    I am getting the error at the line ::
    http_req:=utl_http.begin_request(p_url,'POST','HTTP/1.0');
    p_url parameter is populated with the corresponding correct url.
    ERROR ::
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1029
    ORA-12541: TNS:no listener
    However my application is runing fine in the server and from Toad/SQL plus I am able to connect to the database.
    From outside also , the webservices are working. Please help me to solve this problem.
    - Thanks
    Sandipan

    You're probably behind a firewall and need to set a proxy server in the database.
    You can do this by adding the following code (of course before you make a call to the SOAP request)
    utl_http.set_proxy('yourproxy.yourcompany.com', NULL);

Maybe you are looking for

  • My humble opinion about Droid X vs Droid Incredible

    I had a chance to try out a Droid Incredibile for three days. I prefer the Droid X for several reasons: On the X I can place any phone contact on any screen and use either a widget or an apps. With the Incredible you are limited to "favorites" only a

  • Alerts on mapping error from BPM

    In my BPM, when I use 'Throw Alert' via control step before transformation, it creates an Alert. What I would like to do is to Throw Alert when there is a mapping error. And in order to do this, I created an exception block within my transformation s

  • Photobucket will not load for me on Safari.

    ever since the new beta update for photobucket started, the page wouldn't  load anymore. I denied the new beta update for photobucket but since then my photobucket hasn't been working on safari. When ever I typed in www.photobucket.com it always glit

  • Message if Expiry date of Master Test Equipment is in the Past

    Hi All, We need system give a mesage when expiry date of master test equipment (which is assigned as a PRT in the equipment task list) is in the Past at the time of result recording of an Equipment. Problem Details:- Master test equipment is defined

  • Trying to create myRect class then draw giving problems

    Please help me I am Intro Java Student. Thanks My Rect class looks like following: import java.awt.*; import javax.swing.*; public class MyRect extends Object{ private int x1=0,y1=0,w=0,h=0; // Coordinates of the Point /* No-arguments Constructor pub