File attachment via SOAP
Hi,
I have a ZIP file which I need to send it to the 3rd party via SOAP adapter with an attachment. Is this feasible to implement?
Refer the foll links for more help :
Re: send soap envelope with attachements
RFC to soap with attachment
Similar Messages
-
How to send attachment via SOAP
Dear All,
I have to develop a web client in order to send a Text.txt file to web server. I'm using SOAP based message. In fact I'm using eclipse IDE to develop the web client. but I'm not still knowing how it's doing.
WSDL
[code]
<xs:element name="ReconReport">
<!-- Reconciliation report -->
<xs:complexType>
<xs:sequence>
<xs:element name="login"
type="xs:string"/>
<!-- Login name for the client -->
<xs:element name="pass"
type="xs:string"/>
<!-- Password for the client -->
<xs:element name="filename" type="xs:string"/>
<!-- Filename for the attached reconciliation report -->
<xs:element name="desc"
type="xs:string" minOccurs="0"/><!-- Additional description if any -->
<xs:element name="attachment" type="xs:base64Binary"/>
<!-- Attachment -->
</xs:sequence>
</xs:complexType>
</xs:element>
[/code]
My code
[code]
public int reconReport(java.lang.String login, java.lang.String pass, java.lang.String filename, java.lang.String desc, byte[] attachment) throws java.rmi.RemoteException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[2]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("urn:ReconReport");
_call.setEncodingStyle(null);
_call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
_call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("http://paymentGateway.celcom.com", "ReconReport"));
setRequestHeaders(_call);
setAttachments(_call);
try {
java.lang.Object _resp = _call.invoke(new java.lang.Object[] {login, pass, filename, desc, null});
String requestmsg = "Request context[PrepaidAccountQuery] : \n"
+ _call.getMessageContext().getRequestMessage()
.getSOAPPartAsString();
System.out.println(requestmsg);
if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
else {
extractAttachments(_call);
try {
return ((java.lang.Integer) _resp).intValue();
} catch (java.lang.Exception _exception) {
return ((java.lang.Integer) org.apache.axis.utils.JavaUtils.convert(_resp, int.class)).intValue();
} catch (org.apache.axis.AxisFault axisFaultException) {
throw axisFaultException;
[/code]
Form Result
[code]
Request context[PrepaidAccountQuery] :
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ReconReport xmlns="http://paymentGateway.celcom.com"><login>123</login><pass>123</pass><filename>BSN.TXT</filename><desc>Celcom</desc><attachment xsi:nil="true"/></ReconReport></soapenv:Body></soapenv:Envelope>
[/code]
Server accepting message
[code]
ReconReport
POST /axis2/services/PaymentGateway HTTP/1.1
Content-Type: multipart/related; boundary="MIMEBoundary_9aca5e2dc7e6ba2b683923292e7c1df44d8dc670242a205e"; type="application/xop+xml"; start="<[email protected]>"; start-info="application/soap+xml"; action="urn:ReconReport"
User-Agent: Axis2
Host: cel229:18080
Transfer-Encoding: chunked
689
--MIMEBoundary_9aca5e2dc7e6ba2b683923292e7c1df44d8dc670242a205e
Content-Type: application/xop+xml; charset=UTF-8; type="application/soap+xml"
Content-Transfer-Encoding: binary
Content-ID: <[email protected]>
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><ns1:ReconReport xmlns:ns1="http://paymentGateway.celcom.com"><ns1:login>xxxxxxx</ns1:login><ns1:pass>xxxxxxx</ns1:pass><ns1:filename>20120213.txt</ns1:filename><ns1:desc>xxxxxxx Recon Report</ns1:desc><ns1:attachment xmlns:ns2="http://www.w3.org/2005/05/xmlmime" ns2:contentType="text/plain"><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:[email protected]" /></ns1:attachment></ns1:ReconReport></soapenv:Body></soapenv:Envelope>
--MIMEBoundary_9aca5e2dc7e6ba2b683923292e7c1df44d8dc670242a205e
Content-Type: text/plain
Content-Transfer-Encoding: binary
Content-ID: <[email protected]>
1|40637781|44084597|110|20091019141048|121|
2|77371568|44084597|120|20091019141050|126|162727|MBB|
3|66432343|44084597|130|20091019141059|56|4111111111111111|0313|123456|
101|21339684|0192234567|140|0|0|20091019141038|
102|21339685|0192234567|140|0|0|20091019145013|
103|21339686|0192234567|140|0|0|20091019146043|
104|21339687|21339686|2009101914703|
201|40637781|0135605893|1000|20091019151058|102310-ABCDEF|
202|40637781|0135605893|2000|20091019151133|102310-ABCDEF|xxxxxxxxxxxx5442|123654|
900|23482933|40637781|20091019141059|658|
801|21337384|44084597|140|20091019141040|0193456678|Y|
TOT. REC : 10
--MIMEBoundary_9aca5e2dc7e6ba2b683923292e7c1df44d8dc670242a205e--
[/code]
Please help me.
RegardsHi,
I tried my best to find in google but there is no helpful url. However, I'm just following bellow code but still Im getting same message contains. Please appreciate ur advice.
Before calling ,
_call.invoke(-----------)
I just add this
Hashtable chunkedTable = new Hashtable();
chunkedTable.put(HTTPConstants.HEADER_TRANSFER_ENCODING, HTTPConstants.HEADER_TRANSFER_ENCODING_CHUNKED);
_call.setProperty(MessageContext.HTTP_TRANSPORT_VERSION, HTTPConstants.HEADER_PROTOCOL_V11);
_call.setProperty(HTTPConstants.REQUEST_HEADERS,chunkedTable);
byte source[] ="999999999999944444444444444444444444444444444444444".getBytes();
DataSource ds = new ByteArrayDataSource(source, "text/plain");
DataHandler dh = new DataHandler(ds);
_call.setProperty(_call.ATTACHMENT_ENCAPSULATION_FORMAT, _call.ATTACHMENT_ENCAPSULATION_FORMAT_MIME);
_call.addAttachmentPart(dh);
setRequestHeaders(_call);
setAttachments(_call);
_call.invoke(-----------)
But still the message contains is same.
Request context[PrepaidAccountQuery] :
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ReconReport xmlns="http://paymentGateway.celcom.com"><login>123</login><pass>123</pass><filename>BSN.TXT</filename><desc>Celcom</desc><attachment>OTk5OTk5OTk5OTk5OTQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0</attachment></ReconReport></soapenv:Body></soapenv:Envelope>
Regards
-Kapila -
Hi Experts,
My Secnario is
IDOC -- XI --- SOAP.
Actaully i have to convert incoming IDOC into Flat file in XI and send this attachment via SOAP attachment.
Is it possible?
Thanks
SubbuHi
if u want to craete the file for an IDoc then u have to collect the idoc a file and that file u can use as an attachemnt.
to collect idoc in a file u have to do the following settings.
1.Use transaction WE21 and create an file port in the R/3 system. Apply here function module for creating the file name. You can use a standard module to do the same.
2.Using WE20 to create the partner profile and assign the outbound IDOC message type to a partner profile in the outbound parameters.. This partner will be the R/3 server itself since the ile will be uploaded on the R/3 Server . For this message type give the filet created in the above step as the receiver port and select the option collect IDOCs as output mode. Give the basic IDOC type the idoc u r triggering.
3. use transaction BD16 to trigger the IDoc
4.Use the transaction BD87 to process the IDoc, the file port and the number of IDocs which shall be collected
6.Using transaction SXDA_TOOLS download the XML message stored on the R/3 server and upload the same into the XI server.
Thanks
Rinku -
SCSM SDK Relating an Incident to a File Attachment
It seems that I have too many Exchange Connectors so I am looking to find other avenues to meet the needs of my users. I was planning on trying to pitch using Self-Service Portal for internal requests and creating an website for external client requests.
While I was able to create and Incident and a File Attachment via the SDK and C#, the process failed when I tried to create the relationship between them. I've tried to find an answer on the internet but I am coming up short. I followed the examples
correctly but the code fails with a DiscoveryDataLifetimeDependencyException
public static void Test_AttachFileToWorkItem()
EnterpriseManagementGroup mg = new EnterpriseManagementGroup("scsmserver");
EnterpriseManagementObject createdIncident = mg.EntityObjects.GetObject<EnterpriseManagementObject>(new Guid("9AF45443-150E-2AE4-B4F5-CC76930ED3F8"), ObjectQueryOptions.Default);
EnterpriseManagementObject fileAttachment = mg.EntityObjects.GetObject<EnterpriseManagementObject>(new Guid("4FFEBC8B-C1CF-27D5-E01C-CD8E22A06873"), ObjectQueryOptions.Default);
ManagementPackRelationship relAttachment = mg.EntityTypes.GetRelationshipClass(new Guid("aa8c26dc-3a12-5f88-d9c7-753e5a8a55b4"));
CreatableEnterpriseManagementRelationshipObject attachmentRelationship = new CreatableEnterpriseManagementRelationshipObject(mg, relAttachment);
attachmentRelationship.SetSource(createdIncident);
attachmentRelationship.SetTarget(fileAttachment);
attachmentRelationship.Commit(); //Error herei may be reading this wrong, but it looks like you are trying to create a relationship for a file attachment object that already exists. this will never work.
the relationship for file attachments is like the relationship for WorkItemContainsActivity. the lifetime of the child object is linked to the lifetime of the relationship. if the relationship is deleted, the child object is similarly deleted. the corollary
of this is that if you create an object in the database without this relationship, it can never be added to a relationship.
instead of using mg.EntityObjects.GetObject() to get an existing object, Create the object using CreatableEnterpriseManagementObject inline, populate it with data, but do not commit it. create your relationship using the same code you specify here,
using the variable holding your uncommitted file attachment object in the relationship, then commit only the relationship object.
for reference, here is similar powershell i used to do this:
$FileParams = @{
Extension = ".xml"
Description=$FileName
Content = $SourceFile
Size = $SourceFileSize
AddedDate = (get-date).ToUniversalTime()
DisplayName = $FileName
ID=([System.Guid]::NewGuid()).ToString()
#create the attachement, then create the relation, then submit them both in one go.
$FileToAttach = New-SCSMObject -Class $fileClass -PropertyHashtable $FileParams -nocommit
$NewfileRelation = New-SCSMRelationshipObject -Relationship $AttachedFile -Source $Cr -Target $FileToAttach -nocommit
$NewFileRelation.commit() -
Adding attachment via XML calls
I am trying to associate an attachment to a punch list item via XML in C#. Whenever I try to insert an Attachment object, I am getting a generic 'Error' message back. The XML is properly formed and I am populating it with values in the same locations as a file attached via the Contract Management interface. The code to insert the punch list item works fine and it appears in the CM interface. Does anyone have any experience with this scenario? Note: I am uploading the physical file separately.
Here is an example of one that worked here. A couple comments on yours. I did not see a Base_sys_item_type in your code. Which I believe is required for this table. Usually whan I have a question about what data I need to send I'll add a record manually then duplicate what I see in the table. Another thing you should know is that the API will not receive actual files. All it currently does is create links. Files still need to be placed in the correct location. I do that here using some code that copies the files to the correct location when we load in bulk.
We are using CM on some huge projects. I have used the API to integrate and to add/delete/update hundreds of thousands of records. Each module seems to be slightly different, so be wary and always test if/how the API works. Each type can have it's own unique list of required fields etc..
<?xml version="1.0" encoding="UTF-8"?><request xmlns="http://app.expedition.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://app.expedition.com/ http://127.0.0.1/exponline/xml-schemas/request.xsd"><header requestType="DETAIL" sysitemtype="DLNK"><sessionId>000TfQLKK1000630000000BURN</sessionId><action>INSERT</action><getUpdatedDataInResponse>true</getUpdatedDataInResponse></header><DLNK>
<attachment>J:\data\<Attachment Name>.PDF</attachment>
<base_item_type>SNT</base_item_type>
<base_master_key>0002YOCBJ0727800000000BURN</base_master_key>
<base_parent_key></base_parent_key>
<base_sys_item_type>SNT</base_sys_item_type>
<created_by></created_by>
<created_date></created_date>
<created_system></created_system>
<date_linked>2009-02-03T12:00:00.0000000</date_linked>
<file_size>0</file_size>
<is_a_url>0</is_a_url>
<item_type>DLNK</item_type>
<last_edit_by></last_edit_by>
<last_edit_date></last_edit_date>
<last_edit_system></last_edit_system>
<linked_by_user>Joe Manzi</linked_by_user>
<linked_by_user_name>Joe Manzi</linked_by_user_name>
<location></location>
<master_key></master_key>
<project_name>"Your Project name"</project_name>
<sender_login_name></sender_login_name>
<subject>test</subject>
<sys_item_type>DLNK</sys_item_type>
</DLNK></request> -
Hi gurus.
I'm facing following issue:
Customer requires send PO to vendors with files attached via DMS.
Is there any standard solution to do that? or will be necessary develop an ABAP program?
I'll really appreciate your help.
Best Regards.Dear Rahul
Please check the settings for your distribution types based on the following information:
1. 'File processing'
Please verify that you have maintained the correct value '2' in the field 'File processing' for the used distribution types (INT, RML,..). You can check this in customizing under:
Cross-Application Components >> Document Management System >> Document Distribution >> Distribution Type >> Define distribution types
2. Activate Type-Linkage:
If those actions won't help to solve this issue you can also check if the flag 'Linkage Activated' for the entry 'DRAW CHANGED DISTRIBUTION' in transaction SWETYPV to get the workflow running.
Afterwards please re-activate the workflow templates WS20000104 and WS20000137 once again to realise this changes.
With Warm Regrads
Mangesh Pande -
Is there a way to open a zip file received via email on the iPad? I tried and a message popped up saying mail cannot open the attachment.
You need a third party app. Take a look at some of these on this Google page.
Open zip files on iPad -
Error opening PDF file when send as attachment via email
Hi,
I searched around the forum to resolve my issue and there's alot of post that is related but i can't find any answer to my issues.
Here's the scenario :-
I try to convert the smartform to PDF and then send the PDF as an attachment via email.
After converting the smartform to PDF, i managed to download the file and view it without any problem but i can't view the PDF as an attachment. It has the following error :-
Adobe Reader could not open '4500002325.PDF' because it is either not a supported fle type or because the file has been damaged (for example, it was sent as an email and wasn't correctly decoded
The following is the snapshot of my code:-
* Determine smartform function module for invoice
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = lf_formname
IMPORTING
fm_name = lf_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
* error handling
ent_retco = sy-subrc.
PERFORM protocol_update_i.
ENDIF.
ls_control_param-getotf = 'X'.
CALL FUNCTION lf_fm_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ls_control_param
mail_recipient = ls_recipient
mail_sender = ls_sender
output_options = ls_composer_param
zxekko = l_doc-xekko " user_settings = ' '
zxpekko = l_doc-xpekko
IMPORTING
document_output_info = l_ssfcrespd
job_output_info = l_ssfcrescl
job_output_options = l_ssfcresop
TABLES
l_xekpo = l_doc-xekpo[]
l_xekpa = l_doc-xekpa[]
l_xpekpo = l_doc-xpekpo[]
l_xeket = l_doc-xeket[]
l_xtkomv = l_doc-xtkomv[]
l_xekkn = l_doc-xekkn[]
l_xekek = l_doc-xekek[]
l_xkomk = l_xkomk
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc = 0.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
IMPORTING
BIN_FILESIZE = v_len_in
BIN_FILE = v_bin_file
TABLES
OTF = l_ssfcrescl-otfdata
LINES = l_pdf
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
ERR_BAD_OTF = 4
OTHERS = 5.
* email subject
CONCATENATE 'Purchase order' l_doc-xekko-ebeln INTO lw_subject
SEPARATED BY space.
* RECIPIENTS
lwa_recipients-rec_type = 'U'.
lwa_recipients-express = 'X'.
SELECT adr6~smtp_addr
INTO TABLE gv_smtp_addr
FROM ekko AS ekko INNER JOIN
lfa1 AS lfa1 ON ekko~lifnr = lfa1~lifnr INNER JOIN
adr6 AS adr6 ON adr6~addrnumber = lfa1~adrnr
WHERE ekko~ebeln = l_doc-xekko-ebeln.
IF NOT gv_smtp_addr[] IS INITIAL.
LOOP AT gv_smtp_addr INTO gv_smtp_addr_line FROM 2.
lwa_recipients-receiver = gv_smtp_addr_line.
lwa_recipients-copy = ''.
APPEND lwa_recipients TO ptb_recipients.
ENDLOOP.
* Text Data
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'ST'
language = 'E'
name = 'TEST'
object = 'TEXT'
TABLES
lines = lv_lines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
LOOP AT lv_lines INTO lv_lines_line.
ltb_objtxt = lv_lines_line-tdline.
APPEND ltb_objtxt.
ENDLOOP.
DESCRIBE TABLE ltb_objtxt LINES lw_tab_lines.
READ TABLE ltb_objtxt INDEX lw_tab_lines.
* document data contains information for the whole message
lwa_doc_chng-obj_descr = 'ABAPlist'.
* Control Data
lwa_doc_chng-obj_name = 'TESTING'.
lwa_doc_chng-sensitivty = 'F'.
lwa_doc_chng-no_change = 'X'.
lwa_doc_chng-priority = '1'.
lwa_doc_chng-obj_prio = '1'.
lwa_doc_chng-obj_langu = sy-langu.
CLEAR ltb_objpack-transf_bin.
*Attachment
*Move the binary attachment to other internal table.
ltb_objpack-head_start = 1.
ltb_objpack-head_num = 0.
ltb_objpack-body_start = 1.
ltb_objpack-body_num = lw_tab_lines.
ltb_objpack-doc_type = 'RAW'.
APPEND ltb_objpack.
clear : lw_tab_lines.
*Get the number of lines in the Attachment (PDF FILE)
* DESCRIBE TABLE it_mess_att LINES lw_tab_lines.
DESCRIBE TABLE l_objbin lines lw_tab_lines.
ltb_objpack-transf_bin = 'X'.
ltb_objpack-head_start = 1.
ltb_objpack-head_num = 1.
ltb_objpack-body_start = 1.
ltb_objpack-body_num = lw_tab_lines.
ltb_objpack-doc_type = 'PDF'.
ltb_objpack-obj_descr = l_doc-xekko-ebeln.
ltb_objpack-doc_size = lw_tab_lines * 255.
APPEND ltb_objpack.
*Email Subject
lwa_doc_chng-obj_descr = lw_subject.
lwa_recipients-receiver = recipeint.
lwa_recipients-rec_type = 'U'.
lwa_recipients-copy = 'X'.
lwa_recipients-express = 'X'.
APPEND lwa_recipients TO ptb_recipients.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = lwa_doc_chng
COMMIT_WORK = 'X'
TABLES
packing_list = ltb_objpack
contents_bin = l_objbin
contents_txt = ltb_objtxt
receivers = ptb_recipients.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDIF.
Edited by: ~loObie on Apr 23, 2010 12:01 PM
Edited by: ~loObie on Apr 23, 2010 12:02 PMDid you send the pdf in the following format ...
2. Sending PDF as mail.
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = sy-uname.
t_receivers-rec_type = 'B'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = t_receivers
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.
Quote from the Following [LINK|http://www.sap-basis-abap.com/smartforms/convert-the-smart-form-into-pdf-and-send.htm] -
SOAP Axis sender with CSV file attachment
Hi Experts,
I have a requirement where I receive a CSV file attachment from a Web Service post ( i.e a SOAP sender with attachment). I decided to use SOAP with Servlet(Axis) protocol, since standard SOAP sender does not allow modules to be used.
I am able to test this interface through SOAPUI with attachment to the point where I can get the attachment payload as my main payload in IE, but it fails in mapping since CSV needs to be converted to XML. I have following queries for proceeding ahead with this scenario:
1. How do I convert the CSV attachment to XML inorder for mapping to be used in IE. Is there a standard axis handler available for this ???? Also where should this handler be called in the sequence of Axis modules ???
2. Can I use MessageTransformationBean for converting plain to XML ??? If yes where should this module be called in the sequence of Axis modules. I tried using this module between the CallSapAdapter and the first AdapterBean but it returns exception in SOAPUI saying " Messaging exception: No Main"
3. Is there a blog available which illustrates about using additional modules/handlers in Axis. I have had a look at the FAQ note of Axis but it just gives the overview.
Thanks.
Siddhesh S.TawateSolved :).
1 AF_Adapters/axis/HandlerBean Local Enterprise Bean xireq
2 AF_Adapters/axis/AFAdapterBean Local Enterprise Bean afreq
3 localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean Plain2XML
4 CallSapAdapter Local Enterprise Bean sap
5 AF_Adapters/axis/AFAdapterBean Local Enterprise Bean afresp
6 AF_Adapters/axis/HandlerBean Local Enterprise Bean xires
Above sequence worked. I guess I was missing some parameter in content conversion earlier.
Thanks. -
Sending a file (.pdf) as an attachment via e-mail
Hi,
I have a selection screen with purchase order number as "select-options" and 2 radio buttons one for downloading and opening the SAP Script output to the local file and the other raido button would convert the SAP Script output into .pdf file and send that file as an attachment via e-mail to the receipent(only one).
I'm through with the first operation. Now need to know about the e-mailing procedure and the function module(s) to be used and their import, export, etc. parameters.
Thanks & Regards,
RajeshRe: Sending a PDF document as an attachment
refer the above thread.
the useful FMs in this regard are
CONVERT_OTF
SO_NEW_DOCUMENT_ATT_SEND_API1 to send mails with attachments: -
Attach file to XI SOAP message
Hi,
Good day...
Can any body help me how to attach file to XI SOAP message. The file to be attached is in TXT format.
Your help is much appreciated.
Thank you very much...
maaukaauHi-
<i>1) In this scenario, can I access the Ms-Access locally with XI server?</i>
Yes you can access
<i>2) if yes then why I am not able to update the database.</i>
Check if the JDBC adpter is configured properly and also if the cache is updated.
Hope this links helps you.
/people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step -- JDBC receiver adapter (synchronous step by step)
/people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn -- Connect to MS Access database using reciever JDBC
For Configuring jDBC adapter -
http://help.sap.com/saphelp_nw2004s/helpdata/en/22/b4d13b633f7748b4d34f3191529946/frameset.htm -
How to extract data from OMElement object file attachment SOAP Service
We are having Axis2 Tomcat6 Webservice on SOAP WSDL
The Webservice method is like this
public String uploadGpxFile(OMElement omEle) throws AxisFault {
// Extract file attachment from omEle
// store in database
return "ok";
So, I just went through the documentation and executed
omEle.getText();
This printed the attached data like this
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns:uploadGpxFileResponse xmlns:ns="..........">
<ns:return><![CDATA[ MY REQUIRED XML DATA IS HERE ]]></ns:return>
</ns:uploadGpxFileResponse>
</soapenv:Body>
</soapenv:Envelope>
So, I essentially want to extract this data and store in database. My simple question is how to do it!
It sounds crazy but, I am quite new to Java. I was actually debugging client and found there is a problem in server and started fixing it!! It would be very helpful if someone helpsHi,
as far as i know you have to use sql to archive your goal, i.e. write your own methods for every complex sql-statement you want to use. thats the sad thing about the whole ORM-concept.
Greetings,
dsp -
Problem sending xls file in an attachment via ABAP proxy
Hello,
I have in tmp directory a xls file, I tranfer such file to a table, and afterwards I send in an attachment via ABAP proxy, here is the code:
l_attachment TYPE REF TO if_ai_attachment,
lt_attach TYPE prx_attach,
l_name TYPE string,
lx_string TYPE xstring,
l_string TYPE string,
l_type TYPE string,
des TYPE string.
CLASS cl_ai_factory DEFINITION LOAD.
DATA: BEGIN OF itab OCCURS 0,
raw(255) TYPE x,
END OF itab.
DATA: l_controller TYPE REF TO if_ai_posting_controller.
DATA: it TYPE zhcm_mt_segur_out.
CREATE OBJECT prxy.
OPEN DATASET orig FOR INPUT IN binary MODE.
READ DATASET orig INTO itab-raw.
WHILE sy-subrc = 0.
APPEND itab.
READ DATASET orig INTO itab-raw.
ENDWHILE.
CLOSE DATASET orig.
LOOP AT itab.
CONCATENATE lx_string itab-raw INTO lx_string in byte mode.
ENDLOOP.
L_NAME = 'Segur.xls'.
L_TYPE = CL_AI_ATTACHMENT=>IF_AI_ATTACHMENT~C_MIMETYPE_EXCEL.
TRY.
L_ATTACHMENT =
CL_AI_FACTORY=>CREATE_ATTACHMENT_FROM_binary(
P_DATA = LX_STRING
P_TYPE = L_TYPE
P_NAME = L_NAME ).
APPEND L_ATTACHMENT TO LT_ATTACH.
L_CONTROLLER = CL_AI_FACTORY=>CREATE_CONTROLLER( ).
L_CONTROLLER->SET_ATTACHMENTS( LT_ATTACH ).
CALL METHOD PRXY->EXECUTE_ASYNCHRONOUS
EXPORTING
CONTROLLER = L_CONTROLLER
OUTPUT = IT.
COMMIT WORK.
CATCH CX_AI_SYSTEM_FAULT .
DATA FAULT TYPE REF TO CX_AI_SYSTEM_FAULT .
CREATE OBJECT FAULT.
WRITE :/ FAULT->ERRORTEXT.
ENDTRY.
I am using a Mail receiver channel, I receive a mail, with to attachments, one .xml and the other one .bin, I save it to my computer and I change the extension to .xls and when I try to open it, the file is not valid and can be opened after being repaired. What Im doing wrong? I would like to receive a valid xls file, what i should change?
Thanks a lot,
LuisHi,
yes I know, I have used the MessageTransformBean module, and the PayloadSwapBean module. But which parameter I should use for leaving only one attachement in the e-mail. I did this configuration:
1
localejbs/AF_Modules/MessageTransformBean
Local Enterprise Bean
<b>trans</b>
2
localejbs/AF_Modules/PayloadSwapBean
Local Enterprise Bean
<b>swap</b>
3
localejbs/AF_Modules/MessageTransformBean
Local Enterprise Bean
<b>trans1</b>
4
localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
Local Enterprise Bean
mail
<i><b>Module configuration</b></i>
trans
Transform.ContentDisposition
inline
swap
swap.keyName
payload-name
swap
swap.keyValue
Segur
trans1
Transform.ContentDescription
Segur
trans1
Transform.ContentDisposition
attachment;filename="Segur.xls"
trans1
Transform.ContentType
application/vnd.ms-excel;name="Segur.xls"
In the e-mail I get one attachement without name .xml and another one Segur.xsl, and I want only one attachment, the last one. What I should change in my configuration??
Best regards,
Luis -
How do I scan a photo to a file and then send the file as an attachment via email.
How do I scan a photo to a file and then send the file as an attachment via email.
All of this depends largely on what printer /software you have, which Email client you use and to some extent which OS you are running.
Most HP printers have HP Solution Center which is used to set up scanning,choosing where to save,etc. Once a file/photo is scanned and saved to the folder, open the folder.Select the file and at the top of the window should be the option to 'Email'.
******Clicking the Thumbs-Up button is a way to say -Thanks!.******
**Click Accept as Solution on a Reply that solves your issue to help others** -
(SOAP)File Attachment
Hi All,
I am currently working on SOAP Attachments. My requirement is to send a file as an attachment ( SOAP req containing an attachment),BPEL when receicves the Input should process it to a file adapter which will write the file (attached file) to a particular location.
can any one help me out out of this
Thanks
Surya
Edited by: 944642 on Jul 30, 2012 4:51 AMEx:-
Send a SOAP Request having file attached to it ( ex:- a text file) . BPEL or Mediator should be able to process the request (request containing an attachment , in our case a text file)
, route to a file adapter.
-The File Adapter should write the file to some location on the file system.
-For schemas I referred to [http://www.w3.org/TR/2004/WD-xml-media-types-20041102/].
-Sample SOAP request having Image attached to it should look like :-
The following example shows a SOAP 1.1 message with an attached facsimile image of the signed claim form (claim061400a.tiff):
MIME-Version: 1.0
Content-Type: Multipart/Related; boundary=MIME_boundary; type=text/xml;
start="<[email protected]>"
Content-Description: This is the optional message description.
--MIME_boundary+
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <[email protected]>
+<?xml version='1.0' ?>+
+<SOAP-ENV:Envelope+
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
+<SOAP-ENV:Body>+
+..+
+<theSignedForm href="cid:[email protected]"/>+
+..+
+</SOAP-ENV:Body>+
+</SOAP-ENV:Envelope>+
--MIME_boundary+
Content-Type: image/tiff
Content-Transfer-Encoding: binary
Content-ID: <[email protected]>
+...binary TIFF image...+
MIME_boundary+
But My SOAP request having image attached to it looks like
POST http://localhost:7001/soa-infra/services/default/bpel-111-soap-attachments/Mediator1_ep HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: multipart/related; type="application/xop+xml"; start="<[email protected]>"; start-info="text/xml"; boundary="----=_Part_33_1143898358.1343888133522"
SOAPAction: "execute"
MIME-Version: 1.0
Content-Length: 2124
Host: localhost:7001
Proxy-Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
------=_Part_33_1143898358.1343888133522
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: 8bit
Content-ID: <[email protected]>
*<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ct="http://example.com/ct-required">*
*<soapenv:Header/>*
*<soapenv:Body>*
*<ct:MyBinaryData ct:contentType="image/jpeg"><inc:Include href="cid:1236481897083" xmlns:inc="http://www.w3.org/2004/08/xop/include"/></ct:MyBinaryData>*
*</soapenv:Body>*
*</soapenv:Envelope>*
------=_Part_33_1143898358.1343888133522
Content-Type: image/jpeg; name=javaicon32.jpeg
Content-Transfer-Encoding: binary
Content-ID: <javaicon32.jpeg>
Content-Disposition: attachment; name="javaicon32.jpeg"; filename="javaicon32.jpeg"
*<*** Here I am able to see the encoded image*****>*
Kindly guide me in this regard.
Hope the above mentioned Information describes my requirement clearly.
Thanks
Maybe you are looking for
-
Error message in exit at ME21N
Hi frieds, I'm needing some help with this problem. I'm trying to send a error message in EXIT_SAPMM06E_013 with the command line MESSAGE E000(ZM) WITH TEXT-002. The message shows correctly, but after my message sap show another one, "System error (e
-
Hi, i have a JTabbedPane with 8 tabs displaying 8 different panels. on one tab, a calendar view is provided with the option to select date range. each day is represented by a button with a small image.if there is some event on one particular day for
-
BPC 7M SP4 EVDRE missing rows - Error is "1004-Selection is too large.}
Hello, On a customer who installed BPC 7 Ms SP4 I have on client Exception log the error: ===================[System Error Tracing]===================== [System Name] : BPC_ExcelAddin [Job Name] : clsExpand::applyDataRangeFormula [DateTime]
-
Zen Micro - problem synchronising fi
Hi There,I have an Zen Micro. I download podcasts to my computer (windows 2000) en synchronise the downloaded files with Creatieve Mediasource Organizer to my Zen Micro. Some downloaded files it won't synchronise. I think te reason why is that the ti
-
I think my software is crashed. how to reinstall it.
i cant turn on my i pod touch 2G. i think os is crashed. is there a way to reinstall the software. i cant open the ipod using itunes.