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.

Similar Messages

  • 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.

  • 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.

  • How to write Web Service Log to a file in Java

    Hi..
    I have a requirement that I need to maintain Log file of my web service which is deployed on OC4J server.
    Is there any API for this ? Or any other way to do it ?
    Regards,
    Ajay

    Hi..
    Thanks.
    Instead of using Logging API, I created own class to handle Log.
    But my issue is When Ever I am appending Log to already created file the following Line is also appending.
    <?xml version = '1.0' encoding = 'UTF-8'?>I want this Line only one time in each log file.
    What should I do for this ?
    Regards,
    Ajay

  • How to write a web service for uploading a file

    Hi all,
    I want to write a web service for uploading a file to some specified folder under application server, how to do that? Thanks

    I believe the "difference" that you're seeing is that one web service is "RPC" style (The Hello World example) and one web service is "Document" style (The WSDL you have downloaded).
    Document-style web service methods always have one element as a parameter, and this parameter manifests itself as a SOAPElement in the service interface.
    RPC-style web services are true "remote procedure calls", and are more functional in nature, in that they accept multiple parameters. JAX-RPC will bind these parameters to generated Java types.

  • 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

  • How configure a primavera web service to return data from the second database?

    Hi everyone,
    We have P6 with first WS deployed on a single server weblogic domain. The first WS return data from the first database instance.
    Then deployed advanced second WS on a separate weblogic domain server with a different port. Configured second WS with <WS2_INSTALL_HOME>/bin/dbconfig.sh, creating a new branch of a configuration that specifies a different second instance of the database. However, this configuration is ignored and second web services return data from the first database.
    We have one domain, which including next servers:
    Name / Host / Port / Deployments
    P6 / localhost / 0001 / P6(v8.3), p6ws1(v8.3)
    p6ws2 / localhost / 0002 / p6ws2(v8.3)
    Now we have two different file BREBootstrap.xml.
    P6 BREBootstrap.xml:
    <Database>
    <URL>jdbc:oracle:thin:@db1:1521:db1</URL>
    <UserName>pubuser</UserName>
    <Password>anycriptopass1</Password>
    <Driver>oracle.jdbc.OracleDriver</Driver>
    <PublicGroupId>1</PublicGroupId>
    </Database>
    <CfgVersion>8.330</CfgVersion>
    <Configurations>
    <BRE name="P6 Config_DB1" instances="1" logDir="anydir/P6EPPM/p6/PrimaveraLogs"/>
    </Configurations>
    p6ws2 BREBootstrap.xml:
    <Database>
    <URL>jdbc:oracle:thin:@db2:1521:db2</URL>
    <UserName>pubuser</UserName>
    <Password>anycriptopass2</Password>
    <Driver>oracle.jdbc.OracleDriver</Driver>
    <PublicGroupId>1</PublicGroupId>
    </Database>
    <CfgVersion>8.330</CfgVersion>
    <Configurations>
    <BRE name="P6 Config_DB2" instances="1" logDir="anydir/P6EPPM/ws2/PrimaveraLogs"/>
    </Configurations>
    ‘P6 Config_DB1’ and ‘P6 Config_DB2’ including Database property for 1 and 2 database respectively.
    How to configure a second web service to return data from the second database?
    Thanks in advance!
    Regards,
    Dmitry

    OK, so I got this to work this morning with Username Token Profile (with little help from Oracle Support).
    I followed your steps 1-4 but in step 2 I didn't add the -Ddatabase.instance=2 because I want to check to see if my code could swap between different instances.
    It appears for Username Token Profile to use Database Instance, you need to set it in the soap header.
    So my soap request looks like this:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <s:Header>
            <DatabaseInstanceId xmlns="http://xmlns.oracle.com/Primavera/P6/WS/Authentication/V1">2</DatabaseInstanceId>
            <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
                <u:Timestamp xmlns:u='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd' u:Id='uuid-327b6ed1-b26d-4a61-81d5-e326174c1961-3'>
                    <u:Created>2014-10-23T04:28:01.152Z</u:Created>
                    <u:Expires>2014-10-23T04:29:01.152Z</u:Expires>
                </u:Timestamp>
                <o:UsernameToken u:Id='uuid-327b6ed1-b26d-4a61-81d5-e326174c1961-3' xmlns:u='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'>
                    <o:Username>admin</o:Username>
                    <o:Password Type='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'>password</o:Password>
                    <o:Nonce EncodingType='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary'>vJBQhCc28bAeszej7gOaiC2tVCQ=</o:Nonce>
                    <u:Created>2014-10-23T04:28:01.152Z</u:Created>
                </o:UsernameToken>
            </o:Security>
        </s:Header>
        <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <ReadProjects xmlns="http://xmlns.oracle.com/Primavera/P6/WS/Project/V2">
                <Field>ObjectId</Field>
                <Field>Id</Field>
                <Field>Name</Field>
                <Field>Status</Field>
                <Field>StartDate</Field>
                <Field>FinishDate</Field>
                <Field>DataDate</Field>
                <Filter>Id = 'EC00515'</Filter>
            </ReadProjects>
        </s:Body>
    </s:Envelope>
    This request pulled the project from the second instance.
    V/r,
    Gene

  • Web Service to upload large files

    Hi Guys
    I'm want to create a Web Service that uploads large files (excess of 100MB). Can some help me with the best way I can do that, either C# or VB.NET.
    Thanks 

    I've done this before with a web service. It wasn't that hard. As jdweng alludes to, you need a web service and a client that knows how to repeatedly transfer the file sending it in chunks.
    The web service needs to take the file name and a byte array. It needs to return the number of bytes it received. The client calls the service endpoint passing in the name of the file and an array populated with x number of bytes. This should/could be tuned
    based on the size of the file and available bandwidth. 10 MB is a good upper limit but that may not be practical over a really slow connection... you could potentially time-out the call. The service endpoint receives the byte array and the file name. It creates/opens
    the file and appends the byte array onto the end in a synchronous manner. (You need to do it synchronous to avoid any potential race conditions with multiple calls overlapping.) When the server side is done, it returns the number of bytes written to the caller.
    The web service should close the file handle after each call since there is no guarantee that there will be another call.
    The caller then uses the return value to increment the offset pointer into the source file. When the call returns, the caller increments into the source file by the number of bytes returned then refills the buffer with the next chunk. It then re-calls the
    web service sending the same file name and the new byte array. The process continues until all of the bytes in the source file have been transferred to the server.
    I uploaded 4GB disk images to a Sharepoint server doing this so it works great and totally avoids the HTTP max payload problem.
    Good luck!

  • 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

  • How to use web dynpro's web service to import XML file

    Hi
    I have an xml file and I want to use a web dynpro's web service to cosume this file which is existing on my local drive. Can anyone help me which steps I have to do to use this file as a web service using web dynpro.
    Thanks

    Hi
    You can refer below Wiki Article on SDN. I hope that will help you out.
    [https://www.sdn.sap.com/irj/sdn/wiki?path=/display/emtech/consuming%2babap%2bweb%2bservices%2busing%2bflex]
    Thanks.

  • Web Service to transmit a file (a very large file)

    Greetings,
    Is is possible to use a web service to transmit a file, sometimes a very large file? If so, what are the security implications of doing such a thing?
    Thanks,
    Charles

    Quick answer: It depends... Did you try using Google to look-up examples of doing this? Here is a url to try: http://www.google.com/#sclient=psy&hl=en&source=hp&q=web+service+transfer+file&pbx=1&oq=web+service+transfer+file&aq=f&aqi=g1g-j3g-b1&aql=&gs_sm=e&gs_upl=1984731l1997518l0l1997874l25l19l0l1l1l0l304l3879l0.7.10.1l18l0&bav=on.2,or.r_gc.r_pw.&fp=7caaed5eb0414d97&biw=1280&bih=871
    Thank you,
    Tony Miller
    Webster, TX
    Never Surrender Dreams!
    JMS
    If this question is answered, please mark the thread as closed and assign points where earned..

  • 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 Project using WSDL file

    Hi All,
    I want to create web service project using WSDL file(I already have a wsdl file), which needs axis2 run time to generate correct project structure, I did this in eclipse but now I want to do it through JDeveloper(11.1.2.0.0), so please suggest me any ways on how can I configure axis2 runtime in Jdeveloper, and is it possible do it in Jdevloper?
    Thank You,
    Sunny
    Edited by: Sunny on May 8, 2012 1:51 AM

    Have you installed the 64-bit Access driver on your machine? See
    Data Source Names and 64-Bit Operating Systems for the differences in odbcad32. Call %SystemRoot%\system32\odbcad32.exe to check the drivers.
    How do you host your service? Stand-alone or IIS or embedded to another application? Keep in mind that IIS7 runs it in its application pool which is defaullt 64bit. Thus the bad image exception, when compiling your service as 32bit.
    When you need the Access database for your service to store informtation, then I would switch to SQL Server (Express) or XML files depending on your actual needs.
    Also check whether your account under which your service is run has the necessary NTFS file permissions on the access file and the folder. This is getting even more complex when it's a remote folder.

  • Web service to return all employees

    Hi I am new to PeopleSoft but have managed to get the OVM template up and running now in virtual box and have the web services working again CI_CI_PERSONAL_DATA.  This returns data for a single employee.  How would I go about creating a web service to return all employee data in one response so that we and sync firstname, lastname etc with an external system?  Thanks

    Thanks Hakan,  I'm trying to create a web service for the find operation but each time the wsdl created starts with "wsdl:description"
    <?xml version="1.0"?>
    <wsdl:description name="CI_CI_PERSONAL_DATA.2" targetNamespace=
    instead "wsdl:definitions" as with the original one I created for the get operation.
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:M477757.V1
    SoapUI is not happy about the new wsdl format.  Any ideas what I've done wrong?

  • Consume web service from a PAR file

    Hi All,
    Is it possible to consume web service from a PAR file? If yes, can you please give me an example / link.
    Appreciate your help.
    Thanks,
    Vimukta

    << Do not post the same question across a number of forums >>

Maybe you are looking for

  • Problem in update operation for duet enterprise 1.0 from SharePoint end.

    Hi Everyone, I have developed a sap netweaver duet enterprise 1.0 to send the data from sap to share point and from share point to sap. The problem is that I am able to test the data successfully from duet system in sap for all the operations  Query,

  • Submitting PDF attachments

    Good Day, I have 2 queries: Firstly is it possible to submit a PDF form as a .PDF attachment via email? Currently I am only able to submit forms via the .XML format. Secondly is it possible to automatically name the above mentioned PDF attachment whe

  • Update w/self referencing select?

    Hey; This doesn't seem like it should be too difficult; however, I can't seem to wrap my head around it. I have a table w/following structure: city state region Due to the way the table is getting populated, some of the regions are null. Such that: m

  • Errors -1406 and 1402 and 1603

    Hi i keep getting these errors 1406, 1402, and 1603 when i try to install it here is a pic below. http://prime-evil.com/asp_upload/Untitled-3.jpg

  • ApEx2: Many-to-many with checkboxes or multiple select list?

    Hello all together I have the following specification: * a table for tool users: tool_users(tu_id, tu_name) * a table for groups: groups(gr_id, gr_name) * a table for the many to many relationship of tool users and groups: tool_users_to_groups(tu2gr_