How to consume the web service using PLSQL in 11g

Hello

I created a site using jDeveloper, web services which when I put in the web browser and press enter, it will display the settings screen and when I pass the value for the parameter, and then it displays the output of the XML returned by the PL/SQL (called in the Web Service) package. Now, I want to call this webservice in PL/SQL and read XML data and fill in the staging table. Can anyone suggest me how to achieve this functionality by using Oracle PL/SQL

I use the database 11g and jDeveloper Version :-Studio Edition version 10.1.3.0

Thank you very much in advance.

Vijay

The WSDL file describes the web service.

To obtain the WSDL, you enter the URL of the web service and add some ? WSDL to the URL. This indicates the web service to return to its definition.

For example

URL of the Web Service: http://wsf.cdyne.com/WeatherWS/Weather.asmx

WSDL URL: http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL

When you read (using 'web browser' UTL_HTTPpackage) the XML response from the web service, read as strings (PL/SQL varchar2, size 32 K max).

You should read the answer as the strings, then writing/writeappend these channels in a CLOB (using the DBMS_LOB package). If you are VERY sure that the web service call ALWAYS returns an XML of less than 32 k, you can skip using a CLOB.

Whatever it is, read you the response from the web service in the form of text (such as plain text, it is what is sent). The next step on your part is to parse text into an XML DOM (document object model) - and storing the DOM in an Oracle XmlType variable.

When in a DOM, you can use Oracle XML functions to extract the attributes and values of the key element of the response from the web service.

Tags: Database

