Serialize/deserialize Infopath

M

Michael

Hi,
Im trying to deserialize a repeating table content in infopath to business
objects.
My repeating table got booktitle field and author. I have created a webmethod
submitbook(bookCollection bookc)
{

}
bookCollection is a class
with one private member: book[]array and set/get properties.
The book class
have booktitle, and author as private member and set/get properties.

In my infopath forms i create a submit button which does a submit to the
webservice, selecting the group og books. When i submit this the bookarray
object is null. But if i create a webmethod that returns the array of book
and create an infopath forms based on that webservice call then it will work.
Do anyone know how to solve this without have to create forms based on the
webservice call??? My forms is already finished and i dont want to redo it
all over again..
 
F

Franck Dauché

Hi Michael,

How are you calling your Web Service? You may need to post the code that
you are using in your Submit your array? Where do you get your object null
error?

Franck Dauché
 
M

Michael

Hi Franck,
I dont get any object null error, the webservice would not understand the
xml i passed in and automatically deserialize it because it comes with the
namespace my
which is created by infopath the xml string will look like this
<my:book xmlns:my="http......"
<my:booktitle>Digital fortress</my:booktitle>
<my:author>aaaaa</my:author>
</my:book>
with the the namespace added it wont work. Do you know
how i can remove the my namespace for the repeating table without causing
error for the form? And i still can add in rows to the repeating table?

Another option i figure out how to solve this is to make a webservice method
which return an empty array of book. and add it to the form on load.
But then i can't insert any rows in the repeating table, do you know how i
can enable it??

Franck Dauché said:
Hi Michael,

How are you calling your Web Service? You may need to post the code that
you are using in your Submit your array? Where do you get your object null
error?

Franck Dauché

Michael said:
Hi,
Im trying to deserialize a repeating table content in infopath to business
objects.
My repeating table got booktitle field and author. I have created a webmethod
submitbook(bookCollection bookc)
{

}
bookCollection is a class
with one private member: book[]array and set/get properties.
The book class
have booktitle, and author as private member and set/get properties.

In my infopath forms i create a submit button which does a submit to the
webservice, selecting the group og books. When i submit this the bookarray
object is null. But if i create a webmethod that returns the array of book
and create an infopath forms based on that webservice call then it will work.
Do anyone know how to solve this without have to create forms based on the
webservice call??? My forms is already finished and i dont want to redo it
all over again..
 
M

Michael

Hi Franck,
I dont get any object null error, the webservice would not understand the
xml i passed in and automatically deserialize it because it comes with the
namespace my
which is created by infopath the xml string will look like this
<my:book xmlns:my="http......"
<my:booktitle>Digital fortress</my:booktitle>
<my:author>aaaaa</my:author>
</my:book>
with the the namespace added it wont work. Do you know
how i can remove the my namespace for the repeating table without causing
error for the form? And i still can add in rows to the repeating table?

Another option i figure out how to solve this is to make a webservice method
which return an empty array of book. and add it to the form on load.
But then i can't insert any rows in the repeating table, do you know how i
can enable it??

:


Franck Dauché said:
Hi Michael,

How are you calling your Web Service? You may need to post the code that
you are using in your Submit your array? Where do you get your object null
error?

Franck Dauché

Michael said:
Hi,
Im trying to deserialize a repeating table content in infopath to business
objects.
My repeating table got booktitle field and author. I have created a webmethod
submitbook(bookCollection bookc)
{

}
bookCollection is a class
with one private member: book[]array and set/get properties.
The book class
have booktitle, and author as private member and set/get properties.

In my infopath forms i create a submit button which does a submit to the
webservice, selecting the group og books. When i submit this the bookarray
object is null. But if i create a webmethod that returns the array of book
and create an infopath forms based on that webservice call then it will work.
Do anyone know how to solve this without have to create forms based on the
webservice call??? My forms is already finished and i dont want to redo it
all over again..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top