Using AddAttachment from SP Lists Web Service in InfoPath

188 views
Skip to first unread message

Javier

unread,
Nov 30, 2009, 3:26:01 PM11/30/09
to
Hi, I need to add an attachment to the list I use to submit a web-based
Infopath form. I'm writing custom code in the FormEvents_Submit method to
call the DataConnection associated to the Web Service (_vti_bin/Lists.asmx --
AddAttachment)

When I call the Execute method, I get the following error:

-----
InfoPath cannot submit the form.
An error occurred while the form was being submitted.

The SOAP response indicates that an error occurred on the server:

Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was
thrown.
<detail><errorstring
xmlns="http://schemas.microsoft.com/sharepoint/soap/">Input string was not in
a correct format.</errorstring></detail>
-----

I think this is related to the attachment field (tns:attachment -
base64Binary) that is not being passed correctly to the web service. Any
ideas on how to solve this problem?

Thanks a lot!

Javier.

joecorrao

unread,
Apr 20, 2010, 12:57:34 PM4/20/10
to
Hey javier,

Did you figure this one out?
I am just hitting this same type of issue, except I get the HRESULT:0x81020073 complaining about invalid characters in a filename or folder. I validated that this is not the case so I'm curious why the web service would throw this exception.

Javier wrote:

Using AddAttachment from SP Lists Web Service in InfoPath
30-Nov-09

Hi, I need to add an attachment to the list I use to submit a web-based

Infopath form. I am writing custom code in the FormEvents_Submit method to


call the DataConnection associated to the Web Service (_vti_bin/Lists.asmx --
AddAttachment)

When I call the Execute method, I get the following error:

-----
InfoPath cannot submit the form.
An error occurred while the form was being submitted.

??????


The SOAP response indicates that an error occurred on the server:

Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was
thrown.
<detail><errorstring
xmlns="http://schemas.microsoft.com/sharepoint/soap/">Input string was not in
a correct format.</errorstring></detail>
-----

I think this is related to the attachment field (tns:attachment -
base64Binary) that is not being passed correctly to the web service. Any
ideas on how to solve this problem?

Thanks a lot!

Javier.

Previous Posts In This Thread:

On Monday, November 30, 2009 3:26 PM
Javier wrote:

Using AddAttachment from SP Lists Web Service in InfoPath


Hi, I need to add an attachment to the list I use to submit a web-based

Infopath form. I am writing custom code in the FormEvents_Submit method to


call the DataConnection associated to the Web Service (_vti_bin/Lists.asmx --
AddAttachment)

When I call the Execute method, I get the following error:

-----
InfoPath cannot submit the form.
An error occurred while the form was being submitted.

??????


The SOAP response indicates that an error occurred on the server:

Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was
thrown.
<detail><errorstring
xmlns="http://schemas.microsoft.com/sharepoint/soap/">Input string was not in
a correct format.</errorstring></detail>
-----

I think this is related to the attachment field (tns:attachment -
base64Binary) that is not being passed correctly to the web service. Any
ideas on how to solve this problem?

Thanks a lot!

Javier.


Submitted via EggHeadCafe - Software Developer Portal of Choice
Make Your Apps Talk to Each Other: Asynchronous Named Pipes Library
http://www.eggheadcafe.com/tutorials/aspnet/478ca475-2fd9-45d6-9090-5acdaeb00162/make-your-apps-talk-to-ea.aspx

buddh...@gmail.com

unread,
Dec 12, 2014, 9:51:44 AM12/12/14
to
Im looking for the code to add an attachment to web base form InfoPath form...can you pleae send it to me buddh...@gmail.com
Reply all
Reply to author
Forward
0 new messages