Similar Questions

  • Consume a Web service using javax.microedition.xml.rpc.Operation

    Requirement. Consume a Web Service using native libraries of Blackberry.

    Target WebService: http://ws.cdyne.com/WeatherWS/Weather.asmx

    WebService of the operation: http://ws.cdyne.com/WeatherWS/Weather.asmx?op=GetCityWeatherByZIP

    Environment: Eclipse JDE 1.3.0 with BB SDK Enterprise Server BB 5.0.0

    First Guide of: http://blog.bayestech.com/?tag=blackberry

    1 Java Stub

    public interface IWeatherServiceZip
    {
        public String getWeatherServiceByZip(String zipCode) throws java.rmi.RemoteException;
    
    }
    

    2. Service Java class

    import java.rmi.RemoteException;
    import javax.microedition.xml.rpc.ComplexType;
    import javax.microedition.xml.rpc.Element;
    import javax.microedition.xml.rpc.Operation;
    import javax.microedition.xml.rpc.Type;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.JAXRPCException;
    
    import com.lm.bb.ws.interfaces.IWeatherServiceZip;
    
    /**
     * @author lmo0
     *
     */
    public class WeatherServiceZip implements IWeatherServiceZip, javax.xml.rpc.Stub
    {
        protected static final QName _qname_operation_GetCityWeatherByZIP = new QName("http://ws.cdyne.com/WeatherWS", "GetCityWeatherByZIP");
        protected static final QName _qname_GetCityWeatherByZIPResponse = new QName("http://ws.cdyne.com/WeatherWS", "GetCityWeatherByZIPResponse");
        protected static final QName _qname_GetCityWeatherByZIP = new QName("http://ws.cdyne.com/WeatherWS", "GetCityWeatherByZIP");
        protected static final Element _type_GetCityWeatherByZIP;
        protected static final Element _type_GetCityWeatherByZIPResponse;
    
        private String[] _propertyNames;
        private Object[] _propertyValues;
    
        public WeatherServiceZip()
        {
            _propertyNames = new String[]
            { ENDPOINT_ADDRESS_PROPERTY };
            _propertyValues = new Object[]
            { "http://ws.cdyne.com/WeatherWS/Weather.asmx" };
        }
    
        public void _setProperty(String name, Object value)
        {
            int size = _propertyNames.length;
            for (int i = 0; i < size; ++i)
            {
                if (_propertyNames[i].equals(name))
                {
                    _propertyValues[i] = value;
                    return;
                }
            }
            String[] newPropNames = new String[size + 1];
            System.arraycopy(_propertyNames, 0, newPropNames, 0, size);
            _propertyNames = newPropNames;
            Object[] newPropValues = new Object[size + 1];
            System.arraycopy(_propertyValues, 0, newPropValues, 0, size);
            _propertyValues = newPropValues;
    
            _propertyNames[size] = name;
            _propertyValues[size] = value;
        }
    
        public Object _getProperty(String name)
        {
            for (int i = 0; i < _propertyNames.length; ++i)
            {
                if (_propertyNames[i].equals(name))
                {
                    return _propertyValues[i];
                }
            }
            if (ENDPOINT_ADDRESS_PROPERTY.equals(name)
                    || USERNAME_PROPERTY.equals(name)
                    || PASSWORD_PROPERTY.equals(name))
            {
                return null;
            }
            if (SESSION_MAINTAIN_PROPERTY.equals(name))
            {
                return new Boolean(false);
            }
            throw new JAXRPCException("Stub does not recognize property: " + name);
        }
    
        protected void _prepOperation(Operation op)
        {
            for (int i = 0; i < _propertyNames.length; ++i)
            {
                op.setProperty(_propertyNames[i], _propertyValues[i].toString());
            }
        }
    
        public String getWeatherServiceByZip(String zipCode) throws RemoteException
        {
            Object inputObject[] = new Object[]
            { zipCode };
    
            Operation op = Operation.newInstance(_qname_operation_GetCityWeatherByZIP,    _type_GetCityWeatherByZIP, _type_GetCityWeatherByZIPResponse);
            _prepOperation(op);
            op.setProperty(Operation.SOAPACTION_URI_PROPERTY,"http://ws.cdyne.com/WeatherWS/GetCityWeatherByZIP");//SOAP Action
            Object resultObj;
            try
            {
            resultObj = op.invoke(inputObject);
            System.out.print(resultObj.toString());
            } catch (JAXRPCException e)
            {
            e.printStackTrace();
            Throwable cause = e.getLinkedCause();
            if (cause instanceof java.rmi.RemoteException)
            {
            throw (java.rmi.RemoteException) cause;
            }
            throw e;
            }
            return (String) ((Object[]) resultObj)[0];
        }
    
        static
        {
            _type_GetCityWeatherByZIPResponse = new Element(_qname_GetCityWeatherByZIPResponse,_complexType(new Element[]
                    { new Element(new QName("http://ws.cdyne.com/WeatherWS","GetCityWeatherByZIPResult"), Type.STRING, 0, 1, false) }), 1, 1,false);
            _type_GetCityWeatherByZIP = new Element(_qname_GetCityWeatherByZIP,_complexType(new Element[]
                    { new Element(new QName("http://ws.cdyne.com/WeatherWS","ZIP"), Type.STRING, 0, 1, false) }), 1, 1, false);
            }
    
        private static ComplexType _complexType(Element[] elements)
        {
            ComplexType result = new ComplexType();
            result.elements = elements;
            return result;
        }
    }
    

    3 problem

    There is no information about the exception that occurs when I try to debug my Application actually when you call the Web Service to:

    resultObj = op.invoke (inputObject);

    Any help.  If you have any other suggestions on how to consume a web service using BB. I don't want to use KSOAP2 because the source code is not updated more and prefer the native BB mode without using the 3rd party jars.

    Thank you

    How do you generate the stub class? Have you used Sun's Wireless Toolkit?

  • Problem of DH handshake with the web service using ColdFusion 7 and 8 after java update 8

    ColdFusion 7 and 8 are provided with a variant of JRE1.6.

    I have a script that has consumed a web service for years with success.  Last week, the web service provider updated their version of Apache and Java on the server java 1.8 (or java-8).

    I could no longer consume the web service once the web service provider updated to Apache and Java and would be the following error DH keypair every time that I try to consume the service:

    -----------------

    AxisFault

    faultCode: {http://schemas.xmlsoap.org/soap/envelope/} Server.userException

    faultSubcode:

    faultString: javax.net.ssl.SSLException: java.lang.RuntimeException: could not generate keypairs DH

    faultActor:

    faultNode:

    faultDetail:

    {}http://xml.apache.org/axis/} stackTrace:javax .net .ssl .SSLException: java.lang.RuntimeException: could not generate keypairs DH

    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:190)

    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1591)

    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1554)

    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1537)

    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1130)

    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1107)

    at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:186)

    to org.apache.axis.transport.http.HTTPSender.getSocket (HTT... ''

    -----------------

    I asked the service provider web, why it would stop working and how we can solve this problem.  They suggested that upgrade to the latest version of Java on my server running ColdFusion.  I did some research and found the problem to be with the amount of memory allocated to the variable containing the encryption key.

    The big problem is when I tried to update java on this particular server (Windows Server 2003), the installation has returned a messaged stating that he could not run on the older operating system and I need to update my OS to install java.

    Does anyone have a workaround in ColdFusion 7 or 8 that you can establish the DH handshake using Java 1.6 on your local server while consuming a web service on a server using Java 1.8?

    Hi, frank000000,

    I know that we had a serious problem with any Java 7 after update 25.  They are off a lot of network permissions and other things, for safety, that used to be available in versions prior to the update 25.  But it's while we were in CF Server 9.

    Since we switched to CF Server 10 (making sure that we got the CF Installer provided with Java 8), we had very few issues related to Java.

    It seems strange to me that the upgrade to 1.8 host while your server is 1.6 would cause problems.  It could very well be something else.  I would like to ask the host for documentation describing exactly how/why their 1.8 may cause interference with your 1.6.

    HTH,

    ^_^

  • How to call the web service?

    Hello

    I want to know how to call the web service from my application HTML5 & javascript.

    Please help me find this detail as what I can access easily. and I want to access web services online (a method of it) I'm not concered with how background Web service takes place.

    I just want that when you call a web service method, I will return the result.

    Please try this out for a WebService call

    var xmlhttp;
    xmlhttp = new XMLHttpRequest();
    xmlhttp.open("get","your url",true);
    xmlhttp.setRequestHeader("Accept","application/json");
    xmlhttp.setRequestHeader("Content-type", "application/json");
    xmlhttp.onreadystatechange=function() {
     if (xmlhttp.readyState==4) {
      if (xmlhttp.status == 200) {
        console.log(xmlhttp.responseText);
      }
     }
    }
    xmlhttp.send();
    

    This will display the result of the invocation of webservice. The url is the application that you deploy and the type can be get/post. If xmlhttp.send (post) takes argument for the display of the data. You can call it by clicking a button in HTML.

  • How to transfer data from oracle to the web service using ODI with axis2 tech

    Hi all

    Can someone cause a document or markets about 'How to transfer data from oracle to the web service with the help of ODI with AXIS2 technology'
    If any person with a document or markets, please share it with me

    Thank you
    Phani

    I can give you a few examples of web services in ODI, perhaps that you find them useful?
    Try: -.
    http://John-Goodwin.blogspot.com/2009/04/ODI-series-Web-services.html
    http://John-Goodwin.blogspot.com/2009/05/ODI-series-Web-services-part-3.html
    http://John-Goodwin.blogspot.com/2009/05/ODI-series-Web-services-part-4.html

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • What happened to the application Panel in Dreamweaver (consume the web service)?

    Pre-Creative cloud, I had used Dreamweaver to create a code to consume external web services. It was, I believe, the Panel "Applications".

    How to use Dreamweaver CC to consume a web service? I'm not finding anything that contributes to this day.

    Thanks in advance,

    BW

    Cold Fusion support has been removed from the DW with the release of CC 2013.

    The last version to support CF was Creative Suite 6 (CS6 2012).

    If you are a subscriber to paying creative cloud, you can fall back to your Creative Cloud Desktop App CS6 clicking applications > all THE APPS, scroll down, click on the PREVIOUS VERSIONS.  CS6 will appear in the list options.

    Nancy O.

  • Consume peoplesoft Web services using Jdeveloper authentication failure

    Hello

    I use Jdeveloper 11 g to consume the webservice of peoplesoft and following the exact steps in the following article.
    http://www.Oracle.com/technology/tech/fmw4apps/PeopleSoft/OFM-PSFT-blog-postings.HTML#Web-services
    The Web service I use is different from the example I use the production version of the wsdl file.
    After following all the steps, the generated proxy creates not poseurs of the getter for user name, password (Basic authentication).
    Is it supposed to auto generate or what I need to encode?
    I did the code of the getter set username and password and provide the credentials, but I get an error authentication failed.

    java.rmi.RemoteException: SOAPFaultException - FaultString FaultCode [http://schemas.xmlsoap.org/soap/envelope/ {} Client.Authentication] [did not receive message weblogic.wsee.util.AccessException: a code of 401 error (unauthorized) was returned by the server to http://ps-dev-web.kc.lan:30710/PSIGW/HttpListeningConnector.] Please check that the username and password are set correctly and that you are authorized to access the requested method.
    -> Http://ps-dev-web.kc.lan:30710/PSIGW/HttpListeningConnector server returned a code of 401 error (unauthorized). Please check that the username and password are set correctly and that you are authorized to access the requested method.
    ] FaultActor detail [null] [< detail > < bea_fault:stacktrace xmlns:bea_fault = "http://www.bea.com/servers/wls70/webservice/fault/1.0.0" > weblogic.wsee.util.AccessException: a code of 401 error (unauthorized) was returned by the server to http://ps-dev-web.kc.lan:30710/PSIGW/HttpListeningConnector.] Please check that the username and password are set correctly and that you are authorized to access the requested method.
    at weblogic.wsee.connection.transport.http.HTTPClientTransport.handleErrorResponse(HTTPClientTransport.java:373)

    The code I used to generate getter, setter is

    -These methods have not generated-
    public String getPassword() {}
    (String) return ((heel) port). getProperty (Stub.PASSWORD_PROPERTY);
    }

    public void setPassword (String password) {}
    ((Heel) port). setProperty (Stub.PASSWORD_PROPERTY, password);
    }

    public String getUsername() {}
    (String) return ((heel) port). getProperty (Stub.USERNAME_PROPERTY);
    }

    {} public void setUsername (String username)
    ((Heel) port). setProperty (Stub.USERNAME_PROPERTY, username);
    }
    I don't know where I'm going wrong, credentials, I used the work normally but do not work with this application.
    I'd appreciate if I can get some light on this issue.

    Thank you
    Ash

    Published by: [email protected] on June 2, 2010 07:56

    In your case, the settings are not IN/OUT but OUTSIDE.
    To create the owner and get the values after the operation, you must do something like this:

    Create the parameters of the licensee
    Holder nt new holder =();
    Holder det holder new =();

    Make the call
    port.createCompIntfcKCMWEBCASECI (nt, det);

    Get the value
    System.out.println ("Value is" + nt.) Value();

    Thank you
    Vishal

  • How to add THE web service to the ACL?

    I want to access a web service from a PL/SQL procedure (using UTL_HTTP) since a 11g R2 database. However, before you do anything, I need to give access to the web service by adding the web service to the access control list (ACL).

    I want to test the web service is full here: http://www.service-repository.com/service/overview/-1789095104

    This is a free WS, you can use to test the code WS.  The endpoint is http://www.w3schools.com/webservices/tempconvert.asmx

    Therefore, adding www.w3schools.com to list ACL will be fine, I think? Am I wrong?

    I tried the method below but I get this error and the user guide is not clear what to do.

    SQL > exec dbms_network_acl_admin.assign_acl (LCD = > 'temp_ws1.xml', host = > 'www.w3schools.com');

    BEGIN dbms_network_acl_admin.assign_acl (LCD = > 'temp_ws1.xml', host = > 'www.w3schools.com'); END;

    *

    ERROR on line 1:

    ORA-31001: handle or path of the invalid resource name ' / sys/acls/temp_ws1.xml '.

    ORA-06512: at "SYS." DBMS_SYS_ERROR', line 86

    ORA-06512: at "SYS." DBMS_NETWORK_ACL_ADMIN', line 94

    ORA-06512: at "SYS." DBMS_NETWORK_ACL_ADMIN', line 479

    ORA-06512: at line 1

    Any help would be greatly appreciated.

    This,

    host-online "www.w3shools.com."

    is not the same thing as this,

    host-online "www.w3schools.com".

  • APEX 4.2.3 consume the web service returning a PDF problem

    Using APEX 4.2.3 on a database of Oracle 11 g R2, Firefox 31.7, we ask a service web restful one before the process of page header, to download a PDF Code file used:

    declare

    CLOB l_clob;

    l_blob blob.

    l_sql_delimiter varchar2 (30);

    l_lang_context integer: = DBMS_LOB. DEFAULT_LANG_CTX;

    l_warning integer: = DBMS_LOB. WARN_INCONVERTIBLE_CHAR;

    l_dest_offset integer: = 1;

    l_source_offset integer: = 1;

    l_Json VARCHAR2 (4000);

    Start

    l_clob: = null;

    DBMS_LOB.CREATETEMPORARY (l_blob, true);

    -Generate here the content of your file in l_clob.

    hr_Pkg.Security_Termination_Form(:P4200_PERSON_HR_ID,l_Json);

    hr_Pkg.call_rest_webservice (l_Json, 'TestME.Pdf', l_Clob);

    Logger.log ('CLOB SIZE IN PAGE: ' | sys.) DBMS_LOB. GetLength (l_clob));

    sys. HTP.init;

    sys.owa_util.mime_header (' application/pdf', FALSE, 'UTF-8');

    sys. HTP.p ("Content-length: ' |") sys.DBMS_LOB.GetLength (l_clob));

    sys. HTP.p ('Content-Disposition: attachment; filename = "TestME.Pdf" ');

    sys.owa_util.http_header_close;

    () DBMS_LOB.converttoblob

    dest_lob = > l_blob,

    src_clob = > l_clob,

    amount = > DBMS_LOB. LOBMAXSIZE,

    dest_offset = > l_dest_offset,

    offset = > l_source_offset,

    blob_csid = > DBMS_LOB. DEFAULT_CSID,

    lang_context = > l_lang_context,

    WARNING = > l_warning

    );

    Logger.log ("SIZE of BLOB: ' |") sys. DBMS_LOB. GetLength (l_blob));

    sys.wpg_docload.download_file (l_blob);

    apex_application.stop_apex_engine;

    exception when others then

    sys. HTP. PRN (' error: ' |) SQLERRM);

    apex_application.stop_apex_engine;

    end;

    We run in the question, that the PDF file is empty with the exception of a few fill-able fields that must be completed in advance by the call to the web service.

    When you run the web service directly from the browser, the PDF that is generated is very well and seems to be complete. And the size of the file that is created as the clob from the web service call is exactly the same size it as the pdf file received directly from the web service.

    When we compare the size of the clob to the size of the blob, we see that the blob is slightly larger in size than the clob.

    Any suggestions? (Sample code for posting to the hosted site for Oracle will not work because you can not call the hosted instance web services and web service is hosted BEHIND our firewall).

    Thank you

    Tony Miller
    Software LuvMuffin
    Ruckersville, WILL

    Problem is resolved... As opposed to the use of the APEX apex_web_service.make_rest_request must use the utl_http.begin_request and then treats the query returned through utl_http. READ_RAW and who then saving it in a temporary BLOB.

    Maybe when we update to the APEX 5, I'll see if I can deal with it using standard APEX packages...

    Thank you

    Tony Miller
    Software LuvMuffin
    Salt Lake City, UT

  • How to access the web service from Oracle?

    Database version: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0

    I'm making a call to a web service through a procedure/function...

    I tried to use
    CREATE OR REPLACE PROCEDURE Call_Rest_Webservice
    
     AS
    
      t_Http_Req Utl_Http.Req;
    
      t_Http_Resp Utl_Http.Resp;
    
      t_Request_Body VARCHAR2(30000);
    
      t_Respond VARCHAR2(30000);
    
      t_Start_Pos INTEGER := 1;
    
      t_Output VARCHAR2(2000);
    
    BEGIN
    
      /*Construct the information you want to send to the webservice.
      
      Normally this would be in a xml structure. But for a REST-
      
      webservice this is not mandatory. The webservice i needed to
      
      call excepts plain test.*/
    
      t_Request_Body := 'the data you want to send to the webservice';
    
      /*Telling Oracle where the webservice can be found, what kind of request is made
      
      and the version of the HTTP*/
    
      t_Http_Req := Utl_Http.Begin_Request('**webservice address**',
                                           'GET',
                                           'HTTP/1.1');
    
      /*In my case the webservice used authentication with a username an password
      
      that was provided to me. You can skip this line if it's a public webservice.*/
    
      --Utl_Http.Set_Authentication(t_Http_Req, 'username', 'password');
    
      /*Describe in the request-header what kind of data is send*/
    
      Utl_Http.Set_Header(t_Http_Req, 'Content-Type', 'text/xml charset=UTF-8');
    
      /*Describe in the request-header the lengt of the data*/
    
      Utl_Http.Set_Header(t_Http_Req, 'Content-Length', Length(t_Request_Body));
    
      /*Put the data in de body of the request*/
    
      Utl_Http.Write_Text(t_Http_Req, t_Request_Body);
    
      /*make the actual request to the webservice en catch the responce in a
      
      variable*/
    
      t_Http_Resp := Utl_Http.Get_Response(t_Http_Req);
    
      /*Read the body of the response, so you can find out if the information was
      
        received ok by the webservice.
      
        Go to the documentation of the webservice for what kind of responce you
      
        should expect. In my case it was:
      
        <responce>
      
          <status>ok</status>
      
        </responce>
      
      */
    
      Utl_Http.Read_Text(t_Http_Resp, t_Respond);
    
      /*Some closing?1 Releasing some memory, i think....*/
    
      Utl_Http.End_Response(t_Http_Resp);
    
    END;
    But it's me ORA-29272: HTTP request failed
    ORA-06512: at "SYS." UTL_HTTP", line 1029
    ORA-12545: Connect failed because target host or object does not exist

    But I can connect to the web server by going on * webservice address * through my browser.

    Is there an ACL must be open in order to have this capacity? I asked my s/n, but she asked me that I will need to give its name to username/password / ip in order to open an ACL...
    However there is no name to username/password required during a tour of the web service...

    Any help would be much appreciated...

    Thank you

    Published by: 986006 on March 4, 2013 08:38

    Y.L wrote:

    This is because the database could not connect to the specified server. Bad host name or IP address specified. Inability to resolve the hostname to an IP address. Firewall blocking. Etc.

    The host name, I put here can be visit through my browser. I think that it is not question of the host server... So, it could be a firewall on my side of the database which must be opened in order to visit the host?

    The "web browser" (your PL/SQL using UTL_HTTP code) code is running on the Oracle database server. He needs the same type of network access that has your browser on your PC. (firewalls open, authentication of the proxy if necessary, etc.).

    On 11g. Not on 10g.

    I saw the code example you post from the link you provided... those who only works on 11 g?
    If we can work on 10g, which package or what are the steps I need to follow in order to have that works on me?

    The code I posted works on both versions. My comment was regards the ACLs. No ACLs exist on 10g. If you only need to execute privs on the affected packages (e.g., UTL_HTTP, etc.).

    ACL were introduced with 11g - 11g, you also need the ADMINISTRATOR to create an ACL for you which will allow access to the UTL_HTTP network so now.

  • How to deploy the web service PAPI

    I am new to OBPM.
    I use BPM studio 10.3 to create processes.
    I set the preferences of the engine "from PAPI web services." This works.
    But I do not know how to deploy them to web services PAPI since the BPM web service console shows that no service is deployed.

    Please tell me how to deploy BPM processes.

    Thank you very much

    Published by: YE on March 27, 2009 09:58

    To expose processes that Webservice, please follow the steps below.
    Just click on process--> select process Webservice then it will open a new window, and then specify the name of the corresponding input parameter Web service method.

    Then build the application and test the service by clicking on the icon LaunchDeployedWebServiceswebapp in Eclipse, it will open the new window, it contains information about Web service, URL endpoint to access the WSDL Style HTTP WS, WS-Security authentication basic authentication.

    Thank you best regards &,.
    M.Kumaraswamy.

  • Problems with the Web Service using XML in Flex

    Hello

    I use a ColdFusion CFC, which is configured to generate an XML string. It runs on ColdFusion MX 6.1 and is configured as a remote web service. I tested the call and it returns the string XML fine when it is called from another method of Flex unfounded. My problem is this simple Flex application to call the same function via a service web, I wrote below. I cannot get to the exit results, keeps showing as NULL. I can't use the HTTP of Flex appeal for remote access because I'm not under MX7. Does anyone know what is wrong with my code? BTW, I would do the work of cross - domain.xml file to call the cfc, let me know if you want to test and I can add your domain name. Thank you!

    <? XML version = "1.0" encoding = "utf-8"? >
    "" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml ' layout = "absolute" >

    <! - set Web Service to get the XML data of course catalog - >
    < mx:WebService
    ID = "cd".
    "WSDL =" http://training.wonderware.com/components/courses.cfc?wsdl "
    Load = "CD.getCourseCatalogXML.Send ()" "
    showBusyCursor = "true" fault = "Alert.show (event.fault.message), 'Error' ' result =" cdResult (event) ">"
    < mx:operation name = "getCourseCatalogXML" resultFormat = "e4x" >
    < mx:request >
    < IDCalendrier > 3 < / IDCalendrier >
    < / mx:request >
    < / mx:operation >
    < / mx:WebService >

    < mx:Script >
    <! [CDATA]
    Import mx.controls.Alert;
    Import mx.rpc.events.ResultEvent;
    Import mx.rpc.events.FaultEvent;

    [Bindable]
    public var outputString:String

    public void cdResult(event:ResultEvent):void
    {
    outputString = event.result as String
    }
    []] >
    < / mx:Script >

    < mx:Canvas horizontalScrollPolicy = "off" verticalScrollPolicy = "off" >
    < mx:Text width = '100% ' paddingLeft = "4" paddingRight = paddingTop "4" = "4" >
    < mx:text > OUTPUT: {outputString} < / mx:text >
    < / mx:Text >
    < / mx:Canvas >

    < / mx:Application >

    Thank you very much! I do not have the notion that the HTTPService is indded just an HTTP call. So yes that it a much simpler way to call just ColdFusion to return the XML string to the application. No reason to use Flash Remoting or CFCS etc... and certainly not a web server. This made the turn that I called a HTTPService now what charges by coldfusion page that returns XML and bam, works well with e4x result etc... Thanks tracy!

  • How to start the web service

    Need to use the web server or to publish web pages, is there anywhere to start easily, thank you.

    Help-> find examples - > LV Queue Server

    /Y

  • How to call the web service in blackberry sdk 3.6 using eclipse


    Hello

    I said it

    His work very well when I run as html in the browser IE.

    while I try to run in webworks, it gives the error.

    Thank you

    Barro

  • Client application to consume the web service with security

    I need to write a simple client to access a WS.

    I can't do things

    1. Change the server
    2. Add external jars

    The customer will be part of a command line call and will work as a stand alone.

    I searched all day and have found hundreds of examples of wave, too complex, based mainly on SOAPHandler (who tells me that I need to install the server components that I can't do)

    I grasp the General requirements but finds it difficult to know how to add security features to the header.

    What should I do to add the chips of user name and password in the header?

    It is where I am so far.

    package findingLetter;
    
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.List;
    import javax.xml.namespace.QName;
    import javax.xml.soap.MessageFactory;
    import javax.xml.soap.SOAPBody;
    import javax.xml.soap.SOAPBodyElement;
    import javax.xml.soap.SOAPConnection;
    import javax.xml.soap.SOAPConnectionFactory;
    import javax.xml.soap.SOAPElement;
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPException;
    import javax.xml.soap.SOAPHeader;
    import javax.xml.soap.SOAPMessage;
    
    public class getPOC {
        public getPOC() {
            super();
        }
        public List<String> lookup(String lenderid, String url, String user, String pw) throws SOAPException {
            List<String> contactInfo = new ArrayList<String>();
            SOAPMessage message = MessageFactory.newInstance().createMessage();
            SOAPHeader header = message.getSOAPHeader();
            header.detachNode();
             
            SOAPEnvelope envelope = message.getSOAPPart().getEnvelope();
            envelope.setAttribute("namespace","http://www.siebel.com/xml/FHA%20Lender%20Summary%20Request%20IO");
             
            SOAPBody body = message.getSOAPBody();
            QName bodyName = new QName("LenderSummaryRequestIo");
            SOAPBodyElement bodyElement = body.addBodyElement(bodyName);
            SOAPElement symbol = bodyElement.addChildElement("Institution");
            symbol.addTextNode(lenderid);
             
            SOAPConnection connection = SOAPConnectionFactory.newInstance().createConnection();
            SOAPMessage response = connection.call(message, url);
            connection.close();
             
                    SOAPBody responseBody = response.getSOAPBody();
                    SOAPBodyElement responseElement = (SOAPBodyElement)responseBody.getChildElements().next();
                    SOAPElement returnElement = (SOAPElement)responseElement.getChildElements().next();
                    if(responseBody.getFault()!=null){
                        System.out.println(returnElement.getValue()+" "+responseBody.getFault().getFaultString());
                    } else {
                        System.out.println(returnElement.getValue());
                    }
             
                    try {
                        System.out.println(getXmlFromSOAPMessage(message));
                        System.out.println(getXmlFromSOAPMessage(response));
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
            return contactInfo;
        }
        private static String getXmlFromSOAPMessage(SOAPMessage msg) throws SOAPException, IOException {
            ByteArrayOutputStream byteArrayOS = new ByteArrayOutputStream();
            msg.writeTo(byteArrayOS);
            return new String(byteArrayOS.toByteArray());
        }
    }
    

    Here's the code to add the security header.

    public List lookup (user string lenderid, String url, String, String pw) throws SOAPException {

    ............

    SOAPHeader header = message.getSOAPHeader ();

    If (header == null) {}

    Header = envelope.addHeader ();

    }

    SOAPElement headerElement = createSecurityHeader (uName, pWord);

    soapHeader.addChildElement (headerElement);...

    ........................

    }

    Private Shared { SOAPElement createSecurityHeader (uName, pWord String String) throws SOAPException

    SOAPElement UsernameToken = null;

    SOAPFactory SFactory = SOAPFactory.newInstance ();

    UsernameToken = sFactory.createElement ("wsse: UsernameToken", "", WS);

    SOAPElement Username = sFactory.createElement ("wsse:Username", "", WS);

    Username.setValue (uName);

    UsernameToken.addChildElement (Username);

    SOAPElement Password = sFactory.createElement("wsse:Password","",WS);

    Password.setValue (pWord);

    QName qname = new QName("","Type");

    Password.addAttribute (qname,"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText" ");

    UsernameToken.addChildElement (Password);

    SOAPElement wsseSecurity = sFactory.createElement("wsse:Security","",WS);

    wsseSecurity.addChildElement (UsernameToken);

    Return wsseSecurity;

    }

Maybe you are looking for

  • Stop guard my Mac Pro (early 2008) and it is difficult to restart.

    I have a Mac Pro (early 2008) still works after the installation of El Capitan. The problem is that after a few hours he will leave, and to restart, I have to switch off/on power and try to restart several times. Sometimes, the fan runs at full speed

  • error generating a source distribution

    I get the following error when generating a source distribution in LabView 8.6: Error 1 has occurred to AB_Destination.lvclass:Copy_File.vi-> AB_Source.lvclass:Copy_SourceItem.vi-> AB_Build.lvclass:Copy_Files.vi-> AB_Build.lvclass:Build.vi-> AB_Build

  • RE: WINDOWS XP SP3 of queries sent October 2, 2010 dear Sir,

    RE: Queries WINDOWS XP SP3 Envoy on October 2, 2010 Dear Sir. We just installed Service Pack 3.  Now several changes have taken place, we want to reverse. 1. all records have the beginning with FILE menu command FIND the best choice (in bold).  That

  • problems of version 1.5 package

    This is the message that I FINALLY received my printer after having repeatedly tried to solve the problem.I wanted to just send and print the photo of my new grandson. In addition, he won't let me attach my photos to my Yahoo E mail.  Help! Message a

  • WCS Web integration - Auth-AD

    Hello, we are trying to create a Web Auth SSID using Active Directory to authenticate users. Someone has it as the fields on the map of WCS in AD? Gregg