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.

Similar Messages

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

  • How to write a Web service Handler without modifying the Web service code

    Hi,
    How can I write a SOAPHandler without modifying the Web service code. I want to add a generic handler which will take care of SOAPHeader for all the webmethods. To add a handler is it necessary to modify the web service code?

    You will find answer in [implementing_handlers_using_jaxws_2|http://blogs.sun.com/sdimilla/entry/implementing_handlers_using_jaxws_2]

  • Problem acessing KM in Web dynpro for upload a file

    Hello all.
    I have a problem to put a file inside a KM repository. I create a context element like a binary - fileData - and like a String - fileName. and the both code then i will show, I give the same error!!
    please try to help me, in where is my error...
    Code 1:
      public void onActionsavePolitic(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionsavePolitic(ServerEvent)
          IPrivatePoliticCreationView.IFilenodeElement fileelement= wdContext.createFilenodeElement();
          wdContext.nodeFilenode().bind(fileelement);
          IWDAttributeInfo attInfo = wdContext.nodeFilenode().getNodeInfo().getAttribute("fileData");
        ISimpleTypeModifiable type = attInfo.getModifiableSimpleType();
          IWDModifiableBinaryType binaryType =(IWDModifiableBinaryType) wdContext.nodeFilenode().getNodeInfo().getAttribute("fileData").getModifiableSimpleType();
          IWDNodeElement element = wdContext.getParentElement();
          String filename = element.getAttributeAsText("fileName");
          if (filename.trim().equals(""))
                return;
          try {
                /*Get an object of current Portal user */
                IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
                com.sap.security.api.IUser sapUser = wdClientUser.getSAPUser();
                com.sapportals.portal.security.usermanagement.IUser ep5User =
                      WPUMFactory.getUserFactory().getEP5User(sapUser);
                       ResourceContext context = new ResourceContext(ep5User);
                /*Give the path to KM in the variable path */
                 String path="/documents/News/";
                 RID rid = RID.getRID(path);
                 IResourceFactory factory =
                 ResourceFactory.getInstance();
                 ICollection folder = (ICollection) factory.getResource(rid,context);
                 //Using the upload element we can upload the files to a location in the server drive
                /*temperory location for writing */
                 String location =      "d:\";
                 String fileName = location+ fileelement.getFileName();
                 File file = new File(fileName);
                /*Create an output stream for writing to the temperory location*/
                 FileOutputStream out = new FileOutputStream(file);
                 out.write(fileelement.getFileData());
                 out.close();
                /*From the temporary location read the file using an input stream*/
                 FileInputStream fin = new FileInputStream(fileName);
                 fin.read();
                /*Using this input stream we can write to the repository
                 Content content = new Content(fileelement.getFiledata(),fileelement.get) */
                 Content content = new Content(fin,"byte", -1);
                 IResource newResource = folder.createResource(fileelement.getFileName(),null, content);
                 fin.close();
                 file.delete();
          } catch (NotSupportedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
          } catch (AccessDeniedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
          } catch (WDUMException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
          } catch (ResourceException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
          } catch (FileNotFoundException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
          } catch (UserManagementException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
          } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
          } catch (WDRuntimeException e) {
          wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(""+e.getMessage());
          }catch (IllegalArgumentException e) {
                wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(""+e.getMessage());
        //@@end
    Code 2:
      public void onActionsavePolitic(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionsavePolitic(ServerEvent)
          IPrivatePoliticCreationView.IFilenodeElement fileelement= wdContext.createFilenodeElement();
          wdContext.nodeFilenode().bind(fileelement);
          IWDAttributeInfo attInfo = wdContext.nodeFilenode().getNodeInfo().getAttribute("fileData");
          ISimpleTypeModifiable type = attInfo.getModifiableSimpleType();
    IWDModifiableBinaryType binaryType =(IWDModifiableBinaryType) wdContext.nodeFilenode().getNodeInfo().getAttribute("fileData").getModifiableSimpleType();
          IWDNodeElement element = wdContext.getParentElement();
          String filename = element.getAttributeAsText("fileName");
          if (filename.trim().equals(""))
                return;
          try {
                //      Get an object of current Portal user
                IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
                com.sap.security.api.IUser sapUser = wdClientUser.getSAPUser();
                com.sapportals.portal.security.usermanagement.IUser ep5User =
                                 WPUMFactory.getUserFactory().getEP5User(sapUser);
                //       create an ep5 user from the retrieved user
                ResourceContext context = new ResourceContext(ep5User);
                //      Give the path to KM in the variable path
                String repository = "//documents//News//";
                RID rid = RID.getRID(repository);
                IResourceFactory factory = ResourceFactory.getInstance();
                ICollection folder = (ICollection) factory.getResource(rid, context);
                byte[] byteArray =
                      (byte[]) wdContext.currentFilenodeElement().getFileData();
                //      From the temporary location read the file using an input stream
                ByteArrayInputStream fin = new ByteArrayInputStream(byteArray);
                //      Using this input stream we can write to the repository
                Content content =
                      new Content(fin, binaryType.getMimeType().getHtmlMime(), -1L);
                try {
                      IMutablePropertyMap propertyMap = new MutablePropertyMap();
                      IResource newResource =
                            folder.createResource(
                                 wdContext.currentFilenodeElement().getAttributeAsText(
                                 "fileData"),
                                 propertyMap,
                                 content);
                } catch (NameAlreadyExistsException re2) {
                      try {
                            fin = new ByteArrayInputStream(byteArray);
                            content =
                                 new Content(
                                       fin,
                                       binaryType.getMimeType().getHtmlMime(),
                                       -1L);
                            RID fileRid = RID.getRID(repository + filename);
                            IResource fileResource = factory.getResource(fileRid, context);
                            fileResource.updateContent(content);
                      } catch (Exception e) {
                            wdComponentAPI.getMessageManager().reportSuccess(
                                 "File doesn't exist:" + e.getMessage());
                fin.close();
          } catch (Exception e) {
                wdComponentAPI.getMessageManager().reportException(
                      "File not found." + e.getMessage(),
                      true);
          } finally {
                element.setAttributeValue(wdContext.currentFilenodeElement().getFileName(), null);
        //@@end
    and the error then I have in same codes is:
      java.lang.IllegalArgumentException:
        at com.sap.tc.webdynpro.clientserver.data.DataContainer.createLocalPath(DataContainer.java:1347)
        at com.sap.tc.webdynpro.clientserver.data.DataContainer.updateAttribute(DataContainer.java:451)
        at com.sap.tc.webdynpro.clientserver.uielements.adaptbase.AbstractAdapter.updateAttribute(AbstractAdapter.java:644)
        at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.FileUploadAdapter.onFILEUPLOADCHANGE(FileUploadAdapter.java:298)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    com.sap.tc.webdynpro.services.exceptions.WDRuntimeException
            at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.handleUIElementEvent(HtmlClient.java:957)
            at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.updateEventQueue(HtmlClient.java:372)
            at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.prepareTasks(AbstractClient.java:93)
            at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:294)
            at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:707)
            at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:661)
            at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:229)
            at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:152)
            at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
            at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
            at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
            at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
            at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
            at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
            at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
            at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
            at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
            at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
            at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
            at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
            at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
            at java.security.AccessController.doPrivileged(Native Method)
            at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
            at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.handleUIElementEvent(HtmlClient.java:949)
            ... 25 more
    Caused by: java.lang.IllegalArgumentException:
            at com.sap.tc.webdynpro.clientserver.data.DataContainer.createLocalPath(DataContainer.java:1347)
            at com.sap.tc.webdynpro.clientserver.data.DataContainer.updateAttribute(DataContainer.java:451)
            at com.sap.tc.webdynpro.clientserver.uielements.adaptbase.AbstractAdapter.updateAttribute(AbstractAdapter.java:644)
            at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.FileUploadAdapter.onFILEUPLOADCHANGE(FileUploadAdapter.java:298)
            ... 30 more

    Hello
    It looks that I have a similar problem - how could you solve your problem.
    Thanks in advance
    Sascha Fuchs

  • How to create web service for database application

    Hi everyone
    Is it possible to create a web service for an apex database application page which has reports and radio fields and dialog boxes and validations in it. IF it is possible to create, pls help me with example or step by step procedure. I have seen all oracle docs of implementation of Web services in apex but unable to figure out how to get that link of wsdl for an application.
    Thanks in advance.
    Regards
    Sandeep Artham

    Hi,
    I guess there are other ways. But this is an easy way, if you find the right wizards.
    Besides this it is good practise to define interface methods so that session bean implement these interface methods, and thus seperate the interface from the implementation.
    In this approach you will need 3 projects:
    An enterprise application project (will contain EJB Module)
    An EJB Module project (will contain session bean)
    A Java project (contains code that implements the session bean methods)
    In my previous post I suggested to use a J2EE web mudule project. This was a mistake, it should be EJB module.
    But it should be possible to do it in another way. It is up to you.
    Good luck, Roelof

  • How to show stock price through web services for a company?

    to get best performance.. what is the best way to show stock price through web services for a company on an office 365 site?

    Hi,
    you can also do like this.
    Create a page using sharepoint designer. upload it in sharePoint.
    https://support.office.com/en-in/article/Create-SharePoint-site-pages-0ee31678-ee55-40cd-9f48-ea8700035dbd
    Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer
    this is not the proper answer.. question was different.

  • How to write the CMD command for restarting all obi services?

    Hi Experts,
    BIEE:11.1.1.6
    How to write the CMD command for restarting all obi services automatically by windows task scheduler?
    I am try to write the code as below, but it does not work. Please help me to review it and check what I am missing.Thanks.
    Or is there any better method for solving my requirement ? Please share me.Thanks very much.
    cd C:\InstallPath\OBIEE\instances\instance1\bin
    opmnctl stopall
    opmnctl startall
    I am facing the problem that it does not excute the 'opmnctl startall' code, which will be stopped after 'opmnctl stopall',
    So how to modify the command ?Thanks

    See if any of the these are useful or solves your query -
    4.5.2 Using a Windows Service to Start and Stop System Components
    http://docs.oracle.com/cd/E23943_01/bi.1111/e10541/components.htm#BABEEAAI
    4.5.3 Using the Oracle BI Systems Management API to Programmatically Start and Stop Oracle Business Intelligence
    http://docs.oracle.com/cd/E23943_01/bi.1111/e10541/components.htm#BABFGICA
    Edited by: Abhi on May 8, 2013 4:44 AM

  • How to create web service for a Java class in SAP NetWeaver Studio

    hi all,
    i am using SAP Netweaver Developer Studio.have created a normal java project and i want to create web service for one of the classes in this project. i used the  Web Service Creation Wizard to create a web service for this class. but it says there's no methods available for VI. all my methods in this class are public, what should i do?

    Hi,
    I guess there are other ways. But this is an easy way, if you find the right wizards.
    Besides this it is good practise to define interface methods so that session bean implement these interface methods, and thus seperate the interface from the implementation.
    In this approach you will need 3 projects:
    An enterprise application project (will contain EJB Module)
    An EJB Module project (will contain session bean)
    A Java project (contains code that implements the session bean methods)
    In my previous post I suggested to use a J2EE web mudule project. This was a mistake, it should be EJB module.
    But it should be possible to do it in another way. It is up to you.
    Good luck, Roelof

  • How to enable Web services for CP 1525nw

    Hi,
    I am unable to use ePrint for LaserJet CP 1525nw. Printer connected over WiFi. Tried to Enable Web services and saw the message "Connection error Check connection". Firmware is up-to-date. Use the printer in different applications on PC, iPad and iPhone. Everything is working well not ePrint. HP diagnostics did not describe any problems.

    Hello Prophet097,
    Setting manual network information may help the enabling of Web Services for ePrint on your printer.
    To do so:
    On the printer's control panel, press "OK" two times to access the reports menu.
    Press the right arrow to select "Network Summary" and press "OK" to print the report.
    Open an internet browser on a computer within the same network as the printer.
    In the address bar, type the printer's "IPv4 Address" and press "Enter", this should take you to a page about your printer.
    Click on the "Network" tab at the top of the page.
    Click on "IPv4 Configuration" on the left-hand side.
    Click the bubble to the left of "Manual" to allow you to input manual settings.
    Input the same information from the "Network Summary" into the fields for "IP Address", "Subnet Mask", and "Default Gateway".
    Note- None of those fields should be "0.0.0.0"0 or "169.254.xx.xx". If they are, there maybe network issues with the printer.
    In the "Preferred DNS Server" and "Alternate DNS Server", this could vary by the size of your network.
    -Preferred DNS Server- If you are on a small network, input the same value as the "Default Gateway".
    -Alternate DNS Server- If you are on a small network, input either "0.0.0.0" or "8.8.8.8."
    Note- If you are on a domain, you may have specific DNS Server information that needs to be in the fields. 
    Click "Apply" on the page.
    Power the printer off and then on.
    Try to enable Web Services again.
    If I have solved your issue, please feel free to provide kudos and make sure you mark this thread as solution provided!
    Although I work for HP, my posts and replies are my own opinion and not those of HP.

  • How call web service for ip phone??

    i want to call a web service(.NET) by IP Phone. but i don't no how to call a web service. please tell me. i'm just beginner.

    Cisco has a developer's guide that everybody should read: http://www.cisco.com/en/US/products/sw/voicesw/ps556/products_programming_usage_guide_book09186a0080634f5e.html

  • How to call a web Service from Oracle Applications?

    Hi friends,
    I've posted this question on OA Framework forum , but may be it's more appropiated put it here. Sorry for do it again:
    It's about how to call a web service from a Form or a .sql (via Request) in Oracle Applications:
    Could you please explain here the detailed steps (with code example if it's possible) to invoke a webservice from Oracle Applications?.. how did yo do it...?
    I've read differents posts here and the 33097.1 metalink note (by the way, the first recommended link in this note is broken...), but there are lots of theorical concepts and no real examples to see how/from where invoke the WS
    I'll have to call one webservice (I suppose the customer will give me the interface implementation)...but I've never did it with Applications so that's why I ask you for all the detailed steps...
    I work with Forms 6i, Apps 11.5.10.2 and DB 9.2.0.7.
    Thanks a lot.
    Jose.

    Hello Jose,
    I did using java program to call BPEL web services in 11.5.10.
    I pasted below the metalink note for your reference (Note:250964.1)
    The idea is first write a java program to call the webservice (in my case it is calling an BPEL web service, so this may not help directly), test it.
    Then port the java program as specified in the note, so that you could call your web service through concurrent manager scheduler.
    Is this ok?
    Thanks
    Arun.
    ======================================================
    Checked for relevance on 25-Apr-2007
    Application Install - Version: 11.5.8 to 11.5.10
    Goal
    ====
    How to register and create a Java concurrent program for Oracle Applications
    Release 11i
    Solution
    ========
    1. Create your Java Concurrent Program (JCP) , using a text editor.
    /*===========================================================================+
    | Concurrent Processing Sample Code |
    | |
    | FILENAME |
    | Hello.java |
    | |
    | DESCRIPTION |
    | Sample Java concurrent program |
    | About the simplest possible program, just writes a message to the |
    | logfile and output file. |
    | |
    | HISTORY |
    | $Log$ |
    | |
    +===========================================================================*/
    package oracle.apps.fnd.cp.sample;
    import oracle.apps.fnd.cp.request.*;
    public class Hello implements JavaConcurrentProgram {
    public static final String RCS_ID = "$Header$";
    public void runProgram(CpContext ctx) {
    ctx.getLogFile().writeln("-- Hello World! --", 0);
    ctx.getOutFile().writeln("-- Hello World! --");
    ctx.getReqCompletion().setCompletion(ReqCompletion.NORMAL, "");
    =======================================
    End Sample
    =======================================
    2. Create a sample directory under $JAVA_TOP:
    $ mkdir $JAVA_TOPoracle/apps/fnd/cp/sample
    3. Copy Hello.java into $JAVA_TOP/oracle/apps/fnd/cp/sample:
    $ cp $HOME/Hello.java $JAVA_TOP/oracle/apps/fnd/cp/sample
    4. Compile your java program:
    javac $JAVA_TOP/oracle/apps/fnd/cp/sample/Hello.java
    5. Test at the command line with following syntax:
    jre -Ddbcfile=$FND_TOP/secure/your_dbc_file.dbc \
    -Drequest.outfile=./outfile \
    oracle.apps.fnd.cp.request.Run \
    oracle.apps.fnd.cp.sample.Hello
    6. Register your custom java concurrent program with Oracle Applications.
    a. Navigate: Concurrent > Program > Executable
    b. Enter details into the form
    Executable: JCPHELLO
    Shortname: JCPHELLO
    Application: Application Object Library
    Execution Method: Java Concurrent Program
    Execution File Name: Hello (Insert a name that does not contain space or period)
    Execution File Path: oracle.apps.fnd.cp.sample
    c. Save the details
    d. Navigate: Concurrent > Program > Define
    e. Enter details into the form
    Program Name: JCPHELLO
    Program Shortname: JCPHELLO
    Application: Application Object Library
    Executable: Choose JCPHELLO from LOV
    Executable Options :
    f. Save the details
    7. Add this new concurrent request to your responsibility request group.
    a. Navigate > Security > Responsiblity > Request
    b. Query System Administrator
    c. Add new row and choose TestJava
    d. Save the changes.
    8. Run your new Hello Java Concurrent Program
    Navigate: Request > Run
    References
    ~~~~~~~~~~~
    Oracle Applications Developers Manual for Release 11i A75545-01
    ====================================================

  • How to time a web service at back-end?

    I implemented a web service using Axis. This service is to receive an upload file and process it. Since it is a long process, I want to know and log how much time was used for each service call at the server side.
    The web service code is like:
    public class CTSService implements ICTSService, ServiceLifecycle {
    public String processUpload(byte[] zippedData, int zipSourceLength) {
    In the service method processUpload(), it receives byte array zippedData, which can be hundred of MBs. I want to log the time processUpload() receives and processes zippedData. The problem is that, when processUpload() is invoked at the back-end, the server has already received the zippedData, so we can't correctly compute the time of upload of zippedData.
    Does anyone have a good idea of how to time the web service call processUpload() at server side?
    Thanks!

    You can include below method in your code and call it.
    private void UpdateConfig(string key, string value, string fileName)
    var cFile = ConfigurationManager.OpenExeConfiguration(fileName);
    cFile.AppSettings.Settings[key].Value = value;
    cFile.Save();
    Here fileName is the full path + application name (eg: c:\project\WinApp.exe)
    Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer :)

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

  • How to consume a web service provided by third party system from SAP system

    Hi Friends,
    Could any of you provide me a clear picture on how to consume a web service from SAP system and is provided by a third party system?
    Do we get an URL to create a client proxy for consuming the web service?
    Thanx in advance,
    Ram

    Hi Ram,
    of course you cannot supply the WSDL URL. Inside the WSDL (just view it in your browser) you find (usually but not necessary) towards the end something like
    <soap:address location="http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php"/>
    which is the actual adress of the service.
    An example service can be found here:
    <a href="http://www.weather.gov/xml/">National Digital Forecast Database</a>
    containing the WSDL URL at
    <a href="http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl">this address</a>.
    You might also want to browse for the amazon webservices which allow you to embed queries against amazon into your application.
    have fun,
    anton

  • How to access .asmx Web Service using JAVA? Newbie

    Hello Experts,
    Currently, I have a project where in I have to access a ,NET web service. It is made of C#. I just want to ask how will I start the accessing process? I made this simple equation on how my project is.
    Java Project + C#.Net Web Service = Integration
    1. Do i need to create a Web Service too for the Java Project? If yes, What are the necessary tools needed for the creation of this Java Web Service?
    2. The .NET Web Service is available online. (It is made by other people).
    3. Based on the equation, what is the equivalent technology for the + sign?
    4. Can you site a concrete example for accessing a web service?
    5. I'm new here. Totally I have no idea where to start.
    6. Thank you experts.
    Edited by: Benedict.Aluan on 05 30, 08 1:38 PM
    Edited by: Benedict.Aluan on 05 30, 08 1:39 PM

    Hello
    Thanks a lot for your help ...
    I am developing simple J2EE based web service client using IBM WSAD 5.1. I have used the following code to call .asmx web service in Java
    String url = "http://www.w3schools.com/webservices/tempconvert.asmx?wsdl";
         String namespace = "http://tempuri.org/";
         name = request.getParameter("txtName");
         try
              System.out.println("In Internet Service");
              ServiceFactory factory = ServiceFactory.newInstance();
              Service serv = factory.createService(new URL(url),new QName(namespace,"TempConvert"));
              System.out.println("Got Service......");
              Call obj = (Call)serv.createCall();
              System.out.println("Got Call......");
              obj.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY,"");
              obj.setProperty(Call.OPERATION_STYLE_PROPERTY,"wrapped");
              obj.setTargetEndpointAddress(url);
              obj.setPortTypeName(new QName(namespace,"TempConvertSoap"));
              obj.setOperationName(new QName(namespace,"FahrenheitToCelsius"));
              obj.addParameter("param1",XMLType.XSD_STRING,String.class,ParameterMode.IN);
              obj.setReturnType(XMLType.XSD_STRING);
              System.out.println("Parameters Set.....");
              Object[] params = new Object[]{name};
              k = (String)obj.invoke(params);
              System.out.println("Result: "+k);
         catch(Exception e)
            System.out.println("Exception is : "+e);
        }But this code is throwing exception that
    Invalid Address "http://www.w3schools.com/webservices/tempconvert.asmx?wsdl"I have also tried this URL with Java Proxy. But it showing the same error.
    Plz can u tell me how to access .asmx web service ?
    Waiting 4 reply.

Maybe you are looking for

  • Is my Iphone 4 bricked after updating to IOS 5

    Well ive updated my iphone 4 to ios 5 and everything was ok untill a couple of days later. I restarted my phone and was getting the solid apple logo and that was it. After pressing home and on/off buttons it went off. Now i dont get nothing at all, N

  • Problem with special characters: € among others

    Hi everyone, I am trying to update some special characters on my DB. But whenever i try to update i still get the same data, even though the YPDATE Clause says that the data has been correctly updated. For example, whenever I try to update and € sign

  • AV Cable Connection Troubles

    I just received the ibook AV Cable (plugs into headphone port at one end and has red, yellow and white connectors at the other) for Christmas and was very excited to start using it but I am having troubles connecting it. I connected it to my vcr (my

  • FMB to XML Conversion

    Hi, When converting fmb to xml some of the item attributes are missing if the item is subclassed. Is there an option to include all attributes in xml ? thanks, Michael Hitrik

  • Xsl stylesheet

    Dear XML gurus. My xml document has this structure <dl> <dt class="Indented1"> <a name="1125020"> </a>(a) Info1 <dl> <dt class="Indented2"> <a name="1125021"> </a>(1) Info2 <dt class="Indented2"> <a name="1125022"> </a>(2) Info3 </dl> <dt class="Inde