Web service - how to use it ?

Hello expert,
i have to send a file using web wervice (consuming) ( from sap system toward external system ).
Could you provide me a basic exemple to do it ?
tks a lot,
bye.

DATA : imessage       TYPE STANDARD TABLE OF solisti1 WITH HEADER LINE,
           iattach        TYPE STANDARD TABLE OF solisti1 WITH HEADER LINE,
           ipacking_list  LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
           ireceivers     LIKE somlreci1  OCCURS 0 WITH HEADER LINE,
           iattachment    LIKE solisti1   OCCURS 0 WITH HEADER LINE.
    DATA : p_email2       TYPE somlreci1-receiver
                                    VALUE '<email address>'.
    PERFORM build_xls_data .
    PERFORM populate_msg_body.
    PERFORM send_email_with_xls TABLES imessage
                                       iattach
                                 USING p_email2
                                       'subject text
                                       'XLS'
                                       'TestFileName'
                                       'Body Text'
FORM send_email_with_xls TABLES pit_message
                                pit_attach
                          USING p_email2
                                p_mtitle
                                p_format
                                p_filename
                                p_attdescription.
  DATA: xdocdata LIKE sodocchgi1.
      xcnt     TYPE i.
Populate the subject/generic message attributes
  xdocdata-doc_size   = 1.
  xdocdata-obj_langu  = sy-langu.
  xdocdata-obj_name   = 'SAPRPT'.
  xdocdata-obj_descr  = p_mtitle.
  xdocdata-priority   = '1'.
  xdocdata-sensitivty = 'F'.
  iattachment[] = pit_attach[].
  ipacking_list-transf_bin = space.
  ipacking_list-head_start = 1.
  ipacking_list-head_num   = 0.
  ipacking_list-body_start = 1.
  DESCRIBE TABLE imessage LINES ipacking_list-body_num.
  ipacking_list-doc_type   = 'RAW'.
  APPEND ipacking_list.
Create attachment notification
  ipacking_list-transf_bin = 'X'.
  ipacking_list-head_start = 1.
  ipacking_list-head_num   = 1.
  ipacking_list-body_start = 1.
  DESCRIBE TABLE iattachment LINES ipacking_list-body_num.
  ipacking_list-doc_type   =  p_format.
  ipacking_list-obj_descr  =  p_attdescription.
  ipacking_list-obj_name   =  p_filename.
  ipacking_list-doc_size   =  ipacking_list-body_num * 255.
  APPEND ipacking_list.
  ireceivers-receiver   = p_email2.
  ireceivers-rec_type   = 'U'.
  ireceivers-com_type   = 'INT'.
  ireceivers-notif_del  = 'X'.
  ireceivers-notif_ndel = 'X'.
  APPEND ireceivers.
***Send Mail >>>
  CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
    EXPORTING
      document_data              = xdocdata
      put_in_outbox              = 'X'
      commit_work                = 'X'
    TABLES
      packing_list               = ipacking_list
      contents_bin               = iattachment
      contents_txt               = imessage
      receivers                  = ireceivers
    EXCEPTIONS
      too_many_receivers         = 1
      document_not_sent          = 2
      document_type_not_exist    = 3
      operation_no_authorization = 4
      parameter_error            = 5
      x_error                    = 6
      enqueue_error              = 7
      OTHERS                     = 8.
  IF sy-subrc = 0.
    WAIT UP TO 10 SECONDS.
    SUBMIT rsconn01 WITH mode   = 'INT'
                    WITH output = ' '
                    AND RETURN.
  ENDIF.
ENDFORM.                    " send_email_with_xls

