consume web service example

HY,

I try to consume a web service from the w3c: http://www.w3schools.com/webservices/tempconvert.asmx

I also found an example on: Re: problem with apex_web_service.make_request after upgrade to 4.1.1.00.23

But when I run the code I got the following XML:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Client</faultcode>
            <faultstring>Server did not recognize the value of HTTP Header SOAPAction: http://tempuri.org/FahrenheitToCelsius.</faultstring>
            <detail />
        </soap:Fault>
    </soap:Body>
</soap:Envelope>

My code is:

declare

l_envelope CLOB.

l_xml XMLTYPE.

l_temp varchar2 (4000);

BEGIN

" l_envelope: = ' < soapenv:Envelope xmlns:soapenv = ' http://schemas.xmlsoap.org/SOAP/envelope/ "xmlns:tem =" " http://tempuri.org/ ">

< soapenv:Header / >

< soapenv:Body >

< tem:FahrenheitToCelsius >

< tem:Fahrenheit > 71 < / tem:Fahrenheit >

< / tem:FahrenheitToCelsius >

< / soapenv:Body >

< / soapenv:Envelope > ';

l_xml: = apex_web_service.make_request)

                p_url               => ' http://www.w3schools.com/webservices/TempConvert.asmx ',

                p_action            => ' http://tempuri.org/FahrenheitToCelsius ',

p_envelope = > l_envelope

);

l_temp: = apex_web_service.parse_xml (l_xml, "/ / FahrenheitToCelsiusResponse/FahrenheitToCelsiusResult/text () ' ','xmlns ="http://tempuri.org/"'");

apex_debug.message ("Test:" | ") l_temp);

l_temp: = l_xml.getStringVal ();

: P1_XOUTPUT: = l_temp;

END;

I think that the line "p_action" is false, because http://tempuri.org doesn't work anymore.

But what url should I use instead?

with sincere friendships.

ILB

I had a few problems of namespace. now it works...

declare

l_envelope CLOB.

l_xml XMLTYPE.

l_temp varchar2 (4000);

BEGIN

"" l_envelope: = 'http://schemas.xmlsoap.org/soap/envelope/ "xmlns:tem ="http://www.w3schools.com/webservices/">."

3

';

l_xml: = apex_web_service.make_request)

p_url-online "http://www.w3schools.com/webservices/tempconvert.asmx."

p_action-online "http://www.w3schools.com/webservices/FahrenheitToCelsius."

p_envelope-online l_envelope

);

