on 06-24-2008 1:54 PM
Hi all,
I have to implement a WebService (Providing/Consuming) solution, by which I can send a file as attachment of Web Service Request.
Anyone can help me?
Best Regards,
Raffaele
hi,
Yes the webservice should have capaibility of holding the attachment.It's not exactly payload. You need to understand webservice architecture, then it will be clear.
This link will be helpful
http://www.w3.org/TR/SOAP-attachments
http://www.theserverside.com/tt/articles/article.tss?l=SendingAttachmentsWithSOAP
Thanks,
Vijaya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
I saw how attach a MIME part to a SOAP message. I do this with the follow ABAP Code:
DATA: lo_attachments TYPE REF TO if_wsprotocol_attachments,
lo_attachment_internal TYPE REF TO cl_ai_attachment.
CREATE OBJECT my_proxyobject.
lo_attachments ?= my_proxyobject->get_protocol( if_wsprotocol=>attachments ).
CREATE OBJECT lo_attachment_internal
EXPORTING
p_string = 'Textual Attachment'
* P_XSTRING
p_type = if_ai_attachment=>c_mimetype_text_plain
p_name = 'doc_name.txt'
p_from_type = if_ai_attachment=>c_attach_type_text.
APPEND lo_attachment_internal TO lt_attachments.
CALL METHOD lo_attachments->set_attachments
EXPORTING
attachments = lt_attachments.
but when I try to send the request to Web Service, an expeption occurred with "Wrong SOAP Version".
Can anyone tell me if I forget anything in the request?
Best Regards,
Raffaele Frattini
Sorry,
but can I have an Abap example?
I explain you the scenario: I will create a Proxy Object autogenerated from a WSDL document. If in the WSDL document isn't indicated an attachment parameter, when I call proxy method to create WS request, how can I attach my file?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK,
I understand that I can attach a file to my SOAP request in Consuming a WS.(thanks a lot!)
So, the WS publisher has to indicate in the WSDL that a WebMethod can accept an attachment, isn't it?
And if I create a Proxy Object based to the WSDL type I refer, I can see attachment as a normal WebMethod parameter of base64 type. Is it right?
Regards,
Raffaele
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Not really. Any webservice can accept attachment. You need not explicitly mention that in wsdl, as attachment is not part of envelope. If your webservice is written in such a way that it extracts attachment and do the needful, it will be able to extract the attachment else it wont readt the attachment.
You can try this in XI itself. Create a normal webservice hosted in XI Server, provide the wsdl to the the web service consumer. Invoke the Web Service from WS Client and send attachment. XI will be able to receive the attachment.
Please go through the link below to understand WS architecture with attachment.
http://java.sun.com/developer/EJTechTips/2005/tt0425.html
Thanks
Amit
Reward points if answer is helpful
Check this blog
/people/baris.buyuktanir2/blog/2007/03/06/how-to-create-a-web-service-with-attachments-soap-with-attachments
this will hopefully give you some directions
Sameer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.