Remove charset=utf-8 from HTTP POST
I'm trying to do a HTTP POST via ABAP. The application that I'm posting to does not like the "charset=utf-8" that is in the request. I've been told that I need to remove it. Does anyone know how to do this? I'm not setting this field. SAP is adding this charset automatically.
Here is the request:
POST /hapld/tos/kdwhapltos HTTP/1.1
content-type: multipart/mixed; boundary=BOUNDARY; charset=utf-8
content-length: 2018
host: www.pld-certify.ups.com
user-agent: SAP Web Application Server (1.0;700)
accept-encoding: gzip
sap-trace: 3
--BOUNDARY
Content-type: application/x-www-form-urlencoded
Content-length: 128
AppVersion=1.0&AcceptUPSLicenseAgreement=Yes&ResponseType=application/x-ups-pld&VersionNumber=V4R1&UserId=xxxxxx&Password=xxxxxx
--BOUNDARY
Content-type: application/x-ups-binary
Content-length: 1396
020093 2010071800000006852703500 000000002*AA296007......etc
BOUNDARY
Here is my code:
CALL METHOD cl_http_client=>create
EXPORTING
host = POST_HOST
service = '443'
scheme = '2'
ssl_id = 'ANONYM'
proxy_host = wf_proxy
proxy_service = wf_port
IMPORTING
client = http_client.
http_client->propertytype_logon_popup = http_client->co_disabled.
wf_user = '' .
wf_password = '' .
data: lv_value type string.
CALL METHOD http_client->request->set_header_field
EXPORTING
name = '~request_method'
value = 'POST'.
CALL METHOD http_client->request->set_header_field
EXPORTING
name = '~request_protocol'
value = 'HTTP/1.1'.
CALL METHOD http_client->request->set_header_field( name = '~server_protocol' value = 'HTTP/1.1' ).
CALL METHOD http_client->request->set_header_field
EXPORTING
name = 'HOST'
value = POST_HOST.
CALL METHOD http_client->request->set_header_field
EXPORTING
name = '~request_uri'
value = POST_URI.
CALL METHOD http_client->request->set_content_type
EXPORTING
content_type = 'multipart/mixed; boundary=BOUNDARY'.
CALL METHOD http_client->REQUEST->SET_HEADER_FIELD
EXPORTING
NAME = 'Accept-Charset'
VALUE = 'ISO-8859-1,utf-8;q=0.7,*;q=0.7'.
CALL METHOD http_client->request->SET_FORMFIELD_ENCODING
EXPORTING
FORMFIELD_ENCODING = http_client->request->CO_ENCODING_URL.
CALL METHOD http_client->request->set_cdata
EXPORTING
data = wf_string
offset = 0
length = rlength.
CALL METHOD http_client->send
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2.
CALL METHOD http_client->receive
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3.
CLEAR wf_string1 .
wf_string1 = http_client->response->get_cdata( ).
Hi,
I had a similar problem and could resolve it by using APPEND_DATA instead of APPEND_CDATA. Likewise, SET_DATA instead of SET_CDATA might solve the issue for you. The data has to be provided as binary data then.
Regards,
Stefan
Similar Messages
-
Get file from HTTP POST (upload image)
Hello,
I would like to integrate http://www.plupload.com flash component to my APEX 4.1 website. I need it because I want to resize image and transform image before upload on client side, upload multiple files etc..
But I don't know how to read image binary data from POST method.
When I hit "Start upload" button on plupload component it makes some transformations and creates POST method like this:
------pluploadboundary1334433145869
Content-Disposition: form-data; name="name"
p16qp6jm3nhan1ca46me1ocr3tu1.jpg
------pluploadboundary1334433145869
Content-Disposition: form-data; name="chunks"
1
------pluploadboundary1334433145869
Content-Disposition: form-data; name="chunk" 0
------pluploadboundary1334433145869
Content-Disposition: form-data; name="file"; filename="centerd.jpg"
Content-Type: image/jpeg
ÿØÿà�JFIF������ÿÛ��
image content
now I would like to read content of this HTTP POST and read sended image and store it to DB.
Question is... how can I read file sended with HTTP POST in APEX pl/sql process or pl/sql procedure?
Thank you...
Edited by: cardel on Apr 14, 2012 11:17 PMHi,
here are my two cents ...
this will be a bit difficult. When you use the standard APEX File upload it is not PL/SQL handling the POST request. The request is handled by the webserver - depending on the variant you are using it is either mod_plsql, the C code of the Embedded Gateway or the APEX Listener. The webserver is also doint the insert into APEX' file repository. So I see two options:
It might be possible to configure your plugin (don't know about it) the behave the same as a standard browser upload. Then for APEX there would be no difference - mod_plsql should handle the files accordingly.
If you want to handle the POST request yourself, as said, you can't do this in PL/SQL. It would be possible to write a Java servlet doing this and deploy that servlet on the same container as the APEX Listener (when using Apache with mod_plsql you would need an additional Java server for that) ....
Hope this helps ...
Best regards
-Carsten -
Extract Portal User Name From HTTP POST Request (WSRP SOAP)
How can we extract the user name from the HTTP POST Request (*WSRP SOAP*) from the Portal to the Portlet Provider (Producer)?
We are load balancing between the Portal (10.1.14.2) and the providers (OC4J 10.1.3.3) and would like to extract the user name within the load balancer so we can create session affinity based on it.
BTW, we already tried using TCP Flow but were unable to see the user name.From the documentation, it seems that you need to use
HttpURLConnection.setRequestMethod("POST"); // "GET" is the defaultalthough I have seen examples on the web without it.
Try!
Edit: Also the single quotes around userid and password may be a problem.
Use the previous poster suggestion, but do not include the single quotes.
Edited by: baftos on Aug 6, 2008 4:27 PM -
Retrieve data/files fro HTTP POST request in On-Demand process
Hello,
I would like to integrate https://github.com/blueimp/jQuery-File-Upload to my APEX 4.2 application inside XE11g. I would like to use this kind of jQuery component, multiple file upload, use Drag & Drop, image resize, size limit, filter extensions etc...
This jQuery component and also others javascript uploaders sends data files to some defined URL. Developer need to build some servlet, php script or something on server side that will read files from HTTP request and stores it somewhere.
Do you know how to do it in APEX? How can I read data from HTTP POST request in PL/SQL? Now I can only call my On-Demand application process from javascript, but I am not able to read any data from HTTP POST in it.
Can I do it in APEX, or using MOD_PLSQL?
I would like to implement this:
1) some javascript uploader will call some URL of my application and sends HTTP POST with data files
2) I will read data files from HTTP POST and store them into database
3) I will create some HTTP response for javascript uploader
Thank you for some tipsI know about that existing plugin " Item Plugin - Multiple File Upload"
But I doesn't work in IE and has only basic features. Licence for commercial use is also needed. I would like to use some existing jQuery plugin. There are many of these plugins with nice features. And only one problem is that I need to create some server side process/servlet/script.. that can recieve HTTP request, get files from it and stores them into DB. -
Issue with Remove Namespace HTTP POST method
I am working on an integration where cXML from the Partner will be posted to SOA and from SOA another HTTP post to end partner. its basically
HTTP Post(partner 1)----------------->SOA--------------->HTTP Post(Partner 2).
I have cXML its in dtd format which i have converted to Native format using file-adapter and added namespace schema. so My question is while cXML is post to SOA i have added namespace schema and consumed it to my BPEL, while it leaves out Partner2 through HTTP post again the namespace should be removed and sent to partner 2. I am stuck at this Point. need Urgent help. please. how to remove name space.Hi,
Create xsl style sheet file (xml) from you jdeveloper. Path to go File->New. go to all technogloy tab and select All Items catagory and select XSL style sheet.
Remove content in the generated xml file and copy and paste the below code
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xsl ns1">
<xsl:template match="comment()|processing-instruction()|/">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="*">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="@*|node()"/>
</xsl:element>
</xsl:template>
<xsl:template match="@*">
<xsl:choose>
<xsl:when test="name() != 'xmlns'">
<xsl:attribute name="{local-name()}">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
In Your bpel process under assign activity give it as below
<copy>
ora:getContentAsString( ora:processXSLT( 'xsl/removeNamespaces.xsl', bpws:getVariableData('variable name','rootelement')))
<to variable="String"/>
</copy>
String variable contains your xml message with out namespaces in string format.
You can pass this string content to your partnerlink 2.
Regards,
Tarak. -
I'm trying to use a kind of botched web service implementation that doesn't come with a WSDL file - so, no generated proxy for me to use. It also needs me to send an XML file via an HTTP POST - not in a SOAP envelope. This presents a problem for me - understandably, this isn't part of WebAS 6.40's web services stuff.
Does anyone know of a way of manually posting something via HTTP in ABAP? I'm sure there must be some function module or class that exposes that functionality - I just can't find it! Any ideas anyone?Hi,
You can get some idea from following code for your requirment
DATA: WA_DATA TYPE TSRCLIN,
WA_RESULT TYPE TY_XML,
WA_INV_REP TYPE TY_INV_REP,
T_INV_REP TYPE TABLE OF TY_INV_REP,
WA_ICA_REC_REP TYPE TY_ICA_REC_REP,
T_ICA_REC_REP TYPE TABLE OF TY_ICA_REC_REP,
T_RESULT TYPE T_XML,
SOURCE_ITAB TYPE ABAP_TRANS_SRCBIND_TAB,
SOURCE_WA TYPE ABAP_TRANS_SRCBIND,
WA_ZTICAUSER TYPE ZTICAUSER.
DATA: XSLTP TYPE REF TO CL_XSLT_PROCESSOR,
G_IXML TYPE REF TO IF_IXML,
G_STREAM_FACTORY TYPE REF TO IF_IXML_STREAM_FACTORY,
G_ENCODING TYPE REF TO IF_IXML_ENCODING,
RESSTR TYPE REF TO IF_IXML_OSTREAM,
HTTP_CLIENT TYPE REF TO IF_HTTP_CLIENT .
DATA: SURL TYPE STRING.
DATA: WF_PROXY TYPE STRING ,
WF_PORT TYPE STRING,
WF_USER TYPE STRING,
WF_PASSWORD TYPE STRING,
RLENGTH TYPE I,
R_CODE TYPE SY-SUBRC,
USERID1 TYPE CHAR32.
CONSTANTS: ENCODING TYPE STRING VALUE 'UTF-8',
C_COMMA(1) VALUE ',',
C_AP(2) VALUE 'AP',
C_AR(2) VALUE 'AR',
C_CF(2) VALUE 'CF',
CONV->READ( IMPORTING DATA = XMLSTRING LEN = LEN ).
SPLIT XMLSTRING AT CL_ABAP_CHAR_UTILITIES=>CR_LF INTO TABLE T_DATA.
* Read Header Information
READ TABLE T_DATA INDEX 1 INTO WA_DATA.
SPLIT WA_DATA AT C_COMMA INTO DUMMY SOURCE_SYSTEM_ID DUMMY1.
TRANSLATE DUMMY TO UPPER CASE.
CONDENSE DUMMY.
IF DUMMY <> 'SOURCE SYSTEM ID' OR SOURCE_SYSTEM_ID IS INITIAL.
STRERROR = C_ERROR6.
ELSE.
DELETE T_DATA INDEX 1.
ENDIF.
CHECK STRERROR IS INITIAL.
READ TABLE T_DATA INDEX 1 INTO WA_DATA.
SPLIT WA_DATA AT C_COMMA INTO DUMMY DATE DUMMY1.
TRANSLATE DUMMY TO UPPER CASE.
CONDENSE DUMMY.
IF DUMMY <> 'DATE' OR DATE IS INITIAL.
STRERROR = C_ERROR6.
ELSE.
DELETE T_DATA INDEX 1.
ENDIF.
CHECK STRERROR IS INITIAL.
READ TABLE T_DATA INDEX 1 INTO WA_DATA.
SPLIT WA_DATA AT C_COMMA INTO DUMMY TIME DUMMY1.
TRANSLATE DUMMY TO UPPER CASE.
CONDENSE DUMMY.
IF DUMMY <> 'TIME' OR TIME IS INITIAL.
STRERROR = C_ERROR6.
ELSE.
DELETE T_DATA INDEX 1.
ENDIF.
CHECK STRERROR IS INITIAL.
READ TABLE T_DATA INDEX 1 INTO WA_DATA.
SPLIT WA_DATA AT C_COMMA INTO DUMMY CREATED_BY DUMMY1.
TRANSLATE DUMMY TO UPPER CASE.
CONDENSE DUMMY.
IF DUMMY <> 'CREATED BY' OR CREATED_BY IS INITIAL.
STRERROR = C_ERROR6.
ELSE.
DELETE T_DATA INDEX 1.
ENDIF.
CHECK STRERROR IS INITIAL.
READ TABLE T_DATA INDEX 1 INTO WA_DATA.
SPLIT WA_DATA AT C_COMMA INTO DUMMY TYPE DUMMY1.
TRANSLATE DUMMY TO UPPER CASE.
CONDENSE DUMMY.
IF DUMMY <> 'TYPE' OR TYPE IS INITIAL.
STRERROR = C_ERROR6.
ELSE.
CONDENSE TYPE.
L_TYPE1 = REPGRP.
L_TYPE2 = TYPE.
TRANSLATE L_TYPE1 TO UPPER CASE.
CONDENSE L_TYPE1.
TRANSLATE L_TYPE2 TO UPPER CASE.
CONDENSE L_TYPE2.
IF L_TYPE1 NE L_TYPE2.
IF L_TYPE2 = C_AP.
CONCATENATE C_ERROR1_AP C_ERROR1
INTO STRERROR SEPARATED BY SPACE.
ELSEIF L_TYPE2 = C_AR.
CONCATENATE C_ERROR1_AR C_ERROR1
INTO STRERROR SEPARATED BY SPACE.
ELSEIF L_TYPE2 = C_CF.
CONCATENATE C_ERROR1_CF C_ERROR1
INTO STRERROR SEPARATED BY SPACE.
ENDIF.
ENDIF.
DELETE T_DATA INDEX 1.
ENDIF.
CHECK STRERROR IS INITIAL.
DELETE T_DATA INDEX 1.
LOOP AT T_DATA INTO WA_DATA.
SPLIT WA_DATA AT ',' INTO WA_RESULT-FITF
WA_RESULT-COUNTERPARTYFITF
WA_RESULT-FUCA
WA_RESULT-COUNTERPARTYFUCA
WA_RESULT-RECONCILIATIONACCOUNT
WA_RESULT-INDICATORCUSTOMERVENDOR
WA_RESULT-INVOICENUMBER
WA_RESULT-DOCUMENTDATE
WA_RESULT-POSTINGDATE
WA_RESULT-DUEDATE
WA_RESULT-INVOICEAMOUNT
WA_RESULT-INVOICECURRENCY
WA_RESULT-REPORTINGAMOUNT
WA_RESULT-REPORTINGCURRENCY
WA_RESULT-INDICATOR
WA_RESULT-CREATIONDATE
WA_RESULT-CLEARINGDATE.
* Validation of the Structure.
WA_RESULT-SOURCESYSTEM = SOURCE_SYSTEM_ID.
APPEND WA_RESULT TO T_RESULT.
WA_INV_REP-INVOICEREPORT = WA_RESULT.
WA_ICA_REC_REP-ICARECONCILIATIONREPORT = WA_INV_REP.
WA_ICA_REC_REP-REPGRP = REPGRP.
WA_ICA_REC_REP-NAMESPACE = C_STR.
APPEND WA_ICA_REC_REP TO T_ICA_REC_REP.
ENDLOOP.
TRY.
CREATE OBJECT XSLTP.
CATCH CX_XSLT_EXCEPTION.
ENDTRY.
G_IXML = CL_IXML=>CREATE( ).
G_STREAM_FACTORY = G_IXML->CREATE_STREAM_FACTORY( ).
****Create an Endcoding and Byte Order
G_ENCODING = G_IXML->CREATE_ENCODING( CHARACTER_SET = ENCODING
BYTE_ORDER = 0 ).
*****Create Output Stream
RESSTR =
G_STREAM_FACTORY->CREATE_OSTREAM_XSTRING( CONTENT ).
****Set the Encoding into a stream
RESSTR->SET_ENCODING( ENCODING = G_ENCODING ).
* Prepare for Transformation
SOURCE_WA-NAME = 'BSPXML'.
GET REFERENCE OF T_ICA_REC_REP INTO SOURCE_WA-VALUE.
APPEND SOURCE_WA TO SOURCE_ITAB.
CLEAR XMLSTRING.
CALL TRANSFORMATION Z_BSP_XSLT
SOURCE (SOURCE_ITAB)
RESULT XML XMLSTRING.
IF SY-SUBRC <> 0.
STRERROR = C_ERROR3.
ENDIF.
DATA: X1 TYPE STRING,
X2 TYPE STRING.
* Change encoding from UTF-16 to UTF-8
SPLIT XMLSTRING AT 'utf-16' INTO X1 X2.
CLEAR XMLSTRING.
CONCATENATE X1 'UTF-8' X2 INTO XMLSTRING.
select single * into WA_ZTICAUSER
from ZTICAUSER.
if sy-subrc <> 0.
clear WA_ZTICAUSER.
endif.
SURL = 'http://XXXXXYYYYY:8050/sap/xi/adapter_plain?'.
CONCATENATE SURL
'namespace=' 'http%3A//XXXX.com/corp/sapbw/fi/ica/xi111fn1'
'&interface=' 'IOA_ICA_ReconciliationReport'
'&service=' 'Send_ICA_ReconciliationReport'
'&party=' 'ICA_ManualUpload'
'&agency='
'&scheme='
'&QOS=EO&sap-user=' WA_ZTICAUSER-USERID
'&sap-password=' WA_ZTICAUSER-PTEXT
'&sap-client=' '060'
'&sap-language=EN'
INTO SURL.
* Test of XML file.
* navigation->set_parameter( name = 'xmlstring'
* value = xmlstring ).
* navigation->goto_page( 'XMLTest.xml' ).
* Navigation Code
RLENGTH = STRLEN( XMLSTRING ).
CL_HTTP_CLIENT=>CREATE_BY_URL( EXPORTING URL = SURL
IMPORTING CLIENT = HTTP_CLIENT ).
CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
EXPORTING
NAME = 'Content-Type'
VALUE = 'text/xml; charset=utf-8'.
CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
EXPORTING
NAME = '~request_method'
VALUE = 'POST'.
CALL METHOD HTTP_CLIENT->REQUEST->SET_CDATA
EXPORTING
DATA = XMLSTRING
OFFSET = 0
LENGTH = RLENGTH.
HTTP_CLIENT->SEND( ).
HTTP_CLIENT->RECEIVE( ).
HTTP_CLIENT->RESPONSE->GET_STATUS( IMPORTING CODE = RLENGTH ).
XMLSTRING = HTTP_CLIENT->RESPONSE->GET_CDATA( ).
HTTP_CLIENT->CLOSE( ).
IF RLENGTH = '200'.
STRERROR = C_SUCCESS.
* Update the information into the Table
TRANSLATE SOURCE_SYSTEM_ID TO UPPER CASE.
CONDENSE SOURCE_SYSTEM_ID.
USERID1 = USERID.
TRANSLATE USERID1 TO UPPER CASE.
CONDENSE USERID1.
CALL FUNCTION 'ZFM_BSP_ICA_UPLOAD'
EXPORTING
IV_SOURCE = SOURCE_SYSTEM_ID
IV_USERID = USERID1
IV_TYPE = TYPE
* IV_UPLOAD_DATE = SY-DATUM
* IV_UPLOAD_TIME = SY-UZEIT
IMPORTING
R_CODE = R_CODE.
ELSE.
STRERROR = C_ERROR4.
ENDIF.
ENDIF.
ENDIF.
Message was edited by: Mandar Shete -
Sending UTF-8 data via http post
Hello,
I'm generating an xml to be sent via http post method. Before sending, I'd like to convert it to utf-8, but Oracle converts it to utf-16, no matter what I do.
This is what I send with utl_http.write_text:
convert(l_clob,'AL32UTF8')...but I see utf-16 encoded output on the server side.
NLS_RDBMS_VERSION is 10.2.0.1.0
NLS_CHARACTERSET is EE8ISO8859P2
NLS_NCHAR_CHARACTERSET is AL16UTF16
But I do not use NCHAR variables.
Is http post considered like exporting, where the os's NLS_LANG is important?
Earlier, I managed to save utf-8 xml-files without setting any NLS% params. It was with:
UTL_FILE.PUT_RAW(
file => file_handle,
buffer => UTL_RAW.CONVERT(utl_raw.cast_to_raw(buffer),
'AMERICAN_AMERICA.AL32UTF8',
'AMERICAN_AMERICA.'||charset
);But this does not seem to work here, since I have to send 'text/xml'...
Any help is appreciated.
Thanks,
LaszloNot really the correct forum.. The methods you are using are more a PL/SQL issue than an XML DB issue. In general Oracle will convert the response into the character set requested by the client, are you sure your client is not requesting UTF-16.
Edited by: mdrake on Nov 27, 2010 5:42 PM -
HTTP POST from ECC 6.0 to XI
On ECC 6.0, I have an XMLstring that I need to post to an external URL. I need this to go through XI. It is actually an HTTPS post. How can this be accomplished? Can anyone point me in the right direction as far as how this would work in XI? Here is a smippet of code on ECC
CALL METHOD cl_http_client=>create
EXPORTING
host = POST_HOST
service = '443'
scheme = '2'
ssl_id = 'ANONYM'
proxy_host = wf_proxy
proxy_service = wf_port
IMPORTING
client = http_client.
http_client->propertytype_logon_popup = http_client->co_disabled.
wf_user = '' .
wf_password = '' .
proxy server authentication
CALL METHOD http_client->authenticate
EXPORTING
proxy_authentication = 'X'
username = wf_user
password = wf_password.
CALL METHOD http_client->request->set_header_field
EXPORTING
name = '~request_method'
value = 'POST'.
CALL METHOD http_client->request->set_header_field
EXPORTING
name = '~request_protocol'
value = 'HTTPS/1.0'.
CALL METHOD http_client->request->set_header_field
EXPORTING
name = 'HOST'
value = POST_HOST.
CALL METHOD http_client->request->set_header_field
EXPORTING
name = '~request_uri'
value = L_POST_URI.
CALL METHOD http_client->request->set_header_field
EXPORTING
name = 'Content-Type'
value = 'text/xml; charset=utf-8'.
CALL METHOD http_client->request->set_header_field
EXPORTING
name = 'Content-Length'
value = txlen.Hi Tony,
You need to go through multiple steps.
1) Creation of Scenario in XI ( Integration Repository)
First create datatype which will represent the data that is to be passed to URL. Then message type, message interface, message mapping, Interface mapping.
2) Creation of Directory scenario ( Integration Directory)
Need to create Communication channel using either SOAP adapter or HTTP adapter as you need to pass the data to url.
3) Proxy:
Once you create first step then structure will be available in proxy ( SPROXY transaction) . There you will need to call method for outbound proxy.
For above mentioned steps you can search in SDN which will guide you to multiple helping thread. -
Revision: 7661
Author: [email protected]
Date: 2009-06-08 17:50:12 -0700 (Mon, 08 Jun 2009)
Log Message:
Change from charset=iso-8859-1" to charset=utf-8" and save file with utf-8 encoding.
QA Notes:
Doc Notes:
Bugs: SDK-21636
Reviewers: Corey
Ticket Links:
http://bugs.adobe.com/jira/browse/iso-8859
http://bugs.adobe.com/jira/browse/utf-8
http://bugs.adobe.com/jira/browse/utf-8
http://bugs.adobe.com/jira/browse/SDK-21636
Modified Paths:
flex/sdk/trunk/templates/swfobject/index.template.htmlsame problem here with wl8.1
have you sold it and if yes, how?
thanks -
Invoking http post from BPEL is not passing parameters
Hi,
I have a simple BPEL process where I am trying to send an xml string in a request
parameter to a servlet. Servlet is pretty simple. It just prints the request parameters and returns. But problem is that I am not getting any request
parameters when I am using http post but everything works fine when using
http get.
Enclosed is the wsdl that I am using.
Any information will be of great help
Thanks
Rajesh
<?xml version="1.0" encoding="utf-8"?>
<definitions
targetNamespace="http://xmlns.oracle.com/OISService"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
xmlns:client="http://xmlns.oracle.com/OISService"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<types>
<xsd:schema elementFormDefault="qualified"
targetNamespace="http://xmlns.oracle.com/OISService"
xmlns="http://www.w3.org/2001/XMLSchema">
<xsd:element name="header">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="status" type="xsd:string"/>
<xsd:element name="description" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="responsedata" type="xsd:string"/>
</xsd:schema>
</types>
<message name="SendDataToOISRequestMessage">
<part name="xmldata" element="client:responsedata"/>
</message>
<message name="SendDataToOISResponseMessage">
<part name="payload" element="client:header"/>
</message>
<portType name="SendDataToOIS">
<operation name="process">
<input message="client:SendDataToOISRequestMessage"/>
<output message="client:SendDataToOISResponseMessage"/>
</operation>
</portType>
<binding name="SendDataToOIS" type="client:SendDataToOIS">
<http:binding verb="POST"/>
<operation name="process">
<http:operation location="/Class1"/>
<input>
<mime:mimeXml part="xmldata"/>
<mime:content type="text/xml"/>
</input>
<output>
<mime:mimeXml part="payload"/>
<mime:content type="text/xml"/>
</output>
</operation>
</binding>
<service name="SendDataTOOISService">
<port name="SendDataToOIS" binding="client:SendDataToOIS">
<http:address location="http://localhost:8888/j2ee/servlet"/>
</port>
</service>
<plnk:partnerLinkType name="SendDataToOIS">
<plnk:role name="SendDataToOISProvider">
<plnk:portType name="client:SendDataToOIS"/>
</plnk:role>
</plnk:partnerLinkType>
</definitions>In the bpel you can make a http-binding instead of the default soap-binding.
Maybe this can help you making the call to the servlet/jsp. -
Http post to a url from a WebDynpro (Java) application
Hi,
I want to send http post parameters to a url from a WebDynpro (Java) component. I need to do this to send OCI catalog data back to SAP SRM.
I found this thread:
HTTP Post
which suggests to use the the Suspend plug for this purpose.
<quote>
Sending POST parameters with Web Dynpro Suspend Plugs
1) Define a an additional Suspend Plug parameter (besides 'Url' of type String) with name 'postParams' and of type Map
</quote>
After adding the postParams parameter of type java.util.Map to the Suspend-plug the WebDynpro gives the following error during build:
Outbound plug (of type 'Suspend') 'suspend_plug' may have at most two parameters: 'url' of type 'string' and 'postParams' of type 'Map'.
I use SAP NetWeaver Developer Studio version 7.0.16.
Does someone know a solution? I would highly appreciate it.
Thanks in advance.
EricHi,
Please have a look at this thread,
Pass Table as Input to Adaptive RFC
Regards,
Saravanan K -
Not able to send message - http post from MII 12.1.4.53 to PI 7.1
Hi ,
Question
u2022 Is there any configuration to set up in MII and PI to do posting to PI as a web service? If YES, please guide.
Situation
u2022 We are with MII version 12.1.4.53 and trying to send message through http post to PI 7.1 server.
u2022 We are getting the following error HTTP 500 Internal Error Issue.
u2022 However we are able to post messages from SOAPUI through the same URL and with the MII system which is running on version 12.1.6.91 and 12.1.9.116
u2022 HTTP Response received as below points to PI Configuration issue.
Error
<SOAP:Fault>
<faultcode>SOAP:Server</faultcode>
<faultstring>Server Error</faultstring>
<detail>
<s:SystemError xmlns:s="http://sap.com/xi/WebService/xi2.0">
<context>XIAdapter</context>
<code>ADAPTER.JAVA_EXCEPTION</code>
<text><![CDATA[
com.sap.aii.af.service.cpa.CPAObjectNotFoundException: Couldn't retrieve inbound binding for the given P/S/A values: FP=senderService;TP=;FS=null;TS=;AN=null;ANS=null;
thanks
RajeshHi Anudeep,
The question isNOT ABOUT the format of the URL which MII should use.
Using the same URL we are able to post the message from other MII versions with in the landscape( MII version 12.1.6 and MII version12.1.9) and through SOAP UI.
500 Internal server error Problem arises when the message is sent through the same URL from MII 12,1.4 Build(53) to PI 7.1 ( we tried https Post, XI Webservice, WebService action blocks)
Question:
Are thre any configuration settings specific to MII version12.1.4 Build 53 which needds to be set in MII to communicate to PI 7.1.
Thanks
Rajesh -
HTTP POST from SAP to an external server
Experts.
I have a XML file encased in MIME and SOAP format. Essentially it's a .xml file.
I need to post this to an external server (have the IP address and logon credentials) using http post functionality.
Can this be accomplished in SAP using ABAP, Function module? I need to post the entire file.
If anyone has done this, can you please post the steps needed?
Thank you so much.
RajHi Raj,
a good starting point for you would be the SAP Help. [Here|http://help.sap.com/saphelp_nw04/helpdata/en/1f/93163f9959a808e10000000a114084/frameset.htm] is some sample code of how to make a HTTP call from ABAP.
Cheers
Graham Robbo
Edited by: Graham Robinson on Oct 28, 2009 2:44 PM -
Http post from an application with file attachment
Hi ! I didn't know where else to post this message...
I'm trying to make a HTTP POST from an application and upload a file with it. I have no problems with the posting, just that I haven't got any ideas how to get the file uploaded as well. I've been reading loads of examples regarding the topic, and searching older posts the forum here, without any help.
Here's the method i'm using:
// open connections
URL url = new URL ("TheURL");
URLConnection urlConn = url.openConnection();
// We do input & output, without caching
urlConn.setDoInput (true);
urlConn.setDoOutput (true);
urlConn.setUseCaches (false);
// multipart/form-data because we want to upload a file
urlConn.setRequestProperty ("Content-Type", "multipart/form-data");
// Open output stream
DataOutputStream printout = new DataOutputStream (urlConn.getOutputStream ());
// Set the actual content
String content = "upfile=" + System.getProperty("user.dir") + "\\file.ext&";
content += "other_key-value_pairs";
// write the data to stream, and flush it.
printout.writeBytes (URLEncoder.encode(content));
printout.flush ();
printout.close ();
// Get the response.
DataInputStream input = new DataInputStream (urlConn.getInputStream());
FileOutputStream fos=new FileOutputStream("postto.txt");
String str;
BufferedReader bufr = new BufferedReader(new InputStreamReader(input));
// Write response to outputfile
while (null != ((str = bufr.readLine()))) {
if (str.length() >0) {
fos.write(str.getBytes());
fos.write(new String("\n").getBytes());
input.close ();Now, the response here I get from the url i'm posting to is "Failure, no data-file". I've tried many diff methods of writing the file to the stream, but always get the same result.
I need to file attached like it would be when using a HTML form's <input type="file">.
Please help ! This is getting really urgent !String content = "upfile=" + System.getProperty("user.dir") + "\\file.ext&";
content += "other_key-value_pairs";
printout.writeBytes (URLEncoder.encode(content));
printout.flush ();
printout.close ();Actually, what this does is create a request like:
GET /path/to/file/script.language?upfile=/home/user/file.ext&other=params HTTP/1.1
Content-Type: multipart/form-data
-- And other HTTP params --
The file is not actually appended to the request.
I really don't know how Java handles the file upload, but you could do it by hand, like so:
public static void doFileUpload(String url, String filename, Hashtable params) throws IOException {
// Construct the request
String boundary = "----------------------mUlTiPaRtBoUnDaRy";
String request_head = "POST " + url + " HTTP/1.0\r\n" +
"Content-type: multipart/form-data; boundary=" + boundary + "\r\n";
String request_body = boundary + "\r\n\r\nContent-disposition: form-data; name=\"upload\"" +
"\r\n\r\n";
BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));
int b = -1;
while((b = in.read()) != -1) {
request_body += (char)b;
in.close();
Enumeration keys = params.keys();
while(keys.hasMoreElements()) {
String key = keys.nextElement();
requst_body += "\r\n" + boundary + "\r\n\r\nContent-type: form-data; name=\"key\"\r\n" +
(String)params.get(key);
request_body += "\r\n" + boundary + "--\r\n";
int length = request_head.length() + request_body.length() + "Content-length: \r\n";
String req_length = "Content-length: " + (length + new String("" + length).length()) + "\r\n";
Socket socket = new Socket(url,80);
PrintStream stream = socket.getOutputStream();
stream.print(request_head + req_length + req_body);
// And now an option to read the response, I will omit that...
}Note: I have not tested this code, just wrote it up out of memory. If it does not work, it will propably need some small fixes.
Tuomas Rinta -
HTTP post data from the Oracle database to another web server
Hi ,
I have searched the forum and the net on this. And yes I have followed the links
http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/
http://manib.wordpress.com/2007/12/03/utl_http/
and Eddie Awad's Blog on the same topic. I was successful in calling the servlet but I keep getting errors.
I am using Oracle 10 g and My servlet is part of a ADF BC JSF application.
My requirement is that I have blob table in another DB and our Oracle Forms application based on another DB has to view the documents . Viewing blobs over dblinks is not possible. So Option 1 is to call a procedure passing the doc_blob_id parameter and call the web server passing the parameters.
The errors I am getting is:
First the parameters passed returned null. and
2. Since my servlet directly downloads the document on the response outputStream, gives this error.
'com.evermind.server.http.HttpIOException: An established connection was aborted by the software in your host machine'
Any help please. I am running out of time.
Thanksuser10264958 wrote:
My requirement is that I have blob table in another DB and our Oracle Forms application based on another DB has to view the documents . Viewing blobs over dblinks is not possible. Incorrect. You can use remote LOBs via a database link. However, you cannot use a local LOB variable (called a LOB <i>locator</i>) to reference a remote LOB. A LOB variable/locator is a pointer - that pointer cannot reference a LOB that resides on a remote server. So simply do not use a LOB variable locally as it cannot reference a remote LOB.
Instead provide a remote interface that can deal with that LOB remotely, dereference that pointer on the remote system, and pass the actual contents being pointed at, to the local database.
The following demonstrates the basic approach. How one designs and implements the actual remote interface, need to be decided taking existing requirements into consideration. I simply used a very basic wrapper function.
SQL> --// we create a database link to our own database as it is easier for demonstration purposes
SQL> create database link remote_db connect to scott identified by tiger using
2 '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SID=dev)(SERVER=dedicated)))';
Database link created.
SQL> --// we create a table with a CLOB that we will access via this db link
SQL> create table xml_files( file_id number, xml_file clob );
Table created.
SQL> insert into xml_files values( 1, '<root><text>What do you want, universe?</text></root>' );
1 row created.
SQL> commit;
Commit complete.
SQL> --// a local select against the table works fine
SQL> select x.*, length(xml_file) as "SIZE" from xml_files x;
FILE_ID XML_FILE SIZE
1 <root><text>What do you want, universe?</text></root> 53
SQL> --// a remote select against the table fails as we cannot use remote pointers/locators
SQL> select * from xml_files@remote_db x;
ERROR:
ORA-22992: cannot use LOB locators selected from remote tables
no rows selected
SQL> //-- we create an interface on the remote db to deal with the pointer for us
SQL> create or replace function ReturnXMLFile( fileID number, offset integer, amount integer ) return varchar2 is
2 buffer varchar2(32767);
3 begin
4 select
5 DBMS_LOB.SubStr( x.xml_file, amount, offset )
6 into
7 buffer
8 from xml_files x
9 where x.file_id = fileID;
10
11 return( buffer );
12 end;
13 /
Function created.
SQL> --// we now can access the contents of the remote LOB (only in 4000 char chunks using this example)
SQL> select
2 file_id,
3 ReturnXMLFile@remote_db( x.file_id, 1, 4000 ) as "Chunk_1"
4 from xml_files@remote_db x;
FILE_ID Chunk_1
1 <root><text>What do you want, universe?</text></root>
SQL> --// we can also copy the entire remote LOB across into a local LOB and use the local one
SQL> declare
2 c clob;
3 pos integer;
4 iterations integer;
5 buf varchar2(20); --// small buffer for demonstration purposes only
6 begin
7 DBMS_LOB.CreateTemporary( c, true );
8
9 pos := 1;
10 iterations := 1;
11 loop
12 buf := ReturnXMLFile@remote_db( 1, pos, 20 );
13 exit when buf is null;
14 pos := pos + length(buf);
15 iterations := iterations + 1;
16 DBMS_LOB.WriteAppend( c, length(buf), buf );
17 end loop;
18
19 DBMS_OUTPUT.put_line( 'Copied '||length(c)||' byte(s) from remote LOB' );
20 DBMS_OUTPUT.put_line( 'Read Iterations: '||iterations );
21 DBMS_OUTPUT.put_line( 'LOB contents (1-4000):'|| DBMS_LOB.SubStr(c,4000,1) );
22
23 DBMS_LOB.FreeTemporary( c );
24 end;
25 /
Copied 53 byte(s) from remote LOB
Read Iterations: 4
LOB contents (1-4000):<root><text>What do you want, universe?</text></root>
PL/SQL procedure successfully completed.
SQL> The concern is the size of the LOB. It does not always make sense to access the entire LOB in the database. What if that LOB is a 100GB in size? Irrespective of how you do it, selecting that LOB column from that table will require a 100GB of data to be transferred from the database to your client.
So you need to decide WHY you want the LOB on the client (which will be the local PL/SQL code in case of dealing with a LOB on a remote database)? Do you need the entire LOB? Do you need a specific piece from it? Do you need the database to first parse that LOB into a more structured data struct and then pass specific information from that struct to you? Etc.
The bottom line however is that you can use remote LOBs. Simply that you cannot use a local pointer variable to point and dereference a remote LOB.
Maybe you are looking for
-
Just bought an iPhone 5s, as I turned on the phone it showed 71% of battery, I drained it to 15% and next charged it for 3 and a half hours to fully charge. Did I do any mistake ? Should have I let it to get discharged in order to fully charge it ? S
-
Using Variables in Query generator
I'm using the following query to pull a report together later to be used in a query print layout. When i specify the specific part number and customer code it returns what i expect but as soon as i add a variable it says "Must specify table"! SELECT
-
Scalar subquery or outer join rule of thumb
Hi, is there any particular reason for choosing one over other method ? select t1.col1, (select t.2col2 from t2 where t2.id = t1.id) smth from t1; --over select t1.col1, t2.col2 from t1 where t1.id = t2.id(+) I think those are logicaly equal .Please
-
.mac sync problem: account information issues
I have 3 machines, all running 10.4.11. 2 of them synced (before the .me migration), one, an ibook G4 has never synced In Ical preferences, the synchronize calendar box is grayed and there is the following message: Your .mac account information is no
-
Network question iMac running 8.5.1
I have an iMac that runs system 8.5.1 that I am trying to retire for obvious reasons. Trouble is that there is a series of files on the machine that is vital to my business. The machine has a PowerPC G3 processor running @ 266 MHz, ethernet (which is