German characters problem when calling Web Services via UTL_HTTP

Dear members,

I try to call the services of SAP CRM Web of Oracle PL/SQL. I used following code which works very well.
-- call web service using Oracle UTIL_HTTP packages
DECLARE
  http_req utl_http.req;
     http_resp utl_http.resp;
     lv_request VARCHAR2(32767);
     lc_response CLOB;
     lv_buffer VARCHAR2(32000);
     lv_name          VARCHAR2(256);
     lv_hdr_value     VARCHAR2(1024);     
     l_xml XMLType;          
BEGIN     
     utl_http.set_persistent_conn_support(true);
     utl_http.set_transfer_timeout(600);
     
     http_req:= utl_http.begin_request
                                   ( url => 'http://xyz3ni92.server.xyz.com:8045/sap/bc/srt/xip/sap/crm_bupa_custid_qr/011/customersbycrmid/http_binding'
                                   , method => 'POST'                              
                                   );
     lv_request := '<?xml version="1.0" encoding="UTF-8"?>'
     ||'<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:glob="http://sap.com/xi/CRM/Global2">'
   ||'<soap:Header/>'
   ||'<soap:Body>'
      ||'<glob:CustomerCRMByIDQuery>'
         ||'<MessageHeader>'
            ||'<ID schemeID="?" schemeAgencyID="?" schemeAgencySchemeAgencyID="?"></ID>'
            ||'<UUID></UUID>'
            ||'<ReferenceID schemeID="?" schemeAgencyID="?" schemeAgencySchemeAgencyID="?"></ReferenceID>'
            ||'<ReferenceUUID></ReferenceUUID>'
         ||'</MessageHeader>'
         ||'<BusinessPartnerSelectionByBusinessPartner>'
            ||'<UUID schemeID="?" schemeAgencyID="?"></UUID>'
            ||'<InternalID>2200117598</InternalID>'
         ||'</BusinessPartnerSelectionByBusinessPartner>'
      ||'</glob:CustomerCRMByIDQuery>'
           ||'</soap:Body>'
     ||'</soap:Envelope>';     
     /*set username and password*/
     utl_http.set_authentication (
               r => http_req,
               username => 'WS_USER',
               password => 'WS_PASSWORD',
               scheme => 'Basic',
               for_proxy => false);     
               
     utl_http.set_header(http_req, 'Content-Type', 'application/soap+xml;charset=UTF-8'); 
     utl_http.set_header(http_req, 'Content-Length', LENGTHB(lv_request));
     utl_http.write_text(http_req, lv_request);
     /*Make HTTP call*/
     http_resp:= utl_http.get_response(http_req);
     
     /*read response text from response*/
     BEGIN
               LOOP
                         utl_http.read_text(http_resp, lv_buffer);
                         lc_response := lc_response || TO_CLOB(lv_buffer);
               END LOOP;
     EXCEPTION
               WHEN OTHERS THEN
                    -- ora-29266 end-of-body reached
                    IF SQLCODE <> -29266 THEN
                              RAISE;
                    END IF;
     END;
     utl_http.end_response(http_resp);     
     l_xml := XMLType(lc_response);
     /*Log response for testing*/
     DELETE FROM webservice_log;
     INSERT INTO webservice_log (seq_id,xml_response) VALUES (sqe_Webservice_Log.NEXTVAL,l_xml);
EXCEPTION WHEN OTHERS THEN
          RAISE;
END;
However, if there are any German character in SAP, then they are replaced by UNWANTED data when they come to Oracle.

If I invoke continues the same web service tools like SOAP-UI, then German characters do very well. I've also drawn web service queries and answers of the side SAP, and there response shows fine. When it comes to Oracle, they are themselves corrupt.

I'm sure it's something to do with the character, but I am not able to find where and what should I fix/change.

Thank you for your help in advance.