l_temp: = apex_web_service.parse_xml (l_xml, "/ / FahrenheitToCelsiusResult/text () ' ','xmlns ="http://www.w3schools.com/webservices/"'");

-l_temp: = l_xml.getStringVal ();

: P1_XOUTPUT: = l_temp;

END;

Tags: Database

Similar Questions

  • How to consume web services REST in ADF - JDeveloper 11.1.1.6

    I have an ADF application deployed on Java cloud and I'm trying everything to try to get the data into it. I could not set up a connection to the Oracle Cloud server, to remedy this I created my db cloud instance RESTful web services. Now, I need to consume web services in my ADF application.

    Is there a way to link the ADF business components to RESTful web services in version 11.1.1.6?

    If not, then how is it possible to get data in your ADF application deployed on Java cloud? You cannot connect to the DB, you can not link to REST web services, how are you supposed to use your data?

    Thank you.

    Check out hands-on experience on Oracle products: deploy Oracle Cloud database objects using JDeveloper for the part of the database and hands-on experience on Oracle products: deployment of Applications in the cloud to Oracle using JDeveloper ADF on how to deploy an application in the cloud.

    Timo

  • How to fire a manager class when consuming web service in java - weblogic

    With the help of Axis 1.4 I created client application that consumes the external server services.

    The response of the application server with the soap message that include tags header as well as the body tag.

    My problem with the header tag, I'm trying to find away to get the header element.

    What happened so far:

    I found that I need to use a handler that extends BasicHandler using this class, I can get the header tag. source: dealing with SOAP in the axis headers

    But how this handler to operate during the use of web services? I mean how to call this handler whenever I received the response from the server to get his header .

    Some articles suggest I should use .wsdd file. I use 11.1.1.7 with weblogic 10.3.6 Jdeveloper environment where I don't know web.xml configuration file.

    Question: How to bind this information (Manager class, .wsdd file and web.xml ) to collect and the Manager works for the heading tags?

    The best start was to check the Axis guide on: Apache-Axis reference Guide where you will have an overview of the workflow. (Thanks to Timo)

    To configure the handlers be trigger on the client side you need to do the following:

    1- Create class Manager basically something similar to the following:

    package mypackge; 
     import javax.xml.soap.SOAPException;
     import org.apache.axis.AxisFault;
     import org.apache.axis.MessageContext;
     import org.apache.axis.handlers.BasicHandler;
     import org.apache.axis.message.SOAPHeader;
     import org.apache.axis.message.SOAPHeaderElement; 
    
     public class SoapHeaderConsumerHandler extends BasicHandler
     { 
         public void invoke(MessageContext messageContext) throws AxisFault 
         { // Your logic for request or response handling goes here. 
          // Basically you need to make use of the parameter 
         // messageContext where you can access the soap header and body tags. 
         } 
    }
    

    2- Create the client-config.wsdd file. It will look like the following:

    http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
      
           
               
          
      
     
    
    
    

    You can see that I only use handlers for incoming response side server. So whenever the client application receives a response from the server the class Manager SoapHeaderConsumerHandler is triggered and the method invoke will be called by default.

    Note: if you want to access the outgoing request before sending to the server you need to add an additional label for to add the request handler.

    Check the Reference Deployment (WSDD) of the guide of the axis:

    3- Where to place the client-config.wsdd file?

    You will need to place the .wsdd file in the working directory. You can easily find the location of the working directory using:

    System.out.println("Working Directory = " + System.getProperty("user.dir"));
    

    Source: Get the Current Working Directory in Java

    You just place the .wsdd file here.

    Useful links:

    Where to place the file client - config.wsdd in Railo

    Handler axis V It is an example to managers of the side server.

    Dealing with SOAP headers in the axis

  • Consume Web service REST to 8.52 PT with JSON body

    We are on tools 8.52 and try to consume a web service from REST to the external address.  I have successfully built a document and I am able to use the GET operation (where no body is necessary), but for the POST, I need to be able to provide the body in JSON format.  8.52 tools is not supported with native support for JSON, but it should always be possible generate the JSON string manually, it should not?

    Has anyone else done this?

    I thought you said you were on PeopleTools 8.52. Support JSON for Documents has not been added up to 8.53. Add an element with the attribute psnonxml to your load XML and put your JSON in this element. Integration Broker will remove XML Integration Broker exit. You can see an example here: http://jjmpsj.blogspot.com/2011/10/rest-like-peoplesoft-services.html.

  • Web Service example error 413

    I have downloaded the demo of Web services to the following ADDRESS.

    http://zone.NI.com/DevZone/CDA/tut/p/ID/7350

    I tried to run the NCF Gen Demo VI

    I clicked on build->, he managed

    I clicked on deploy->

    Initializing...
    Calculating dependencies...
    The checking for conflicts. This may take some time...
    Prepare the items for download. This may take some time...
    My computer deployment
    Deployment NI_AALBase.lvlib
    Deployment NI_MABase.lvlib
    Deployment NI_WebServices.lvlib
    Gen network deployment
    Server response code: 413
    Completed with errors of deployment

    Can someone help me what is the problem?

    I use LV 2010

    My bad.

    I forgot that my OS is 64-bit...

    So I changed the bad *.conf file.

    I changed one in Program Files, I would change my Program Files x 86.

    Now, the deployment was successful.

    Maciej

  • can I use flex to consume web services?

    I'm not a Flex developer and before diving in, I want to be sure that it meets the requirements of my project. Especially, the consumption of web services. the other part of this project are a bunch of buttons and graphics that are all GUI. so I think that Flex can handle this part as Flash.
    Currently, I use flash, but my current client insists on the use of flex. so my question is: can I develop everything in Flex that I can develop in flash? or are there limits?

    If you are developing applications in Flash, then you will love Flex. Flex will make you much more productive than the Flash to produce applications of any complexity. You can do it at least 'most' of what you can do in Flash and more. There could be a few things you can do in Flash, or more easily in Flex, but your client has that right. They want to Flex and they should want it. See the help of FB3 for WebService and HTTPService, RemoteObject components.

  • Consume Web services - XMLAttributes and XMLChildren

    I consume a webservice that items contain values to XMLAttributes, XMLChildren, but not both at the same time. It is a rule, or is it possible that he could potentially return the two sets of values?

    There is no reason that a given element could not have attributes and children.

    Dave Watts, CTO, Fig Leaf Software

    http://www.figleaf.com/

    http://training.figleaf.com/

  • Using the web services via VBScript

    Hello

    I'm very big thing back to the VMware infrastructure.

    (1) in my application, I want to write a VBScript (preferebly) that can consume web services provided by ESX to clone the exsisting images and do some basic operations on, snapshot etc. as powern. Is this feasible?

    (2) according to my understanding, the services web of ESX and vSphere services are the same. Am I wrong?

    (3) services of vSphere web must vSphere is available in fact?

    Please forgive me if any of the issues makes no sense. Kindly guide me further.

    Hi Chaitanya,

    vSphere API provides a way to interface with VMware infrastructure, and these are exposed as services web servers ESX and virtual Center.

    (1) vSphere Web Services SDK facilitates the development of client applications that target the vSphere API. It allows to build SOAP-based applications to control the ESX Servers / vCenter servers and virtual machines running on them.

    You can write client applications in Java or c#. vSphere web services SDK includes files WSDL, examples of code in Java and c#, various libraries and all the necessary components required to work with the vSphere API.

    You can also use vSphere SDK for Perl which provides a script Perl to easy-to-use interface to the vSphere API. SDK comes with utilities and documentation for the creation of vSphere management applications

    (2) are you reason ESX web services are actually vSphere web services. vSphere is bascially the name given for the latest versions of 4.0. Earlier he was VI SDK 2.5/2.0 and now it's vSphere web services SDK.

    (3) vSphere web services are exposed in the ESX servers, so ultimately you need vSphere infrastructure on your side. What is it ask you?

    I hope this information helps!

    -Angela

  • Integration of Web services in Oracle e-Business 11g1.1.14 JDev

    Hello

    Could someone please help me out with the technique suitable in this regard...

    I created a JDeveloper ADF application which deploys currently use / consume web services from one of my instances of Oracle e-Business. I have outlined some by the filing of the integration of the API and you can see in JDEV.

    To create the web service (via the Wizard), I entered an address for the WSDL file. However, this address is specific to the instance of the application.

    When I migrate / deploy my application in other environments, for example from Dev to Test, I'm sure that the Web Service will always be to 'point' to my instance of development about 99.9%.

    Is the best practice for editing each WebService as I migrate through environments? Or is this now touch on the field of areas outside the scope of this forumn?

    Once again, looking for tips / directions not a complete solution... happy to do my own research it myself.

    Thanks in advance if anyone can help.

    See you soon,.

    Simon

    Read this:
    http://blogs.Oracle.com/ADF/2011/02/changing_endpoint_url_for_a_web_service_data_control.html

    And you can also use a deployment plan:
    http://kingsfleet.blogspot.com/2008/12/controlling-what-service-proxy-uses-at.html

  • Web Services connection permission

    I developed an application for my 8300 with software v 4.5

    It consumes web services as a customer.

    Every time that the application tries to consume the web service presents a new screen asking user permission to connect to the destination IP address.

    How can I avoid this application for my application runs continuously?

    Thank you

    Antonio

    Otherwise, this could be the standard BlackBerry screen "Firewall/Permissions" checking connection.

    There is a checkbox "ask once" at the bottom of the dialog box asking the question?  Try to check that.

    If it is the Application of permissions, then you have a range of options including:

    (a) that the user addresses and use the option "ask once"

    option (b) use the "Set Permissions" to download time during the installation of Over The Air

    (c) set the permissions of Applications via the BES for this application (assuming that you are pushing it the BES)

    (d) set the permissions on the device - Options--> Advanced--> Applications--> change permissions

    (e) programmatically in your Application

    Look around here this forum for other users who have asked similar questions.

  • Does support Flash Web services hosted on https?

    Hello..
    I am new to web services using flash.
    I need to consume web services hosted on https://webservices.netsuite.com/wsdl/v2008_2_0/netsuite.wsdl
    When I add this URL in the Control Panel window-others-WebServices, it throws the error
    Please enter a valid: URL / / WSDL...
    I'm using flash professional 8.
    Other http WSDL files works fine...
    Does flash support https?
    guide me to the rest...
    Thanks and greetings
    Ravi

    Delighted, he must consult with this Web hosting company. I visited your site and it contains style information. You must also check the code with http://, either it works with it or not.

  • How to use generated code of &amp; quot; Import Web Services &amp; quot; with Cairngorm framework

    I recently downloaded Flex Builder 3 beta 2 and try the wizard that allows you to import web services. The code that is automatically generated makes it so simple to consume web services using the types of objects defined in the WSDL file. Is no longer the developer don't need decode the XML load! The only problem I have is how you integrate the code automatically generated with the Cairngorm framework? This seems to be a huge issue for those who would exploit Cairngorm and code the proxy generated automatically in the same project (like me).

    Here are the problems I see so far.

    (1) how to configure the service generated class to work with the Cairngorm service locator? The service constructor only accepts a 'destination displays LCD chain' which means that you must use life cycle data services. Unfortunately, the project that I am in the process of renovation currently uses a Web service and does not use data services. All I really need to do is change the URL of the endpoint (that is, from the local level to a development server). This issue is noted in the bug https://bugs.adobe.com/jira/browse/FB-8456. I think there is a way to put the endpointURI in the Services.mxml file.
    (2) even if I come with a hack autour #1, I do not get a reminder for my same IResponder if I save it immediately after the method call. I can record and function of earphone within my business delegate and receive the reminder, but my command object that implements IResponder, did not call back even if it is registered. From what I've read in the ASDocs should be, but this isn't for me!

    These are the questions that I have observed in 3 hours to play with this. I hope this makes sense. I would like to integrate automatically generated in Cairngorm web service proxies, but I don't see a right lane to the front without redesign of Cairngorm. Has anyone else encountered this problem? If so, do you have any ideas on how to proceed? Any help is appreciated.

    Hi guys,.

    Now we focus on the generated code the right way and try to make it work for as many cases as possible. As soon as we receive some time we will try to see what is the best way to use Cairngrom.

    In the meantime, if you find a way or a great idea do not hesitate to post here.

    Thank you
    Cristian

  • Calling web services from PL/SQL

    Hello

    We have a requirement where we need to call a WebService from PL/SQL.
    I believe that we have an API of PL/SQL, which allows you to use external web services.

    I was looking for other possible options as to consume the web Service of PL/SQL.

    The one you suggest other options, and what option is best to consume the web service.


    Thank you
    AB

    Hello

    I used the http of the utl package.
    Apart from this you can also use java stored procedure. I haven't used this approach, but I found a blog for the same:

    http://technology.AMIS.nl/Blog/348/consuming-Web-services-from-PLSQL-part-i-using-Java-stored-procedures

    Kind regards

    Ketan

  • Develop Web Services in APEX

    Hello

    I'm just getting started and I need to know what is the best way to develop a web service at the apex or expose functionality as such. Is this possible or do I have to buy a product for that? If so, which?

    Thanks in advance.

    Best regards
    Pedro

    Hello Pedro,

    If you want to develop a web service, the APEX is not the first choice. You should get better for JDeveloper (also free).
    APEX is perfect for consuming web services that...

    Greetings,
    Roel

    http://roelhartman.blogspot.com/
    http://www.bloggingaboutoracle.org/
    http://www.Logica.com/

    You can assign this answer to your question in marking it as useful or Correct ;-)

  • 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

Maybe you are looking for