Attach a file in a Web Service

Hi all,
I have a question, and I need help to resolve it.
I want to work in a syncronous RFC - WebService integration scenario and I am not sure if it is possible to send a file (pdf, excel, msword,....) within the body of the xml message. I need to send/recive pdf file from a SAP system to another third party system.
It is possible? How?
It is possible to build a RFC which sends/receives files?
It is allowed in SAP XI 3.0 or SAP PI 7.0?
Thanks for all.

Hi,
only file adapter (sender)
RFC and IDOC do not support it
basically attachments are handles via proxies
(ABAP, java) and some adapters like file, or mail
have a look at this weblog:
/people/michal.krawczyk2/blog/2006/04/19/xi-rfc-or-abap-proxy-abap-proxies-with-attachments
Thanks.

Similar Messages

  • Best Practice/Standard for Securing and Attaching Files in a Web Service

    Thanks in advance.
    Being new to Web Services as well as most of my team. I would like to know what is the best practice for transporting files via a Web Service. I know of several methods and one that seems to be the standard, but you can't really tell in this ever changing world of Web Services. Below are the options that I have found.
    1. MIME encoded the file and embed in the payload of the SOAP message
    2. SwA (SOAP with Attachments) which applies MIME attachments to SOAP. I think this is similiar to the way emails are handled.
    3. DIME (Direct Internet Message Encapsulation) similiar to MIME encoding but is more efficient
    4. MTOM (Message Transmission Optimization Mechanism) I really not understand this method, but it seems that this is the NEW standard. I just don't understand why.
    5. Utilize HTTPS and download the file from an accessible file server w/ a login id and password.
    Is there someone out there that understands this problem and can assist me in understanding the pros and cons of these methods? Or maybe there is a method that I'm overlooking altogether.
    Thanks

    JWSDP supports securing of attachments [1]and will soon support securing MTOM attachments too. [1]http://java.sun.com/webservices/docs/2.0/xws-security/ReleaseNotes.html

  • File --- to--- Soap(web service)

    Hi all,
    i am doing  File ->to->Soap(web service) scenario.
    my requiremenmt would be
    1.Can we able to re-trigger failed & successful messages
    2.Can we we able send the consolidated XML for the day irrespective of individual xml's
    3.we able to send the same XML data of the same client to multiple url's
    4.the compression/encryption of an XML is possible or not
    ccould you provide me the solutions for these steps.
    Thanks in advance,
    AVR

    >
    AVReddi wrote:
    > Hi all,
    > i am doing  File ->to->Soap(web service) scenario.
    >
    > my requiremenmt would be
    > 1.Can we able to re-trigger failed & successful messages
    if the flow is asyc, you can always retrigger failed messages. Also successful messages can be retriggered manually using the test tab in RWB
    > 2.Can we we able send the consolidated XML for the day irrespective of individual xml's
    This will be a collect kind of scenario. You will use a BPM to start collecting all the files and then trigger a message based on you collect criteria
    > 3.we able to send the same XML data of the same client to multiple url's
    yes. use multiple receivers or multiple inbound interfaces in your interface determination
    > 4.the compression/encryption of an XML is possible or not
    >
    > ccould you provide me the solutions for these steps.
    >
    > Thanks in advance,
    > AVR
    use HTTPS in your SOAP adapter i.e certificates

  • Converting a java file to a web service

    How can i convert a java file to a web service,And then invoke that service by making my other java file.

    You can convert your java file into a WSDL with the WSDL2Java utility in Axis. This will create a definition that will be accessible by potential clients.
    To deploy your java class, you can use Axis in a Web Server of your choice (Tomcat, Apache). All you need to do is run the Axis Admin Client for a deploy.wsdd file and point your client to the IP:PORT.
    Very straightforward.
    http://ws.apache.org/axis/java/user-guide.html
    Hope it helps.
    SBO

  • Open a local file from a web Service

    Hello!
    Likely this is a trivial question, but I need to open a local file from a Web Service and i don't know how to get the file path. I mean that I have a WS source code placed in a proper package (my.ws.package) with an additional configuration XML file placed in the same directory. I need to read it, but if I use merely
    File conf = new File("Conf.xml");it can't find it. I've tryed with:
    MyWS.class.getClass().getProtectionDomain().getCodeSource().getLocation().getPath()in order to get the file path, but a
    java.security.AccessControlException access denied (java.lang.RuntimePermission getProtectionDomain)arises...
    I don't know...
    Suggestions?
    Thanks.
    Anhur

    Hello!
    Likely this is a trivial question, but I need to open a local file from a Web Service and i don't know how to get the file path. I mean that I have a WS source code placed in a proper package (my.ws.package) with an additional configuration XML file placed in the same directory. I need to read it, but if I use merely
    File conf = new File("Conf.xml");it can't find it. I've tryed with:
    MyWS.class.getClass().getProtectionDomain().getCodeSource().getLocation().getPath()in order to get the file path, but a
    java.security.AccessControlException access denied (java.lang.RuntimePermission getProtectionDomain)arises...
    I don't know...
    Suggestions?
    Thanks.
    Anhur

  • How to send a file to a web service

    I am developing a web service application which needs to accept a CAD model as input. Would any one tell me how to send a file from a client application to service provider.
    thanks in advance

    You can use mime encoding inside your SOAP request, something like this:
    <?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>
    <data>
      <file>
        <name>filename.zip</name>
        <content>FVberI0XlJincJEGmcbVyMOGpdWGl1bYB2r1y2vYicHqq0WYuergigzYB20GvMLZ
    Ag9YicHozwLSieOUieDLzgrLCZKncI9dCMvHDg9YicGPdqOVu3vIAMvJDcaOkq0kl0TLExDVCMrZ
    DwfSifnVzNr3yxjLkq0kl1rPDgXLicHdB252zxj0zwqGzNjVBsbmyxnLCKPLDcbqq0WPdqOVqxv0
    l1jVB3qGmIaWifiGl0LUzM8GmsaWifiGpJ4ncNn0yxj0EhjLzG0kndyYzxiGpdWGl1nPEMuGmJyG
    mdaWndiZmYaWmdaWmcbUdqOWmdaWmda0ndi1idaWmdaWig4ncNrYywLSnG0kjsvft0yncG==
    </content>
      </file>
    </data>
    </soap:Body>
    </soap:Envelope>This can even be accomplished from within Pl/Sql. Otherwise you can use the WS-Attachment feature which is (I think) not yet supported by Oracle.
    Regards,
    Michiel

  • Web service - is it possible send/receive a file consuming a web service ?

    Hello expert,
    is it possibile attache a file on web service's message ?
    ps. My system is without Java stack and without PI.
    Tks,

    Hello,
    Unfortunately not.
    SOAP with attachments (of any kind) is only supported with NetWeaver application server 6.4 WITH JavaStack. The ABAP version only supports SOAP without attachments.
    We solved this issue for outgoing files using an IDOC type which we send through an RFC destination to a URL on a webserver outside SAP which accepts a file as parameter.
    regards

  • Unable to open connection to MS Access 2013 .accdb file Under WCF Web Service Project Using Windows 8.1 64bit

    I am encountering the following error when trying to connect to an Access 2013 database:
    The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
    I have Visual Studio 2013 SP3 running on Windows 8.1 64bit OS which also has Office 2013 installed (which includes MS Access 2013).  My project is a WCF web service using .NET Framework 4.5.1 using any cpu as target.  I have tried reluctantly
    to install the older drivers as described by in the below article:
    https://social.msdn.microsoft.com/Forums/en-US/1d5c04c7-157f-4955-a14b-41d912d50a64/how-to-fix-error-the-microsoftaceoledb120-provider-is-not-registered-on-the-local-machine?forum=vstsdb
     and also went through the "Add Data Source" wizard in the Project menu to have the connect string automatically built.  Even with the automatically built connect string I can not connect to the .accdb file from within my WCF web service.
    What's odd is if I use the Database Explorer in Visual Studio it has no problem connecting the my Access file.  I inspected the connect string and tried to use it as well but still get the same error. Even stranger is that I have no problem connecting
    to the Access DB in an ASP.NET project on the same PC. I am also able to connect to the Access file using a simple Windows Forms application.  So I'm wondering if it has something to do with trying to connect to the Access file from a WCF web service
    project.
    What I'd like to know is if anyone has been able to get this to work in an environment as I described above as a 64bit WCF web service project?  I tried to switch my project to 32bit but when I do I get a different error which reads:
    System.BadImageFormatException: Could not load file or assembly 'file:
    Almost to the point of trying to get this web service project done with SQL Express but would like to know if it can be done with MS Access 2013.  Any information anyone can provide to help me get past this issue is greatly appreciated. Thanks.

    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.

  • The format of XML file returned from web service

    Hi everyone,
    My web service (build in asp.net 2.0 with C#) returns the
    following xml file which is not what I want.
    <Root>
    <Root2>
    <Person> .... </Person>
    <Person> .... </Person>
    <Person> .... </Person>
    </Root2>
    </Root>
    But I want my web service to return the following xml file.
    How can I get the following xml file instead of the above xml file
    ? Thanks.
    <Root>
    <Person> .... </Person>
    <Person> .... </Person>
    <Person> .... </Person>
    </Root>

    Thanks for everyone's reply!
    Sorry, I don't know where to set resultFormat="e4x". Below is
    my code. And LINE 111 gives error. And the error message is below.
    And the xml returned from the web service is below.
    Error: Error #2093: The Proxy class does not implement
    getDescendants. It must be overridden by a subclass.
    at Error$/throwError()
    at flash.utils::Proxy/
    http://www.adobe.com/2006/actionscript/flash/proxy::getDescendants()
    at
    LogIn/loginHandler()[P:\JIMMY-FLEX\Flex_LogIn\LogIn.mxml:58]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at
    mx.rpc::AbstractService/dispatchEvent()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\A bstractService.as:232]
    at mx.rpc::AbstractOperation/
    http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[E:\dev\3.0.x\frameworks\pro jects\rpc\src\mx\rpc\AbstractOperation.as:193
    at mx.rpc::AbstractInvoker/
    http://www.adobe.com/2006/flex/mx/internal::resultHandler()[E:\dev\3.0.x\frameworks\projec ts\rpc\src\mx\rpc\AbstractInvoker.as:191
    at
    mx.rpc::Responder/result()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\Responder.as:4 1]
    at
    mx.rpc::AsyncRequest/acknowledge()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AsyncR equest.as:74]
    at
    DirectHTTPMessageResponder/completeHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\ messaging\channels\DirectHTTPChannel.as:381]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="100%" height="100%" xmlns:ns1="*">
    <mx:Script>
    <![CDATA[
    import mx.rpc.events.ResultEvent;
    namespace FaciNS = "
    http://FaciNet.com/";
    import mx.rpc.events.FaultEvent;
    import mx.rpc.events.ResultEvent;
    import mx.rpc.soap.WebService;
    //public var __xmlResult:XML;
    public var ws:WebService;
    public function Log_In(UN:String, PW:String):void
    ws.Login(UN, PW);
    public function getLoginData():void {
    loadWSDL();
    Log_In(UN.text, PW.text);
    public function loadWSDL():void
    ws = new mx.rpc.soap.WebService();
    ws.wsdl = "
    http://localhost:50779/VS2008_LogIn/Service.asmx?wsdl"
    ws.useProxy = false;
    ws.addEventListener("fault", faultHandler);
    ws.addEventListener("result", loginHandler);
    ws.loadWSDL();
    public function loginHandler(e:ResultEvent):void {
    var wkSouID:String = e.result[0]..SouID; // LINE 111
    trace(wkSouID);
    public function faultHandler(event:FaultEvent):void
    dispatchEvent(new Event("Error"));
    public function checkUser(UName:String, PWord:String):void {
    getLoginData();
    ]]>
    </mx:Script>
    <mx:Panel id="loginPanel" horizontalScrollPolicy="off"
    verticalScrollPolicy="off" width="400" height="200" x="97"
    y="66">
    <mx:Form id="loginForm" width="100%" height="100%">
    <mx:FormItem label="Username:" color="red">
    <mx:TextInput id="UN" />
    </mx:FormItem>
    <mx:FormItem label="Password:" color="red">
    <mx:TextInput id="PW"/>
    </mx:FormItem>
    </mx:Form>
    <mx:ControlBar>
    <mx:Spacer width="100%" id="spacer1"/>
    <mx:Button label="Login" id="loginButton"
    click="checkUser(UN.text, PW.text)" />
    </mx:ControlBar>
    </mx:Panel>
    </mx:Canvas>
    <?xml version="1.0" encoding="utf-8" ?>
    - <ArrayOfLogIn xmlns:xsi="
    http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="
    http://www.w3.org/2001/XMLSchema"
    xmlns="
    http://tempuri.org/">
    - <LogIn>
    <SouID>2</SouID>
    <LogInUserID>3</LogInUserID>
    <LogInUserName>samlam</LogInUserName>
    <Password>abc123</Password>
    <DialectID>4</DialectID>
    <CreatedByUserID>5</CreatedByUserID>
    <UpdatedByUserID>5</UpdatedByUserID>
    </LogIn>
    - <LogIn>
    <SouID>3</SouID>
    <LogInUserID>4</LogInUserID>
    <LogInUserName>samlam</LogInUserName>
    <Password>abc123</Password>
    <DialectID>4</DialectID>
    <CreatedByUserID>5</CreatedByUserID>
    <UpdatedByUserID>5</UpdatedByUserID>
    </LogIn>
    </ArrayOfLogIn>

  • Reading an xml file in the web services java file

    I want to read some data in the webservices file.so i am writing my own xml file through which i want to read data.but i am not able to read xml file from web services file.also , i am not able to put xml file in the .ear file,as there is no such tag in servicegen script through which i can add xml file in the .ear file.
    i know in case of servlets,i will specify context-param attributes in web.xml,and i can access those in my servlet.can i do anything like this for webservices,and i am not using any servlets for web services.
    kindly tell any solution.

    One possible option to parse an xml-file to a flex XML object:
    public function parseConXML(source:String):void
                    xmlLoader = new URLLoader();
                    xmlLoader.load(new URLRequest(source));
                      // Eventlistener: if URL loaded --> onLoadComplete function
                      xmlLoader.addEventListener(Event.COMPLETE, xmlLoadComplete);
                public function xmlLoadComplete(evt:Event):void{               
                    var xml:XML = new XML();
                     // ignore comments in XML-File
                    XML.ignoreComments = true;  
                       //ignore whitespaces in XML-File
                     XML.ignoreWhitespace = true;
                    // XML-Objekt erstellen
                    xml = new XML(evt.target.data);
                   //AFTERWARDS use your xml as your wish

  • Reading XML file from java web service

    Hi
    I am developing web service using Netbeans and the application server is glassfish.
    but I am facing a problem
    I have folder called "config" which will include the xml files. What I need to do setting path into that folder
    but it will read from another location when I am deploying it
    How to set our own path ?
    Error
    DPL5306:Servlet Web Service Endpoint [NewWebService] listening at address [http://kapila.epic.lk:8080/WebApplication2/NewWebServiceService]
    deployed with moduleid = WebApplication2
    java.io.FileNotFoundException: /root/MyWorks/glassfish-v2/domains/domain1/config/OSconfig/MConfig.xml (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    My "conifg" folder, i have put in to working directory but it will read from "/root/MyWorks/glassfish-v2/domains/domain1/config/OSconfig/MConfig.xm"
    below method is used for getting its contain value
    public String getMainCofig() {
                String v ="";
            try{
              DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory
                        .newInstance();
              DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
              Document doc = docBuilder.parse(new File("OSconfig/MConfig.xml"));
              doc.getDocumentElement().normalize();
              NodeList listOfSPRMs = doc.getElementsByTagName("MainConfig");
              Node firstSPRMNode = listOfSPRMs.item(0);
              if (firstSPRMNode.getNodeType() == Node.ELEMENT_NODE) {
                   Element firstSPRAMElement = (Element) firstSPRMNode;
                   // Getting platform
                   NodeList server_port = firstSPRAMElement
                             .getElementsByTagName("RunningPlatform");
                   Element server_port_el = (Element) server_port.item(0);
                   NodeList server_port_List = server_port_el.getChildNodes();
                    v= ((Node) server_port_List.item(0))
                             .getNodeValue().trim();
            }catch (Exception e){
            e.printStackTrace();
                    return v;
    Regards
       

    I didn't quite get what the problem is but if the the desired file is in custom directory why don't you just use absolute path to reference it?
    Like: "/home/my/OSconfig/MConfig.xml"

  • How to rename the SharePoint Document Library existing file name using Web service

    Hi,
    How to rename the SharePoint Document Library existing file name using SharePoint Web service.
    Is it possible. How could i do it?
    Thanks & Regards
    Poomani Sankaran

    Hi,
    Lists.UpdateListItems Method
    would be helpful for your requirement.
    Here is a blog with code demo for your reference:
    http://blogs.msdn.com/b/knowledgecast/archive/2009/05/20/moss-using-the-list-web-service-to-rename-a-file.aspx
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • CAPS - how to provide two input files for a web service

    Hi,
    We have a web service that takes two parameters. Each of those parameters come from a different file. When we provided two files corresponding to two parameters it reads the first input file but not the second. Can you please tell us how to achieve this.
    Thanks
    -Rao

    Hi,
    In eInsight Business Process under Branching Activities you can select the "Flow Activity", using this acitivity you can achieve the solution for your problem.
    Thanks,
    Madan

  • How do u convert any executable file to a web service

    Say i have an executable software...say something like an Optical character resolution software...or something like a dictionary software..which i normally run as an exe file..
    now how do i go about writing up java code, which allows me to convert this capability into a web service??
    Any opinion/guidance is most welcome.

    all right...we can use:
    Runtime r=System.getRuntime();
    Process p=r.exec("c:\\thatfile.exe something"); //to
    load that application...
    InuputStream in=new InputStream(p.getInputStream());
    i tried that with windows media player...replaced
    thatfile.exe withe full path of wmplayer.exe and
    something with an mpg file name...
    but all i could do was play that file..now what if i
    want to change the brightness??
    what i mean is..how do i get to know WHAT TO SEND IN
    A PROCESS'S INPUT/OUTPUT STREAM ???
    lets try a simple example..lets open up the
    notepad...and try to save a file as abc.txt with the
    content as xyz....how do we do it?With much difficulty.
    Which suggests notepad is an excellent example if you really want to do this.
    You might look at java.awt.Robot. Not sure it if will work but you can try.
    I know autoit (which you can search for on the internet) would work. You would write an autoit script and then use autoit to run the script. The script would take arguments, like "abc.txt" and "xyz.txt", and run notepad making notepad do whatever.
    A non-gui app, which notepad obviously isn't, could be controlled by streams (see java.lang.Process)
    For the right windows app using a COM interface might be better. At least in my experience figuring out how to get what you want from COM (one you didn't write) is a nightmare. But possible. A 'service' might actually need this because it might not be possible to pop a gui on some server set ups (not sure about this though.) Doing this either requires that you write JNI or find a third party tool that provides this functionality for you.
    In all of the above you need to figure out the functionality of the exe, and then write a layer that provides the specific functionality that you need to control.
    And of course none of the above has anything to do with web services but rather it is just how to control an executable.

  • Problem compiling java file to access web service! newbie troubles !

    I am new to web services and this is my first program...
    I am compiling java file which has import statement like:
    import org.apache.soap.util.xml.*;
    import org.apache.soap.*;
    import org.apache.soap.rpc.*;
    It says ----- package org.apache.soap.util.xml does not exist as one of errors..
    I have a folder that I named soap myself and I have activation.jar,serces.jar,mail.jar,soap.jar in it.
    I added c:\soap in my classpath and this was supposed to be the quickstart way to try an example out...
    but it gives me compilation errors... what should I do ?

    You'll need to specify each jar file in the classpath. c:\soap\xerces.jar;c:\soap\sax.jar;....

Maybe you are looking for

  • Error when using functions BAPI_ACC_DOCUMENT_POST

    Hello, When I used BAPI_ACC_DOCUMENT_POST function, the message: Document posted successfully appears, but really not documens are created, and the FI number range are modified. See the example code: *& Report  ZPBA_PC                                

  • Vendor closing balances busienss area wise

    Dear Guru's Please suggest me,  i am executed this report S_ALR_87012082 vendor balance with local currency,  i  have given business area in dynemic selection,   here my problem is - if i am given business area or if i am not given business area also

  • ARA: "[P/G]" symbol in Risk Analysis Report???

    Hi, I have noticed a peculiar symbol in Access Risk analysis while performing permission level analysis. The symbol is "[P/G]<TCODE>". I have not this before. Any idea why this is coming and how I can resolve this? Please see the screenshot for the s

  • Resizing Standard 8.5 X11

    How do you resize, reformat a PDF file?  In editing a text, such as enlarging the font, I want to expand the normal format.  Is is possible to format the paper size to say 9X11 or 9.5X11.5?  If so, how? Thanks

  • OWB Install Problem on NT Workstation

    We are trying to install the new OWB on Dell Laptops running NT4 SP6a (256 meg RAM). After the Reports Runtime install, the Enterprise 8i install runs for about 15 mins and then just disappears with no errors. We haven't found any logs with any obvio