Similar Messages

  • PL/SQL web service - how to use XML schema to define inputs/outputs?

    Hello,
    let us say I want to publish a PL/SQL web service. The package spec that I want to expose is:
    CREATE OR REPLACE PACKAGE myWebService AS
      FUNCTION loadResults(
        username   IN VARCHAR2,
        password   IN VARCHAR2,
        resultData IN XMLType)
      RETURN XMLType;
    END;When I use JDeveloper's wizard to publish my PL/SQL web service, the resulting WSDL contains this:
    <schema
        xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:tns="http://uk/co/weatherbys/aapws/AAPWS.wsdl/types/"
        targetNamespace="http://uk/co/weatherbys/aapws/AAPWS.wsdl/types/"
        elementFormDefault="qualified">
        <element name="loadresultsElement">
            <complexType>
                <sequence>
                    <element name="username" type="string" nillable="true"/>
                    <element name="password" type="string" nillable="true"/>
                    <element name="resultdata" nillable="true">
                        <complexType>
                           <sequence>
                                <any/>
                             </sequence>
                        </complexType>
                    </element>
                </sequence>
            </complexType>
        </element>
        <element name="loadresultsResponseElement">
            <complexType>
                <sequence>
                    <element name="result" nillable="true">
                       <complexType>
                            <sequence>
                                <any/>
                            </sequence>
                        </complexType>
                    </element>
                </sequence>
            </complexType>
        </element>
    </schema>It is specifying that anything at all can be passed in and out from the two XMLType arguments, which is fair enough: it has no way of knowing what I am expecting and what I shall return.
    My question is, how do I tell JDeveloper that actually I want either or both of those XMLTypes to conform to a particular XML schema?

    You cannot format the date as a string, unless you do the conversion on the PL-SQL side, before you use it in your WebService mapping. It should be handled as a string.
    The only way to convert the XML from SOAP, using this encoding, into literal XML is to apply XSLT to the payload. Not sure why you would like to do this, as the payload should be consumed by another SOAP-awared stack.
    Hope this helps,
    Eric

  • How to develop web services in OSB using Eclipse OEPE

    Hello,
    We have some live web services developed in SOA ESB using JDeveloper.
    We are now forced to migrate to OSB because of the reason that sometime next year ESB will be de-supported by Oracle.
    I am looking for some good documentation which explains how to create web services in OSB using Eclipse. Please help.
    I am installed Web logic + OEPE + OSB in my local machine already. All I need is to know how to start development.
    Thanks,

    Hi,
    You can start with this:
    http://docs.oracle.com/cd/E17904_01/doc.1111/e15866/tasks.htm
    Cheers,
    Vlad

  • Attn Grant Ronald : Web Services How To : Not valid anymore

    Hi Grant
    The how to integrate web services with Forms uses Jdeveloper 10g to create a stub for the web services which can be called in from Forms 10g. The step by step instructions are based on version 9i. Jdeveloper 10g does not have the same deployment options as 9i version. The instructions have to change.
    Rgds
    Arvind Balaraman

    Web Services are not supported on apex.oracle.com at this time. This is a fairly recent change - just after our upgrade a few weeks back.
    I just added a note to our ShowCase app that demonstrated this a few days ago because our Web Services Showcase pages no longer work (but you can download the packaged version of the application and install it locally to see it work).
    -- Sharon

  • Rich client & web services, how to avoid unnecessary bloat

    Hi!
    Im creating a rich client with java. From this rich client I need to consume web services. Now im wondering which web services framework to use in the client. It seems that almost all (axis, xfire, jax-ws) frameworks require 10+ dependency jars.
    This I dont like of course because the rich client is going to be distrubuted over network and I would like to keep it as slim as possible. 5-10 MB in dependencies is not ok when rest of the program is 100k...
    I guess that everything is going to be different in Mustang (it should include all the needed jars) but i need to support older versions for next x years.
    So if anyone knows any suitable solutions please post here. Thanks.

    The problem here is the SOAP engine running on Oracle9iAS 1.0.2.2 is a lower version than that running on Oracle9iAS 9.0.3/OC4J 9.0.3.
    To get them to interoperate (e.g. 1.0.2.2 calling 9.0.3), you would have to do the following:
    1. Build your Web service in OC4J 9.0.3/JDev 9.0.3
    2. Deploy to 9.0.3 environment
    3. Build a Web service client on the 1.0.2.2 environment, not using any 9.0.3 libraries (see below for a link to a paper to do this)
    Conversely if you wanted to call from a OC4J 9.0.3 Web service client to a Oracle9iAS 1.0.2.2 Web service, you would have to do the following:
    1. Build your Web service on 1.0.2.2 using 1.0.2.2 libraries
    2. Deploy this to a 1.0.2.2 environment
    3. Build a client to the 1.0.2.2 Web service using the 9.0.3 libraries
    The reason it likely is not working is that it looks like you are mixing two different generations of SOAP libraries.
    See the link below for how to build and consume Web services using Oracle9iAS 1.0.2.2:
    http://otn.oracle.com/tech/webservices/htdocs/soapr1/ExploreSOAP1022.html
    At the end of that paper is a link to another paper showing how to use JDeveloper 3.2 to build a Web service for 1.0.2.2 - it shows how to use its libraries versus the libraries that came with 9.0.3.
    Mike.

  • Need some help choosing what web service technology to use

    I'm going to be developing a project which will expose a wen service on a WebLogic 11g server. The web service needs to have security options such as SSL, message encryption and/or access control security.
    What I am struggling to determine is what is the best web service framework to use.
    I'd like to know which one is easiest for WebLogic to handle - is it Axis2 ? How is Metro handled by WebLogic?
    Basically I want to avoid wasting time configuring things or having conflicts between what the web service api needs and what weblogic has by default.

    Tap Settingss > General > Restrictions
    iOS: Understanding Restrictions

  • Java web service -- how to re-generate Java sources when WSDL changes?

    I created a new web service using the "Java Web Service from WSDL" wizard.
    Some time later I changed the WSDL and now I need to rebuild the Java sources. What is the best way to do this? I can't re-run the wizard, it returns an error: "The name of this web service is already used by another web service in this project."
    Using Jdeveloper 11.1.1.3.0 on Linux.
    Thanks.

    These links may helpful for you.
    http://download.oracle.com/docs/cd/E14004_01/books/SSDev/SSDev_CustomizingModel22.html
    http://download.oracle.com/docs/cd/B31017_01/core.1013/b28764/web_services003.htm

  • Invoking a web service not created using oracle web service lib

    Hi All,
    I have a need to invoke my web service from oracle sql command. My web service not created using oracle web service library, but it is created using axis c++ libraries. Is it possible to do so,
    Thanks in advance,
    Regards,
    Monica

    In order to call out from the database process, is SQL (or PL/SQL) you need to generate some client code, that understand the details about the specific of the service you want to invoke and can produce the correct SOAP request. Once this proxy is uploaded in the Database, you can use it.
    There is a set of Database Web services samples that should help you get started. You can also take a look at the developer's guide - see Developing a Web Service Client in the Database.
    Hope it answers your question.
    --eric                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Pros & Cons for consuming web services in ABAP using ABAP PROXY

    Hi,
    Other then performence  is there any other disadvantages like security,etc for consuming web services in ABAP using ABAP proxy?
    I really appreciate if some one provide the more details(Pros & Cons ) regarding cosuming web services and I also want to know is there any other way to consume web services in ABAP.
    Thanks.

    <i> is there any other way to consume web services in ABAP</i>
    you can use cl_http_client class to make your program to act as http client and post the soap message too webservice. This way you dont need to generate proxy, but you should know the soap message format.
    Regards
    Raja

  • How to view web service definition details using Netweaver ?

    Hi,
    I have installed Netweaver 7.01 trial version, and I have seen using the Web Service Browser, that all BAPI's are exposed as web services already. I would like to view the web service details for some of these BAPI's, in order to understand the authentication, authorization details for these as I plan to try and call these through java.
    I basically want to understand whether they are using BASIC authentication by default or configured to use something else.
    Any guidance on this is appreciated.
    thx,
    -Kev.

    Did you try unpublishing it ...
    HOW CAN I DELETE SERVICES IN THE SERVICES REGISTRY?
    The concept of the Services Registry sees the content of the registry as a mirror of the various backend systems from which you publish into the registry. To ensure consistency, you should not manually delete service definitions from the registry, but instead it is recommended to use the publication rules functionality of SAP NetWeaver Administrator (Java) and SOA Manager (ABAP) to u2018unpublish' service definitions that are no longer required.
    However, if you still need to delete service definitions, you can make use of the corresponding API and manually remove service definitions.
    from the following link ...
    /docs/DOC-8782#section172 [original link is broken]
    Regards
    M

  • How to create secure EJB web service in Oc4J using JDeveloper?

    We are going to develop a EJB web service running in OC4J using JDeveloper 10.1.3.3.
    By using the JDeveloper feature, we can simply create the web service by using the "Web Service Endpoint Interface" in the session bean.
    However, unlike the web service created from Java class, I can't find any option to change the security setting of this web service. We tried adding annotation like @DenyAll for testing, but there has no effect and related method can still be called without WS-Security header.
    Now, we can only change the security setting via the web console after deployment (select the web service, then enable security in administration page, and then edit security configuration to change the inbound policies for authentication). It works in our local machine, but it may not work in the production environment as we cannot touch the em console.
    May I know if there has any way to include the security setting inside the project?
    Thanks in advance.

    If I am not wrong, you might be probably talking about this :
    http://docs.oracle.com/cd/B40099_02/books/EAI2/EAI2_WebServices33.html#wp179056
    In order to implement the SOAP header, you would have to :
    (1) Define SOAP header in the wsdl of the service.
    (2) Add a new soap binding in the wsdl, which contains soap header and soap body.
    I think, this should get you going..

  • How to idtentify web services which are used in the web application?

    Hi All,
    We need to identify all the web services that a web application is using. We need them so that we can use test them. We are a group of independent testers. We have access to IIS server's on which the application is hosted. Is there any way we can identify
    them other than seeking out the DEV team to give out the list?
    Thanks in advance.
    Regards,
    Umesh

    Hello,
    You have posted your query in the Project / Project Server forum, is this related to Microsoft's Project / Project Server? If not, you are better off posting this in one of the development forums. If you are unsure where to post, try here first:
    https://social.technet.microsoft.com/Forums/en-US/home?forum=whatforum
    In the mean time, you could look at using something like Fiddler:
    http://www.telerik.com/fiddler
    Paul
    Paul Mather | Twitter |
    http://pwmather.wordpress.com | CPS

  • Calling a web service from BPEL using java web methods

    Hello everyone,
    I have an application my BPEL process should connect to. The application which is a web service needs to be called using pre defined web methods defined in java from my bpel process using Jdev 10g. Any suggestions in how I can go about doing that? Please I really need help

    Hi there,
    If you have defined already your partner links to the service you can use the BPEL API to invoke them from RMI. See this blog entry
    http://technology.amis.nl/2006/06/08/oracle-bpel-pm-invoking-a-remote-bpel-service-from-java-using-rmi/
    It'd be also good if you post the question on the bpel forum BPEL
    Thanks,
    JC

  • Web services with Jdeveloper using weblogic as server

    Hi,
    I try to test creating PL/SQL web services by using a connection hosted by weblogic server instead of OC4J. The problem is what I try to publish a package of the database in the second stage when it asks for the connection to use, in the list I don't found the connection I create to weblogic . It presents as choice only connections used the server OC4J.
    I do not Know if it is possible to publish a package as web service by using weblogic server connection, and how to do it.
    can anyone help me please .
    Nawal

    Web services can only be published to BEA if you install Apache SOAP on BEA and use the Apache SOAP option of JDeveloper. The J2EE Web Services implementation framework is specific to Oracle9iAS.
    The PL/SQL Web Services server implementation is based on the J2EE Web Services option and as a result is not really portable to BEA.
    To publish a PL/SQL Web service on BEA with JDeveloper you would have to write the Java wrapper code to invoke the stored procedure using standard JDBC and then publish that Java class as a Web service using Apache SOAP. Then if you had Apache SOAP installed on BEA you would be set.
    Portability of Web services implementations is a big feature coming with JAX-RPC - currently what most vendors have is interoperability between implementations because of things like SOAPBuilders and WS-I. When JAX-RPC becomes part of J2EE 1.4 roughly in June and vendors start putting out implementations on it you should get closer to portability.
    In the meantime, the easiest way to get portability is to use the same SOAP server on both servers - Apache SOAP is a good example.
    Hope this helps.
    Mike

  • Web Services - How to create a websevice in XI/PI

    Hi,
    I have zero knowledge on webservices. Can someone help me understand what a webservice is and give me a step by step guide on how to create a sender and receiver webservice.
    Thanks in advance.
    Cheers,
    S

    Hi
    Search on SDN, you will get blogs and document.
    WebService is an application on the Web/Internet. Wheneever Service is requested by the user, it provides the service ( Request/Response)
    look some blog Create Web Service
    Using the SOAP inbound channel of the Integration Engine
    Web Service Senario
    RFC -> XI -> WebService - A Complete Walkthrough (Part 1)
    Invoke WebServices in XI
    Invoke Webservices using SAPXI
    WebService Scenario
    SYNCHRONOUS SOAP TO JDBC - END TO END WALKTHROUGH
    https://www.sdn.sap.com/irj/sdn/weblogsblog=/pub/wlg/7729
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d23cbe11-0d01-0010-5287-873a22024f79
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5474f19e-0701-0010-4eaa-97c4f78dbf9b

Maybe you are looking for

  • Graphics card upgrades

    I have a G6-1189SA laptop with Integrated HD intel graphics card. It is not good for running things such as minecraft. Is there an additional slot where i can fit a better graphics card. If there is, would you recommend any particular graphics card -

  • Problem with Smart Update in WLS 9.2

    Hi I have installed AquaLogic Service Bus with Weblogic Server 9.2 and when I try to run Smart Update it tells me there is a patch that I need to download. I click ok and then when smart update tries to restart I get an error: "Could not find the mai

  • Whats the use of tracking tab in UWL?

    Hi, might sound stupid question but could someone help me to understand the use of tracking tab in UWL? What is the use of this tab or what is the purpose of this tab? can this tab be used for deleting task assigned to someone else? Thanks Sid

  • Printing a calendar, help!

    Hi, I never used this feature before but now I'd like to create a calendar and print it at home. I exported it in pdf but I cannot manage to set it in order to fit an A4 sheet. The problem is it prints in one sheet the photo and in the other the cale

  • How turning a photo of 160x120 into a normal photo

    how turning a photo of 160x120 into a normal photo