Soap Attachment write problem
Hello All,
I'm seeing the error message given below. I'd been trying to write a soap attachment to a file output stream. I did the same thing in WSAD and it worked. But when I tried to work on unix box.. it wasnt supporting activation.jar and mail.jar resulting the error below. I'm urgently in need of help. Please help me. [java] at javax.activation.ObjectDataContentHandler.writeTo(Unknown Source)
[java] at javax.activation.DataHandler.writeTo(Unknown Source)
[java] at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1147) [java] at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:668)
[java] at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:233) [java] at weblogic.webservice.core.soap.SOAPMessageImpl.writeMimeMessage(SOAPMessageImpl.java:589) [java] at weblogic.webservice.core.soap.SOAPMessageImpl.writeTo(SOAPMessageImpl.java:513) [java] at
I think there is a problem with the activation.jar and mail.jar.
Please let me know about this problem if you have any idea since it is very urgent.
I'm using Weblogic server which is on the solaris box and it is not supporting the activation.jar and mail.jar. The same worked on WSAD.
Please advise.
Thanks in advance,
Vamshi
Hi Hasan,
Please, try to implement next xslt mapping before message mapping.
<?xml version="1.0" encoding="UTF-8"?>
<ns0:stylesheet version="1.0" xmlns:ns0="http://www.w3.org/1999/XSL/Transform" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:ns2="https://onlineservice.creditreform.de/webservice/0400-0005">
<ns0:template match="node() | @*">
<ns0:copy>
<ns0:apply-templates select="node() | @*"/>
</ns0:copy>
</ns0:template>
<ns0:template match="xop:Include"/>
</ns0:stylesheet>
Regards, Dzmitry
Similar Messages
-
Soap attachment mapping problem, xop:include
Hello experts,
I am using PI 7.3
I have a senario SOAP to IDOC which SOAP is a sender adapter.
My Web Service receives attachment which includes MTOM, xop:include
I read the attachment in the message mapping by User-Defined function.
But I have another problem while message mapping.
<SAP:Category>Application</SAP:Category>
<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
<SAP:P1>Unexpected value <null> for node /ns0:TrainingAttachment/ns1:binary</SAP:P1>
in attachment part of the web service is following,
<urn1:attachment>
<urn1:binary>
<inc:Include href="cid:87732-65c0-665c" xmlns:inc"http://www.w3.org/2004/08/xop/include" />
</urn1:binary>
</urn1:attachment>
I think my message mapping doesnt resolve the binary part
I tried the Do Not Resolve XOP Includes checkbox, nothing changed
Thanx for your help
Hasan
Edited by: ordu_hasan on Feb 23, 2012 4:12 PMHi Hasan,
Please, try to implement next xslt mapping before message mapping.
<?xml version="1.0" encoding="UTF-8"?>
<ns0:stylesheet version="1.0" xmlns:ns0="http://www.w3.org/1999/XSL/Transform" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:ns2="https://onlineservice.creditreform.de/webservice/0400-0005">
<ns0:template match="node() | @*">
<ns0:copy>
<ns0:apply-templates select="node() | @*"/>
</ns0:copy>
</ns0:template>
<ns0:template match="xop:Include"/>
</ns0:stylesheet>
Regards, Dzmitry -
Unique Problem: Returning SOAP+ Attachment using a class based webservice
Hi everyone,
Im trying to return a Soap+ attachment response back using the following:
attachDoc(byte[] bdoc, String sTransactionNumber,
String sRequestedType)
Where byte[] is the attachment and the 2 string parameters are soap message contents.
The attachment is attached successfully to the message and i can send a response back to the clients console using :
message.writeTo(System.out);
My problem is that i dont know how to return this soapmessage+attachment back to the client.
Ive tried using the return type of the method as :
public SOAPMessage attachDoc(byte[] bdoc, String sTransactionNumber,
String sRequestedType)
but i cant return a SOAPMessage return type in axis.
Does anyone have any clues how i should sort this out so that the client gets the SOAPMessage and attachment when the method is called ?
Please help :S
Thanks,I dunno if this is what you asked for....
Hope this helps a bit
You may want to check this link out
http://www-unix.globus.org/mail_archive/discuss/2007/02/msg00037.html
MessageContext msgContext = MessageContext.getCurrentContext();
File file = new File("filename.txt");
org.apache.axis.attachments.AttachmentPart replyPart=
new org.apache.axis.attachments.AttachmentPart(new DataHandler(new
FileDataSource(file)));
Message rspMsg= msgContext.getResponseMessage();
rspMsg.addAttachmentPart(replyPart);
so ur basically adding the file to the reply message.
The link i gave has a better description, it has the entire process of sending file to server and downloading file from server codes. -
How to download a SOAP attachment using pl/sql
Gurus,
I have a custom pl sql application that is web services based. The custom pl sql application invokes the external web services and updates Oracle Field Service application.
One of the new requirements is to get the signatures from SOAP Attachments (a binary file) and attach it to Field Services transactions in Oracle.
Does anyone has an example of how to download the SOAP attachment file from web service using pl/sql.
The pl sql program uses UTL_HTTP to access web services.
Much Thanx.I think you may be in the wrong forum, but anyways...
What I think your looking for is the htp.print('insert html here'); function. It's plsql, and writes out html to the web server that calls it.
if you search for htp.print you should find loads of examples.
hope this helps.
Merv. -
SOAP Attachment & performances for WLI
Dear all,
I am implementing webservices, accepting a SOAP attachment as parameter. The implementation is based on Workshop / WLI jws file. The web service is RPC style since WorkShop is unable to generate a correct WSDL file with SOAP atttachment & document style (known limitation from BEA).
My problem is concerning attachments. Indeed, in my mind, attaachement are there in order to prevent extra load into the XML parser and to speedup processing and avoid heavy use of memory.
So I made some tests with a simple soap request and attachments. Here are the results (I calculate the time to send and receive response from web service), the web service itself just prints the content type, anything else.
Attachement size | Time
39 kb 344ms
78 kb 406ms
155 kb 484ms
300 kb 750ms
463 kb 1000ms
1389 kb 4600ms
2700 kb 23609ms
5500 kb 140000ms
Of course, the client and server are running on the same machine and are using the loopback interface. So there is no network bootleneck to take into account.
As conclusion, we can see that for small messages, (<300kb) the curve is good... But performances start to fall drastically with messages larger than 300kb. This is not a problem of memory but CPU usage (fully used diring the 1400 seconds).
Any idea, any opened cases ?
Thansk for all,
Pascal BourgeoisThis post :
http://soastuff.wordpress.com/2007/06/06/handling-opaque-datatypes-in-bpelesb/
Describes how to use the opaque-schema for sending files over the ESB.
Hope you can use this.
or do you want to use the soap-headers for this? -
Return zip file as soap attachment from server..
Dear Friends,
Requirement:
I would like to download a zip file from server(tomcat) with soap attachment using wsdl.
I have tried googling but didn't get exact information and samples on this.
Please help me on this and it would be helpful if u can provide me one sample on this.
Thanks in advance.
Cheers
Cappls http://www.catb.org/~esr/faqs/smart-questions.html#writewell
How To Ask Questions The Smart Way
Eric Steven Raymond
Rick Moen
Write in clear, grammatical, correctly-spelled language
We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding (often enough to bet on, anyway). Answering questions for careless and sloppy thinkers is not rewarding; we'd rather spend our time elsewhere.
So expressing your question clearly and well is important. If you can't be bothered to do that, we can't be bothered to pay attention. Spend the extra effort to polish your language. It doesn't have to be stiff or formal - in fact, hacker culture values informal, slangy and humorous language used with precision. But it has to be precise; there has to be some indication that you're thinking and paying attention.
Spell, punctuate, and capitalize correctly. Don't confuse "its" with "it's", "loose" with "lose", or "discrete" with "discreet". Don't TYPE IN ALL CAPS; this is read as shouting and considered rude. (All-smalls is only slightly less annoying, as it's difficult to read. Alan Cox can get away with it, but you can't.)
More generally, if you write like a semi-literate b o o b you will very likely be ignored. So don't use instant-messaging shortcuts. Spelling "you" as "u" makes you look like a semi-literate b o o b to save two entire keystrokes. -
OSB - send file in email attachment in SOAP attachment
Hi!
I would like to send a file in email in SOAP attachment.
I thought it would be a simple task, I will create a proxy service, which calls a business service. There is a routing action in proxy service to business service and after the rouiting there is a replace action, I replace the attachments variable with this:
<con:attachment xmlns:con="http://www.bea.com/wli/sb/context">
<con:Content-Type>application/pdf</con:Content-Type>
<con:Content-Transfer-Encoding>base64</con:Content-Transfer-Encoding>
<con:Content-Disposition>attachment; filename="Simple.pdf"</con:Content-Disposition>
<con:body>{$attachments/ctx:attachment/ctx:body}</con:body>
</con:attachment>
I received the email, but i cannot open the document, because it is corrupted...
Please, could someone help me?
I can't find out the solution.
Thanks!
ViktorHi Anuj!
Thanks for your answer again! :)
I tried the blog and I could send email with attachment. My problem is that I have to put the file content into the webservice body when i call the proxy service as a webservice. But I want to put the file into the SOAP attachment. So this is my scenario:
1. the service counsumer calls the proxy service webservice and the service consumer (client) put the file into the request SOAP attachment
2. the proxy service calls the business service
3. the business service sends the email with an attachment (and the file is into this attachment)
Could You help me?
Thanks! -
"Content is not allowed in prolog" with SOAP Attachment
I'm writing an application using SAAJ that sends a soap message to a servlet which responds with some information, including HTML which the client application will display. The HTML has to go into a SOAP attachment so the tags won't get confused with XML.
I had the whole thing working with plain text sending within a normal node, and I only switched a few lines to make that text an attachment with HTML instead, but now I'm getting the exception "Content is not allowed in prolog" on the Client side when it tries to create the envelope from the SOAPMessage.
Code for building answering SOAPMessage with attachment (Servlet to Client)
public static SOAPMessage buildXML(Message newMessage){
SOAPMessage msg = null;
try {
MessageFactory msgFactory = MessageFactory.newInstance();
msg = msgFactory.createMessage();
// Create an envelope in the message
SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope();
msg.setProperty(SOAPMessage.WRITE_XML_DECLARATION, "true");
msg.setProperty(SOAPMessage.CHARACTER_SET_ENCODING, "UTF-8");
//Get hold of the the body
SOAPBody body = envelope.getBody();
SOAPElement soap_message = body.addChildElement("MESSAGE");
if (newMessage.message_type != null){
SOAPElement soap_message_type = soap_message.addChildElement("MESSAGETYPE");
soap_message_type.addTextNode(newMessage.message_type);
if (newMessage.questionID != 0){
SOAPElement soap_questionID = soap_message.addChildElement("QUESTIONID");
soap_questionID.addTextNode("" + newMessage.questionID);
if (newMessage.username != null){
SOAPElement soap_username = soap_message.addChildElement("USERNAME");
soap_username.addTextNode(newMessage.username);
if (newMessage.password != null){
SOAPElement soap_password = soap_message.addChildElement("PASSWORD");
soap_password.addTextNode(newMessage.password);
if (newMessage.message_text != null){
AttachmentPart soap_message_text = msg.createAttachmentPart("<html><body>" + newMessage.message_text + "</body></html>", "text/html");
soap_message_text.setContentId("MESSAGETEXT");
msg.addAttachmentPart(soap_message_text);
//SOAPElement soap_message_text = soap_message.addChildElement("MESSAGETEXT");
//soap_message_text.addTextNode(newMessage.message_text);
if (newMessage.sampleString != null){
SOAPElement soap_password = soap_message.addChildElement("SAMPLESTRING");
soap_password.addTextNode(newMessage.sampleString);
SOAPElement tmpEl;
for (int i=0; i<newMessage.numArrayUsed; i++){
tmpEl = soap_message.addChildElement("SAMPLEINT");
tmpEl.addTextNode("" + newMessage.sampleInt);
msg.saveChanges();
} catch (Exception e) {
e.printStackTrace();
return msg;
You can see in the area where it adds MESSAGETEXT there are two clients commented out which work. The three lines above it are what changed to make it an attachment instead.
Code in Client for recieving reply from Servlet
SOAPMessage reply = connection.call(soap_msg, endpoint);
System.out.println("\nReceived reply from: " + endpoint);
reply.writeTo(System.out);
System.out.println("");
reply_msg = ProcessXML.parse(reply);This is the console output:
Edit: These forums seem to be inserting an extra > before the <?xml version="1.0" encoding="UTF-8"?> line, but it doesn't exist in the code I'm pasting
Received reply from: http://localhost:8080/kuj/CaseStudyServlet
------=_Part_2_371807.1137465625031
Content-Type: text/xml; charset=UTF-8
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><MESSAGE><MESSAGETYPE>deliverquestion</MESSAGETYPE><QUESTIONID>1</QUESTIONID><USERNAME>zac</USERNAME></MESSAGE></SOAP-ENV:Body></SOAP-ENV:Envelope>
------=_Part_2_371807.1137465625031
Content-Type: text/html
Content-Id: MESSAGETEXT
<html><body>This is an Array sort Question. You will be given 10 random integers and you must sort and return them in the order of greatest to least.</body></html>
------=_Part_2_371807.1137465625031--
ERROR: 'Content is not allowed in prolog.'
17-Jan-2006 02:40:25 com.sun.xml.messaging.saaj.soap.EnvelopeFactory createEnvelope
SEVERE: SAAJ0511: Unable to create envelope from given source
com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source:
at com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:111)
at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSource(SOAPPart1_1Impl.java:39)
at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:98)
at com.zacwittedesign.xml.ProcessXML.realParse(ProcessXML.java:32)
at com.zacwittedesign.xml.ProcessXML.parse(ProcessXML.java:26)
(snip)And this is the beginning of the code for extracting the info from the SOAPMessage on the Client side:
private static Message realParse(SOAPMessage msg){
Message newMessage = new Message();
try {
SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope();
SOAPBody body = envelope.getBody();
(snip)It dies on SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope();
Does anyone know what I'm doing wrong?I suppose I should also include the bit where the Servlet actually SENDs the resulting SOAPMessage
SOAPMessage msg = ProcessXML.buildXML(outMessage);
// try to send it
try {
response.setContentType("text/xml");
msg.writeTo(response.getOutputStream()); -
How to process a SOAP Attachment in XI
Hi,
I have a SOAP-RFC-SOAP Synchronous scenario. Here the SOAP Message comes with an attachment. I need to process the SOAP Attachment through XI and need to map the content to the RFC and send the response back to the webservice. Here PayloadSwapBean does not work in Sender soap Adapter. Is there any other option of achieving this.
Thanks,
BhargavAsk Michal
The specified item was not found.
Need need to implement the other direction.
Regards
Stefan -
Exception when trying to create a soap attachment javax.activation. Unsuppo
I am trying to pass an object String [] as a soap attachment.
Reading the docs, if I pass a parameter as type datahandler, it is automatically treated as an Attachment.
I used the constructor DataHandler (Object obj, String mimeType)
where the object was my StringArray, and MIME is the XML representation of
a java type, which according to weblogic docs is NMTOKENS,IDREF or ENTITIES.
It threw the same error for the other two.
Am I using DataHandler correctly, is MIME the SOAP representation of the Java Object in memory.
Thanks for any help
TonyI am trying to pass an object String [] as a soap attachment.
Reading the docs, if I pass a parameter as type datahandler, it is automatically treated as an Attachment.
I used the constructor DataHandler (Object obj, String mimeType)
where the object was my StringArray, and MIME is the XML representation of
a java type, which according to weblogic docs is NMTOKENS,IDREF or ENTITIES.
It threw the same error for the other two.
Am I using DataHandler correctly, is MIME the SOAP representation of the Java Object in memory.
Thanks for any help
Tony -
11:56:37 F01F Soap Attachment Stream Error: [8911], File Size = 1120068 Written Size=131072
11:56:37 F01F Soap Attachment Stream Error: [8911], File Size = 1120068 Written Size=131072
11:56:37 F01F Error streaming an attachment [8911]
11:56:37 F277 Soap Attachment Stream Error: [8911], File Size = 673015 Written Size=131072
11:56:37 F277 Soap Attachment Stream Error: [8911], File Size = 673015 Written Size=131072
11:56:37 F277 Error streaming an attachment [8911]
What are these?Originally Posted by swishewk
11:56:37 F01F Soap Attachment Stream Error: [8911], File Size = 1120068 Written Size=131072
11:56:37 F01F Soap Attachment Stream Error: [8911], File Size = 1120068 Written Size=131072
11:56:37 F01F Error streaming an attachment [8911]
11:56:37 F277 Soap Attachment Stream Error: [8911], File Size = 673015 Written Size=131072
11:56:37 F277 Soap Attachment Stream Error: [8911], File Size = 673015 Written Size=131072
11:56:37 F277 Error streaming an attachment [8911]
What are these?
I believe the lines with the file size/written size are files in excess of the limit set in Data Synchronizer. -
Hi!
I've got a question about SOAP Attachment. It is possible to use "Datahandler" class to attach a file. But is it possible to put the datahandler in a business class ( as an attribute of the class), and the business class is a parameter of the service?
Thank you for your help!
Best Regards,
Nguyen GilbertI tried making the DataHandler object as a attribute of the parameter object and there were some exceptions. I think weblogic does not allow that.
-
SOAP attachment - module development?
Hi,
I have an IDOC -> SOAP scenario where I have to call a webservice that uses SOAP attachment.
Example:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ueb="IBrokerInterface">
<soapenv:Header/>
<soapenv:Body>
<ueb:TEBIBrokerInterface_PublishWS>
<aClientId>TEST</aClientId>
<aMessage>cid:file.xml</aMessage>
<aDuplicates>0</aDuplicates>
</ueb:TEBIBrokerInterface_PublishWS>
</soapenv:Body>
</soapenv:Envelope>
The "file.xml" has to be a SOAP attachment.
If I use a SOAP receiver channel how do I get the IDOC payload moved into a SOAP attachment and still keep the SOAP envelope?
Can this only be done with module development?
Thanks RasmusHi Rasmus,
You cannot create an attachment in mapping.
In PI 7.1 there will be a Java Mapping API for working with attachments, but the code will be similar to an adapter module. It will not be possible with XSLT.
Regards
Stefan -
Modify the SOAP attachment name
hi,
I have a Service with Party, which sends messages in SOAP format to XI.
When the SOAP message sent to XI contains a '&' character in its attachment name, the message gets failed to processed through XI.
I believe this happens since '&' character is a wildcard character in XML hence XI expects a escape character sequence following it and cannot parse through the '&' character. Also as per the IR tests executed for the SOAP message, when the '&' is replaced with its escape sequence the message is processed through successfully.
Is it possible to replace the '&' character with its escape sequence in the SOAP attachment name before it is processed by the XI Integration Engine. That is at the adapter level?
regards,
Diptee
Edited by: diptee s on Oct 26, 2010 4:47 PMhi,
i have created the Java Mapping .
in the pdf document How Tou2026Work with Character Encodings in Process Integration from SAP, for the Escape sequences it is said that for adding Escape sequences to the unescaped characters, add the Java mapping before the required mapping.
however, i am not able to test the interface in the IR even after adding the new Java mapping.
please suggest.
regards,
Diptee -
Convert SOAP Attachment into SOAP Body
Hi,
I am getting the response from external system through SOAP attachment, how to convert it into soap body.
Is there any other alternative apart from PayloadSwapBean, if not, let me know the steps of the same.
Regards,
B.AnandhHi Krish,
It is not possible to use adapter module (Custom or standard) in SOAP sender adapter and this thing is clearly mentioned in Help.sap.
But you can use axis adapter to use module (Axis adapter is extention to soap adapter). It provides modules which are flexible enough to fulfil your requirment.
If you are using Receiver SOAP adapter then youn can either have PayloadSwipeBean or your own adapter module. And it is possible to convert the attachment to the payload using custom module.(I have Done this)
There is method available getAttachment() of type. Just Check API.
Thanks
Sunil Singh
Maybe you are looking for
-
When i try to do a software update, it finishes and then says that the update cannot be saved because it has probably been corrupted during the download. This has happened a number of times and i do not know why, any help?
-
Cable to connect my Apple IPad Air to my TV
I want to purchase a cable to connect my new Apple Ipad Air to my TV. What do I need to buy?
-
Sending variable value from php to flash to load an xml file
I would like to load an XML file from the location locally or on the server being unaware of the name of the file. I am using PHP for sending the filename to Flash. The below is the PHP code: <?php filesInDir('C:\Documents and Settings\457305\My Docu
-
Android and iOS Output protection.
Output Protection: Control whether output to external rendering devices is permitted. [Background] Controls whether output to external rendering devices should be restricted. An external device is defined as any video or audio device that is not embe
-
When is ios 5 coming out as per indian time, when is ios 5 coming out as per indian time
when is ios 5 gonna come out?