DB: Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
NLS_DATABASE_PARAMETERS
PARAMETER                      VALUE                                  
------------------------------ ----------------------------------------
NLS_LANGUAGE                   AMERICAN                                 
NLS_TERRITORY                  AMERICA                                  
NLS_CURRENCY                   $                                        
NLS_ISO_CURRENCY               AMERICA                                  
NLS_NUMERIC_CHARACTERS         .,                                       
NLS_CHARACTERSET               AL32UTF8                                 
NLS_CALENDAR                   GREGORIAN                                
NLS_DATE_FORMAT                DD-MON-RR                                
NLS_DATE_LANGUAGE              AMERICAN                                 
NLS_SORT                       BINARY                                   
NLS_TIME_FORMAT                HH.MI.SSXFF AM                           
NLS_TIMESTAMP_FORMAT           DD-MON-RR HH.MI.SSXFF AM                 
NLS_TIME_TZ_FORMAT             HH.MI.SSXFF AM TZR                       
NLS_TIMESTAMP_TZ_FORMAT        DD-MON-RR HH.MI.SSXFF AM TZR             
NLS_DUAL_CURRENCY              $                                        
NLS_COMP                       BINARY                                   
NLS_LENGTH_SEMANTICS           BYTE                                     
NLS_NCHAR_CONV_EXCP            FALSE                                    
NLS_NCHAR_CHARACTERSET         AL16UTF16                                
NLS_RDBMS_VERSION              11.2.0.1.0   
Kind regards
Hari

added other details by: Hari_639 on April 24, 2013 18:45

I'm not really experienced with utl_http, but maybe you'll read on SET_BODY_CHARSET in the documentation.
ISO-8859-1 is the default characterset, until you specify the characters in the attribute content_type and text media.
But your media type is not text, then perhaps affecting the body charset UTF - 8 can help.

concerning

Tags: Database

