Invoking a web service that returns binary

Hi,
Is it possible to invoke a web service that returns a binary object?
Its similar the following example but I need to return a binary object :
declare
v_url:='http://www.somesite.com/function_name?invoke=placeOrder&par1=val1'
v_output varchar2(4000);
begin
select utl_http.request(v_url)
into v_output from dual;
end;
Thanks in advance

No "advantage" as there are two very different tools.
UTL_HTTP is basically an Oracle PL/SQL web browser. It uses the HTTP application protocol. It is just like your ordinary browser (IE, Firefox, Opera), but as it is server-side and display-less, it comes without a rendering engine.
UTL_DBWS is to interact with web services using the SOAP application protocol.

Similar Messages

  • BPEL build error when invoke an extrenal Web Service that returns an Array

    Hello,
    I built with JDeveloper a web service that returns an Array of Java Bean classes and I try to invoke this web service from a BPEL process. The wsdl file is automatically generated by the JDev. When I built the BPEl project I obtained the following error:
    [bpelc] [Error] :-1:-1: src-resolve.4.2: Error resolving component 'SOAP-ENC:Array'. It was detected that 'SOAP-ENC:Array' is in namespace 'http://schemas.xmlsoap.org/soap/encoding/', but components from this namespace are not referenceable from schema document 'http://malangiu-ro:8988/cde-Project-context-root/CdeFactoryWS?WSDL'. If this is the incorrect namespace, perhaps the prefix of 'SOAP-ENC:Array' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'http://malangiu-ro:8988/cde-Project-context-root/CdeFactoryWS?WSDL'.
    [bpelc] [Error] :-1:-1: src-resolve.4.2: Error resolving component 'SOAPENC:Array'. It was detected that 'SOAPENC:Array' is in namespace 'http://schemas.xmlsoap.org/soap/encoding/', but components from this namespace are not referenceable from schema document 'http://malangiu-ro:8988/cde-Project-context-root/Top300FactoryWS?WSDL'. If this is the incorrect namespace, perhaps the prefix of 'SOAPENC:Array' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'http://malangiu-ro:8988/cde-Project-context-root/Top300FactoryWS?WSDL'.
    [bpelc] [Error] :-1:-1: src-resolve.4.2: Error resolving component 'SOAP-ENC:Array'. It was detected that 'SOAP-ENC:Array' is in namespace 'http://schemas.xmlsoap.org/soap/encoding/', but components from this namespace are not referenceable from schema document 'http://malangiu-ro:8988/cde-Project-context-root/CdeFactoryWS?WSDL'. If this is the incorrect namespace, perhaps the prefix of 'SOAP-ENC:Array' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'http://malangiu-ro:8988/cde-Project-context-root/CdeFactoryWS?WSDL'.
    Any hint? Thanks in advance!
    Regards,
    Marinel

    Hi,
    BPEL and BPEL PM do not have a good support for SOAPENC-Array: it would be very difficult to create such an array in BPEL or to receive it and manipulate it.
    The (unfortunately very intrusive) work around is to change the WSDL of the service to use a XML type defined using XML schema. This is all the more painful that JDev 9.0.4 does not have strong support for complex types.
    In general though, I would highly recommend this best practice:
    1) Start by define the WSDL contract first
    2) Then generate the server side skeleton to implement it
    3) Use BPEL as the client to this contract.
    By starting with the contract first, you make sure that 1) your interfaces are clean and coarse grained.
    2) things like java objects, sessions, etc to not leak through the interface (which would be the worst thing that could happen because it would closely link the client and the server.
    Sorry for not being more helpful. This will get radically cleaner in Oracle AS 10.1.3.
    Edwin

  • Problem with web service that returns an object with a String that have som

    Hi everybody:
    I have a problem with a web service I am doing, I have made a web service that returns a collection of objects, the objects have a set of properties, there is one property that is a String,this property consists in a text fragment that could have some characters that are considered special in XML like &, <, >, " and that's why when I execute the service from a client an exception is thrown:
    {code}
    Exception in thread "main" org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Could not read XML stream.. Nested exception is com.ctc.wstx.exc.WstxParsingException: Expected a text token, got START_ELEMENT.
    at [row,col {unknown-source}]: [9,646]
    org.codehaus.xfire.fault.XFireFault: Could not read XML stream.. Nested exception is com.ctc.wstx.exc.WstxParsingException: Expected a text token, got START_ELEMENT.
    at [row,col {unknown-source}]: [9,646]
    at org.codehaus.xfire.fault.XFireFault.createFault(XFireFault.java:89)
    at org.codehaus.xfire.client.Client.onReceive(Client.java:410)
    at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:139)
    at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
    at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
    at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
    at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:79)
    at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:114)
    at org.codehaus.xfire.client.Client.invoke(Client.java:336)
    at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
    at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
    at $Proxy0.search(Unknown Source)
    at cu.co.cenatav.webservices.client.Client.main(Client.java:26)
    {code}
    I know that this is happening because special characters are sent by the soap message but I don't know how to solve this problem.
    How could I avoid this exception ?
    I hope you can help me.
    Regards.
    Ariel

    Hi,
    BPEL and BPEL PM do not have a good support for SOAPENC-Array: it would be very difficult to create such an array in BPEL or to receive it and manipulate it.
    The (unfortunately very intrusive) work around is to change the WSDL of the service to use a XML type defined using XML schema. This is all the more painful that JDev 9.0.4 does not have strong support for complex types.
    In general though, I would highly recommend this best practice:
    1) Start by define the WSDL contract first
    2) Then generate the server side skeleton to implement it
    3) Use BPEL as the client to this contract.
    By starting with the contract first, you make sure that 1) your interfaces are clean and coarse grained.
    2) things like java objects, sessions, etc to not leak through the interface (which would be the worst thing that could happen because it would closely link the client and the server.
    Sorry for not being more helpful. This will get radically cleaner in Oracle AS 10.1.3.
    Edwin

  • Invoke web service to return binary file (image) using soap

    Dear all,
    Please I a problem when invoking a web service throgh soap protocol,
    this we service has two operations, the first one takes student id and return doctype of it's documents id's,
    the another operation takes the document id and return it's image ( this is like archiving system)
    NOTE:
    I use soap package from this link:
    [http://www.oracle-base.com/dba/miscellaneous/soap_api.sql|http://www.oracle-base.com/dba/miscellaneous/soap_api.sql]
    Also I tried to invoke the following web service but failed:
    [http://www.webservicex.net/WS/WSDetails.aspx?CATID=12&WSID=56]
    CREATE OR REPLACE PACKAGE BODY pkg_my_webservice IS
    vg_funciton_fnc VARCHAR2(256):='GetCitiesByCountry';
    vg_ws_address VARCHAR2(255):='http://www.webservicex.net/globalweather.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;
    Please can any one tell me how to invoke this web service to achive this ?
    Thanks in advance

    I don't see a version number.
    I don't see any indication as to where the code you posted originated.
    I don't see any indication of whether it works or does not work (for example an error message).
    If you have questions about web services ask them in the correct forum.
    If you want someone to teach you how to use them all I can tell you is that the developers where I work use lots of SOAP and not one has written a procedure similar to what you posted.

  • SQL Server 2008 Reporting Project - Invoke/Consume Web Service and Return Dataset in C# Code-Behind

    Hello,
    I have a Visual Studio 2010 C# class with a method that invokes/consumes a web service and returns an XML dataset. I am traversing through the parent/child nodes and parsing out the data then inserting it into a SQL Server 2008 R2 table for a join within
    another stored procedure. 
    Instead of using a 3rd party API to generate the PDF for this data, I am creating an SSRS report. The formatting will be easier and I can do a RenderFormat directly to PDF.
    Can I expect to be able to transfer the code-behind method to this report and have it be able to work with the web service the same way? It is a SOAP-based web service returning parent nodes and two levels of nested child nodes.
    I have also been researching the approach of calling the web service in the same stored procedure that is currently querying the physical tables (which is used to populate a gridview and PDF) but it looks like it may only be possible with a CLR stored procedure.
    Is it possible to implement a CLR stored procedure within an SSRS report? 
    Hope this makes sense. Any help, suggestion or point in the right direction would be greatly appreciated.
    Thanks,
    Buster

    Hi Buster,
    SSRS supports web service data source, we can call the SOAP-based web service in SSRS report directly. Then, we can use custom code in SSRS to parse the XML data. However, we won’t be able to join another data in SQL Server database.
    Reference:http://technet.microsoft.com/en-us/library/aa964129(v=sql.90).aspx#repservxmlds_topic3
    We cannot implement a CLR stored procedure within an SSRS report directly. In order to execute the CLR store procedure in a SSRS report, we have to execute it as text using the following code:
    Exec <stored procedure name>
    Reference:
    http://dotnetslackers.com/Community/blogs/bmains/archive/2009/01/15/executing-a-clr-stored-procedure-in-reporting-services.aspx
    Hope this helps.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • Web Service That Return A Table

    Hello,
    Does Someone Know A WebService Witch Return Or Have A Parameter That Is A Table
    Thank You For Your Answers

    Hello,
    Maybe this links will give you a hint.
    /people/thomas.jung3/blog/2005/01/05/develop-a-web-service-that-sends-an-email--in-abap
    http://help.sap.com/saphelp_nw04/helpdata/en/e9/ae1b9a5d2cef4ea4b579f19d902871/content.htm
    Bye
    Gabriel P.-

  • A web service that returns a xml file and gets another xml file as input?

    Hi,
    I want to create a web service which gets an xml document as input then returns again an xml document.How can I create this kind of web service?
    Is this kind of implementation is possible?
    public Document mywebservice(Document input){
    Document d;
    return d;
    or do I have to use serialization processes which I don't know very much.
    I am waiting for your help.Thank you...

    If you want to deal directly with the Document and not want the SOAP engine to serialize/deserialize the XML into Java objects, then you can easliy implement this using Axis. Look at the Axis documentation (http://ws.apache.org/axis/java/user-guide.html#ServiceStylesRPCDocumentWrappedAndMessage) under the heading "Message Services". One of the provided API methods that Axis provides is in the form you want: public Document method(Document body). Hope that helps. As for how to implement the service using Axis, that is beyond the scope of this forum. Check the Axis docs for more help on that.

  • Write Web service to return binary file

    Hi there,
    I am trying to write a simple weblogic web service which read a file (pdf, doc, png...) and return the file in SOAP (as attachment).
    I haven't found any bea tutorial on that topic. I would appreciate if you could provide me some links or some tutorials about SOAP attachment with weblogic 10.0
    Best regards,
    Phuong

    I don't see a version number.
    I don't see any indication as to where the code you posted originated.
    I don't see any indication of whether it works or does not work (for example an error message).
    If you have questions about web services ask them in the correct forum.
    If you want someone to teach you how to use them all I can tell you is that the developers where I work use lots of SOAP and not one has written a procedure similar to what you posted.

  • Calling A Web Service That Returns A PDF

    I'm looking at building a new browser based Flex application
    One of the web services I'll be calling returns a PDF as a octet-stream in the XML
    I would like that PDF to open in a new browser window.
    Has anyone seen anything like this done with Flex?
    If so, could you point be to any examples or reference docs that may help me to figure out how.
    Thanks
    Mathias

    I'm looking at building a new browser based Flex application
    One of the web services I'll be calling returns a PDF as a octet-stream in the XML
    I would like that PDF to open in a new browser window.
    Has anyone seen anything like this done with Flex?
    If so, could you point be to any examples or reference docs that may help me to figure out how.
    Thanks
    Mathias

  • Invoking a Web Service that Requests NTLM Authentication in BPEL Process

    Hi,
    I am trying to invoke a webservice which requires NTLM Authentication.able to test the service through SOAP ui .
    Followed the steps memntioned in the oracle doc in order to invoke the same service through BPEL Process, some how I am facing issue when BPEL invokes the service. Here is the error message
    oracle.fabric.common.FabricException: oracle.fabric.common.FabricException: Error in getting XML input stream: Response: '401: Unauthorized' for url:
    Oracle doc link  :-
    http://docs.oracle.com/cd/E28280_01/admin.1111/e10226/soacompapp_secure.htm#BABJEBIF
    http://www.albinsblog.com/2014/04/oraclewebservicespreemptivebasicauth.html#.VK5UEiuUeFM
    The above link discuss about the properties that need to be set in composite.xml file in order to invoke the service.
    I am using SOA 11.1.1.6,  tried to implement the same steps but i could see the error message "Unauthorized for url ********** "
    Could you please help me on this.
    Thanks

    Hi Guys ,
    Got to kow that this is a bug. Some how following link helps in sending the payload to webservice which requires NTLM authentication thru JAVA.
    Thoughts Oracle SOA OSB: NTML Authentication - Oracle SOA suite
    Thanks

  • Writing a web service that returns a table

    Hello Experts,
    I'm a bit new to J2EE programing and will appreciate your help.
    The main question is:
    What is the best way to return a table from a web service?
    In details:
    I wrote an EJB calling an RFC.
    The RFC returns a table.
    I've created a web service from this EJB and need to return the above table as an output parameter.
    What is the best way of passing the JCO.Table as an output parameter?
    Should I pass it as an Object (and the client will take care of the casting)
    or - is there a simple type I should convert the table to before passing it?
    Thanks for your help, Adi.

    Hi Adi,
    The way I always return a JCO table in my Webservice Interface is returning an Interface.
    Say you JCO table is a Person with different attributes in it.
    Then I create an Interface IPerson with methods like
    public abstract String getName(); etc.
    I also create an object Person with methods:
    public String getName() {
    return name;
    In my bean the I have a method:
    public IPerson getJCOPerson() {
    //retrieve the JCO table person
    IPerson pers = new Person();
    pers.setName(//name from JCO table);
    etc.
    return pers;
    I hope this helps you further.

  • 10g: Invoking a web service asynchronously from BPEL

    Hello,
    I am trying to figure out a good, generic method for making a previously synchronous web service asynchronous and changing the way in which it is invoked from BPEL. I am using SOA Suite 10g (10.1.3.5)
    As I understand, one possible method to achieve this is to use IDeliveryService.post() to deliver the web service's response to the BPEL process. For this route, the standard practice of correlation seems to be to supply a correlation Id when invoking the web service and returning the same correlation id as a part of the web service's response message. However, I want to avoid this since it would mean that all response messages from the web service (10+) would have to be modified to include a correlationId, which is problematic in the special case of this web service. Including a correlationId in the request message is possible, however.
    I have tried the approach of using the conversation Id directly instead of the correlation Id, by reading the value of ora:getConversationId(), passing this to the web service and setting the property CONVERSATION_ID of the response NormalizedMessage to the same value when returning. However, I cannot seem to get this approach right. Is this possible at all?
    An alternative might be to use WS-Addressing, but I do not know if I can make the web service support this - it is written using the EJB WebService-Annotations feature and runs on OC4J as well.
    Do you have any suggestions on how this problem could be resolved?
    Edited by: 901765 on 12.12.2011 06:01

    I have found the following tutorial that implements something similiar to what I am trying to do: http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135/odiscenario_bpelcallback/odiscenario_bpelcallback.htm#t3
    Because of this, I am now confident that the conversation IDs can be used to achieve correlation. I have implemented the pattern by performing
    an invoke activity on the web service, passing the result of ora:getConversationId() as part of the message. The conversation Id returned is of UUID-Form.
    After the invoke activity, I have added a pick activity to receive the response message supplied by the web service through IDeliveryService.post(...). I can see that the message is received correctly by loooking at the contents of DLV_MESSAGE. However, the pick activity times out every time (after 10m). Looking at DLV_SUBSCRIPTION reveals that the conversation_id for the pick/receive activity is set to a value of the form bpel://localhost/default/MyBpelProcessName~1.0/7610001-BpInv0-BpSeq2.7-2. As far as I know, this should instead be set to the UUID that ora:getConversationId() returned before performing the invoke activity. What is going wrong here?
    Thanks for your help!

  • Detail; The fault returned when invoking the web service operation

    Hi,
    We are getting below errors from Coldfusion, I am not a coldfusion expert engg. so unable to trace it futher..kindly suggest some move to get this resolve.
    Detail; The fault returned when invoking the web service operation is:<br> <pre>AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server faultSubcode: faultString: java.lang.reflect.UndeclaredThrowableException faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:java.lang.reflect.UndeclaredThrowableException at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:221) at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:128) at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:10 87) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch( Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(U... ''</pre>
    Message: Cannot perform web service invocation getStudentByNRIC.
    StackTrace: coldfusion.xml.rpc.ServiceProxy$ServiceInvocationException: Cannot perform web service invocation getStudentByNRIC. at coldfusion.xml.rpc.ServiceProxy.invokeImpl(ServiceProxy.java:230) at coldfusion.xml.rpc.ServiceProxy.invoke(ServiceProxy.java:143) at 

    I expected something like:
    http://localhost:8500/opensource/QBWC_Shell.cfc?wsdl
    Apart from that, your code looks right.

  • 11G - invoking an asynchronous Web service that is not a BPEL process

    Hi all,
    Is there an 11G example of implementing and invoking an asynchronous Web service that is not a BPEL process ? . In 10g there is an example for Axis web service (Oracle_Home\integration\orabpel\samples\interop\axis\BPELCallingAsyncAXIS ) but I can't find anything related to 11G so far.
    Thanks in advance,
    sasha

    Hey Chris.
    I am just starting to write a jcd that calls an external web service but cannot find any sample code nor instructions on how to do it in the supplied documentation. Could you send me a code sample from your one?
    Cheers
    Matt

  • Invoking a web service from a java code

    Hello
    I created a simple Web service using JDevlper. It contains two methods
    1) getInf int () {
    return inf;}
    2) void setInf (int a) {
    inf = a;}
    I have deployed it on Oracle Application server. By inserting the address in a browser, I tried both methods and it works correctly.
    Here I am looking how to invoke this web service using a java client and use the method setInf (5 ) / * for example * /.
    I search but I have not found an answer that works :(. I hope you could help me to solve this problem.
    Thank you in advance

    Because you weren't told what to get, perhaps you already have it eh?
    What you want to read up about is JAX-WS, which is the webservice API bundled by default with your JDK (Java 6 and up). You'll find the wsimport tool in the bin directory of your JDK. I recommend you explore that directory and read up about all the executables you can find there, to be more prepared in the future. Know the tools you work with and all that. Most tools have a manual on this website:
    http://www.oracle.com/technetwork/java/javase/tech/index.html
    (under tools and utilities). Not wsimport, that is part of the jax-ws documentation. Better you look for jax-ws tutorials using Google, it will be quicker.

Maybe you are looking for