Similar Questions

  • Error object VO when calling Web Service.

    Hello
    I created a page with 5 field lookup with three buttons and text.

    The features are:

    1. as the page loads I call Web Service to set the values in the fields.
    2. when the user is entering new values or changed the old values and click on the 'save' button, new web service is called for that store values.

    Problem is when changing the value of choice of message. For the choice of the message that I created a VO lookup_code and sense.

    When I click on 'save' button it shows me error
    Attribute set for LookupCode in view object EncryptionModeVO1 failed
     
    Kind regards
    Ajay

    Well, you use certain methods (like setattributevalue, setrendered etc.) in processformrequest that goes against the standards. You must use SPEL approach wherever possible.

    You can hide the exception of developer mode. See thread Re: OAF: masking errors and Exceptions at the top of page OFA for details, but keep in mind that these errors may be valid in some cases.

    Thank you
    Shree

  • BlackBerry, call web services via the SSL protocol

    Hi guys,.

    We are developing an application BlackBerry to OS 4.1 and we test it on the 8330.  This application calls several web services on a remote server via the SSL Protocol (side).  There is a valid certificate from Entrust installed on the remote server - it works properly with all major desktop browsers.  The certificate has not been installed on the BES - is it necessary?  Some BlackBerry devices will be linked to a company BES, others not.

    When the application calls the web service, a window opens with the following message: "you try to open a secure connection, but the server certificate is not approved."  Continue to push works fine, but the window opens again a few moments later.  Pushing view certificate indicates that the certificate is considered invalid ('unverifiable Cert chain').  The same information is given when you navigate to the certificates of the aircraft.  Certificate trust pushing watch a 2nd window asking you the key Store password, which we are not aware of.

    You guys can help us with this?

    Thank you!

    We have solved the problem.  It seems that the BlackBerry device is having a hard time with a certificate signed by the Entrust 2048 bit root certificate.  Give us a new intermediate certificate signed by their 1024-bit root certificate, which we have installed on our Apache server.  While the window 'certificate is not approved' arises at once, pushing "Continue" worked and it never came up again.  To do this, it will probably install the certificate on the BES, something we don't have yet.

    Thank you for taking the time to answer!

  • Call Web Service via a Java Application and analyze the response

    I have currently developed a service web (http://nycews.datajump.com/ATMUtilities.asmx/GetReverseGeoCode?Lat=42.9790550&Lng=-78.7856140) as returnes an address in xml format. I need to know what is the best way to call this connection and parse the XML to display the address to the user in a popupscreen.

    Here is a corrected version...

       public String getAddress() {
            String myString = "My String";
            byte[] postData = myString.getBytes();
            String myAddress = null; // address to return
            HttpConnection httpConnection;
            DataOutputStream os;
            Document doc;
    
            String myURLString = "http://www.google.com;interface=wifi"; // use a connection method here
    
            try {
                httpConnection = (HttpConnection) Connector.open(myURLString);
                httpConnection.setRequestMethod(HttpConnection.POST);
                httpConnection.setRequestProperty(HttpProtocolConstants.HEADER_CONTENT_TYPE, "application / requestJson");
                os = httpConnection.openDataOutputStream();
                os.write(postData);
                int rc = httpConnection.getResponseCode();
    
                if (rc != HttpConnection.HTTP_OK) {
                    return "";
                }
    
                httpConnection.getResponseCode();
    
        // The following code was taken from http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800599/How_To_...
                DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory. newInstance();
                DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
                docBuilder.isValidating();
                doc = docBuilder.parse(httpConnection.openDataInputStream());
                doc.getDocumentElement ().normalize ();
                NodeList list=doc.getElementsByTagName("*");
                String _node = new String("");
                Node tempNode = null;
    
          //this "for" loop is used to parse through the
          //XML document and extract all elements and their
          //value, so they can be displayed on the device
    
              for (int i=0;i		   
  • Time-out period of application that is often when calling web services

    My request of phonegap webworks get transaction timeout error often. I create a cross-domain application that invokes the webservice to different places through soap and rest services. I assign the 60000ms as a transaction timeout period. Same application I use in the iPhone and android, I get no transaction timeout instead, I get correct answer. What happens when I load the app into the unit. Even it is not reproducible.

    It happened due to

    blackberry.system.event.onHardwareKey(blackberry.system.event.KEY_BACK,
        function() {
            page_back();
            return false;
        });
    

    I was controlling the back through the above code while connection, this memory leak cause. I just removed from the function of connection and stored in the document.ready. Now timeout is not the case but I am facing app closes at the launch of the application.

  • Call SOAP Web Service using UTL_HTTP vs APEX_WEB_SERVICE. MAKE_REQUEST

    Dear all,

    When I call the SOAP using APEX_WEB_SERVICE Web services. MAKE_REQUEST, so I'm able to get the response from the web service. Character, however all the German are replaced by those of the JUNK. However the data just fine when I test web services using SOAP UI.

    To resolve this problem, I tried to call the web service using UTL_HTTP. However when I use UTL_HTTP, then I get following error.

    ORA-24247: access denied by network access control list

    Can someone advise me...

    < Li > why German characters are replaced with the data side when calling WebService from APEX, while it works very well in SOAP UI
    < Li > when can I access web service successfully using APEX_WEB_SERVICE, then why he throws error ORA-24247 when I call using UTL_HTTP?


    DB: Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
    APEX: 4.0.2.00.07
    Web server: EPG
    SELECT * FROM NLS_DATABASE_PARAMETERS;
    
    PARAMETER                      VALUE                                  
    ------------------------------ ----------------------------------------
    NLS_LANGUAGE                   AMERICAN                                 
    NLS_TERRITORY                  AMERICA                                  
    NLS_CURRENCY                   $                                        
    NLS_ISO_CURRENCY               AMERICA                                  
    NLS_NUMERIC_CHARACTERS         .,                                       
    NLS_CHARACTERSET               AL32UTF8                                 
    NLS_CALENDAR                   GREGORIAN                                
    NLS_DATE_FORMAT                DD-MON-RR                                
    NLS_DATE_LANGUAGE              AMERICAN                                 
    NLS_SORT                       BINARY                                   
    NLS_TIME_FORMAT                HH.MI.SSXFF AM                           
    NLS_TIMESTAMP_FORMAT           DD-MON-RR HH.MI.SSXFF AM                 
    NLS_TIME_TZ_FORMAT             HH.MI.SSXFF AM TZR                       
    NLS_TIMESTAMP_TZ_FORMAT        DD-MON-RR HH.MI.SSXFF AM TZR             
    NLS_DUAL_CURRENCY              $                                        
    NLS_COMP                       BINARY                                   
    NLS_LENGTH_SEMANTICS           BYTE                                     
    NLS_NCHAR_CONV_EXCP            FALSE                                    
    NLS_NCHAR_CHARACTERSET         AL16UTF16                                
    NLS_RDBMS_VERSION              11.2.0.1.0                               
    
     20 rows selected
    Kind regards
    Hari

    The solution was...

    I just put following line before making the call to the web service by using APEX_WEB_SERVICE. MAKE_REQUEST.

    /*In my case DB character-set is AL32UTF8, so I set it to UTF-8. */
    
    UTL_HTTP.SET_BODY_CHARSET ('UTF-8');
    

    More information see SET_BODY_CHARSET procedures

    If I do not set this, it uses the as ISO-8859-1 character set, which is the cause of my problem.

    Kind regards
    Hari

  • ADF Mobile | call web service from Java. non-reflecting values in the AMX page

    Hi all

    I am using JDEv11124 with ADF Mobile extensions39.62.64.

    My use case is as follows.

    1. my application has 2 Pages a. Login home b.

    2. in the user login Page between user name and click on the "submit" button.

    3. on the homepage I displayed the company they joined.

    4. in the "submit" button is clicked, action defined in the support bean method will be called.

    5. by supporting the action bean method, I'll call the method of the Web Service to validate the entered user name, if the entered user name is valid, that I have to post its company name in the home page.

    6. I am moving back from the web service of datacontrol in Home.amx page

    7. calling web services from Java as follows:

    GenericType = result

    (GenericType) AdfmfJavaUtilities.invokeDataControlMethod ("Comp", null, "getCompany",

    pNames, params,

    PTypes);

    System.out.println ("after the call to the service" + result.getAttributeCount ());

    8. in the Java class, I get the response correctly (as the company designating the username entered as 'SOCIETY'), where when I navigate to the home page, I don't see any results for the method return (name of the company that dropped like OutputText in Home.amx)

    Did I miss something for this. or something more that I need to do to make it work?

    Please suggest.

    Thank you

    Vieira

    Hi all

    I was able to achieve this by executing my method in bean support.

    This code is as follows:

    AdfELContext adfELContext = AdfmfJavaUtilities.getAdfELContext ();

    MethodExpression me =.

    () AdfmfJavaUtilities.getMethodExpression

    "#{bindings.retreiveLocationInformation.execute}".

    (, Object.class, Class [] {}) new;

    me. Invoke (adfELContext, new Object [] {});

    Thanks to Luc Bors WebLog Luc Bors Weblog: ADF Mobile: implementation of "Pull to refresh" model

    Kind regards

    Vieira

  • Calling Web services

    Please give me exactly code snippet for calling Web services.

    Welcome on the support forums.

    You can find some samples using the search tool.
    There is no 'exact snippet", just a few general samples using ksoap2 or heels.

  • Problem with the web service call

    I use ajax with json to call webservice but its not working with the localhost url in the emulator of the ripple. If I use an ip address or external url does not call the webservice.

    I also tried with BlackBerry, webservice does not.

    can someone guide me how to call the Web service?

    Thank you

    Sundaram

    Your file config.xml needs the ip address or the url in the "whitelist".  Use the access for that tag.  for example:

    
    

    The piece above is not secure because it whitelists ALL------* areas.  You can put your url in the uri.

  • Problems with the Web Service using XML in Flex

    Hello

    I use a ColdFusion CFC, which is configured to generate an XML string. It runs on ColdFusion MX 6.1 and is configured as a remote web service. I tested the call and it returns the string XML fine when it is called from another method of Flex unfounded. My problem is this simple Flex application to call the same function via a service web, I wrote below. I cannot get to the exit results, keeps showing as NULL. I can't use the HTTP of Flex appeal for remote access because I'm not under MX7. Does anyone know what is wrong with my code? BTW, I would do the work of cross - domain.xml file to call the cfc, let me know if you want to test and I can add your domain name. Thank you!

    <? XML version = "1.0" encoding = "utf-8"? >
    "" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml ' layout = "absolute" >

    <! - set Web Service to get the XML data of course catalog - >
    < mx:WebService
    ID = "cd".
    "WSDL =" http://training.wonderware.com/components/courses.cfc?wsdl "
    Load = "CD.getCourseCatalogXML.Send ()" "
    showBusyCursor = "true" fault = "Alert.show (event.fault.message), 'Error' ' result =" cdResult (event) ">"
    < mx:operation name = "getCourseCatalogXML" resultFormat = "e4x" >
    < mx:request >
    < IDCalendrier > 3 < / IDCalendrier >
    < / mx:request >
    < / mx:operation >
    < / mx:WebService >

    < mx:Script >
    <! [CDATA]
    Import mx.controls.Alert;
    Import mx.rpc.events.ResultEvent;
    Import mx.rpc.events.FaultEvent;

    [Bindable]
    public var outputString:String

    public void cdResult(event:ResultEvent):void
    {
    outputString = event.result as String
    }
    []] >
    < / mx:Script >

    < mx:Canvas horizontalScrollPolicy = "off" verticalScrollPolicy = "off" >
    < mx:Text width = '100% ' paddingLeft = "4" paddingRight = paddingTop "4" = "4" >
    < mx:text > OUTPUT: {outputString} < / mx:text >
    < / mx:Text >
    < / mx:Canvas >

    < / mx:Application >

    Thank you very much! I do not have the notion that the HTTPService is indded just an HTTP call. So yes that it a much simpler way to call just ColdFusion to return the XML string to the application. No reason to use Flash Remoting or CFCS etc... and certainly not a web server. This made the turn that I called a HTTPService now what charges by coldfusion page that returns XML and bam, works well with e4x result etc... Thanks tracy!

  • Call Web Services leave Jdev 11.1.1.5

    Hi experts,


    I followed this tutorial

    https://blogs.Oracle.com/middleware/entry/calling_web_services_using_adf_11g

    To create a Web Service data control and test a simple call to a find method, which returns records in N. My problem is that no data is returned even when the service is in place and a test using Weblogic test Client.

    I get no error message or exception, just 'No Data to display"in the table that needs to print the results.


    Am I missing a step?


    Best regards

    Jose.

    Hello

    Forget about it. The problem has been generated by an error in the web service definition.

    Best regards

    Jose.

  • Facing problem when calling a JAX WS WSDL

    Hello

    I have a simple JAVA WS, deployed on a server and I want to call from ODI, the JAVA class takes some input as an input parameter and writes data in the DB.

    I did not use any explicit XSD for the design of the WS, WS has of its own inline schema.

    " definitions targetNamespace = ' http://ws.test.com/ "name ="TestWSService"' > < types > < xsd: Schema > < namespace XSD: import =" " http://ws.test.com/ "schemaLocation =" " http://localhost:7001 / Test-context-root/TestPort? xsd = 1 "/ > < / xsd: Schema > < / types > .


    When I use by clicking Connect to WSDL of OdiInvokeWebService the editor of advance tool, it gives an error as ODI-20362: unable to connect to the web Service, in the detailed description, it is showing as

    "This URL points to a valid WSDL"

    I don't get why I get this error, any help is much appreciated.

    Thank you.

    This problem is solved.

    I just changed the IP address of the WSDL for the host name where the server is installed.

    If it does not work with the IP address, change your host name and click Connect to the WSDL button in the Advanced section in the tool OdiInvokeWebService.

    Thank you all for sharing of relevant documents.

  • Calling Web service to orchestration by reader

    Hello

    I have a form where I want to do a search for values that are outputs on a given orchestration.  When I drive extend the form to web service calls, it works fine of Reader 9, but does not work when the player is opened in a browser window.  Is there anything else you need to submit a web request to the browser based player?

    Also - I thought it was possible to make the web service calls of a form without drive to extend too long that your form has been made via the reader in a browser window?

    Thank you

    Jigster

    There is nothing "special" you need to do to make it work from a browser... .it should work. You get errors? Your browser may block the WS call?

    For your second question... You'll always need to drive range for Web Service calls in the player or a browser.

    Paul

  • Registration with Web services via printer - officejet 6700 premium

    I jut bought a premium officejet 6700.  I have set up on my wireless network and it works very well and diagnostic results report comes as "no problem found", but when I go to sign upward for Web services (eprint and apps) it says "can not log on to the server and check the internet connection".

    Can someone help me with this problem?

    Thank you for your contribution to this number - it has now been resolved and I eprint services work after following your instructions.

    I know it took some time, but due to the pressure of work it took time to get round to reading and following your instructions.

    Thank you very much

    Strange Su

  • How to fire a manager class when consuming web service in java - weblogic

    With the help of Axis 1.4 I created client application that consumes the external server services.

    The response of the application server with the soap message that include tags header as well as the body tag.

    My problem with the header tag, I'm trying to find away to get the header element.

    What happened so far:

    I found that I need to use a handler that extends BasicHandler using this class, I can get the header tag. source: dealing with SOAP in the axis headers

    But how this handler to operate during the use of web services? I mean how to call this handler whenever I received the response from the server to get his header .

    Some articles suggest I should use .wsdd file. I use 11.1.1.7 with weblogic 10.3.6 Jdeveloper environment where I don't know web.xml configuration file.

    Question: How to bind this information (Manager class, .wsdd file and web.xml ) to collect and the Manager works for the heading tags?

    The best start was to check the Axis guide on: Apache-Axis reference Guide where you will have an overview of the workflow. (Thanks to Timo)

    To configure the handlers be trigger on the client side you need to do the following:

    1- Create class Manager basically something similar to the following:

    package mypackge; 
     import javax.xml.soap.SOAPException;
     import org.apache.axis.AxisFault;
     import org.apache.axis.MessageContext;
     import org.apache.axis.handlers.BasicHandler;
     import org.apache.axis.message.SOAPHeader;
     import org.apache.axis.message.SOAPHeaderElement; 
    
     public class SoapHeaderConsumerHandler extends BasicHandler
     { 
         public void invoke(MessageContext messageContext) throws AxisFault 
         { // Your logic for request or response handling goes here. 
          // Basically you need to make use of the parameter 
         // messageContext where you can access the soap header and body tags. 
         } 
    }
    

    2- Create the client-config.wsdd file. It will look like the following:

    http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
      
           
               
          
      
     
    
    
    

    You can see that I only use handlers for incoming response side server. So whenever the client application receives a response from the server the class Manager SoapHeaderConsumerHandler is triggered and the method invoke will be called by default.

    Note: if you want to access the outgoing request before sending to the server you need to add an additional label for to add the request handler.

    Check the Reference Deployment (WSDD) of the guide of the axis:

    3- Where to place the client-config.wsdd file?

    You will need to place the .wsdd file in the working directory. You can easily find the location of the working directory using:

    System.out.println("Working Directory = " + System.getProperty("user.dir"));
    

    Source: Get the Current Working Directory in Java

    You just place the .wsdd file here.

    Useful links:

    Where to place the file client - config.wsdd in Railo

    Handler axis V It is an example to managers of the side server.

    Dealing with SOAP headers in the axis

Maybe you are looking for

  • Firefox stop working and I can't even open the profile page to create another profile and start the migration to a new profile, what to do now?

    I can't get firefox to respond - even to open. I tried the suggestion of support for the creation of a new profile, but the instructions are not working anymore so I can't create a new profile and test the system. I don't want to lose my info saved t

  • GPIB with visualfox

    is posible to use visualfox to acquire measurement using gpib I do it with rs232 on an agilent 34401 and it is so easy to control and acquire a degree but I have problems with GPIB

  • Path of the module has changed, now all my not can't find the dll

    I moved the dll of cvi that I wrote and all the steps in my file of sequence now complain that they cannot find the dll. Each has the former location of file.  Is there a way to update all the change them without anyone? Thank you

  • models using d_chip

    Because I need a ROM for a simulation of the WSF, I had to change the data in the internal model to decoder 4 x 16. It works... Now, it was totally empirical work. Where can I find a reference to the "d_chip" syntax, format, etc... Thank you Angilber

  • I want to recover an old document

    I had a Notepad document with things written on this subject. Then I erased everything from him and removed from the document. Is it possible for me to restore my computer to another point, when I still had the document with everything written about