Error with Web Service

S

sadhana

Hi,
I am trying to submit data to the sharepoint server through a web service. I
have deployed web service to the sharepoint server machine.Its path in that
machine is as follows:
http://server:7020/Service.asmx
I have created a data connection with the Infopath form to submit the data
to the above web service. Now, I am executing this web service in the
submit_button click event using the code below.
DataConnection submit=this.DataConnections["Web Service Submit"];
submit.Execute();

But, it is giving me the exception at run time, when I click on submit
button, it is giving me the following error at the second line of code.

System.Net.WebException was unhandled by user code
Message="InfoPath cannot submit the form.\nAn error occurred while the
form was being submitted."
Source="Microsoft.Office.InfoPath.Client.Internal.Host"
StackTrace:
at
Microsoft.Office.InfoPath.Internal.MomExceptionHelper.ExecuteDataConnectionAction(OMCall d)
at
Microsoft.Office.InfoPath.Internal.WebServiceConnectionHost.Execute()
at
Microsoft.Office.InfoPath.Internal.FormEventsHost.OnSubmit(DocReturnEvent
pEvent)
at
Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_SinkHelper.OnSubmitRequest(DocReturnEvent pEvent)

Can any body tell me what would be the error?

Thanks
 
B

Ben Walters

Sadhana,
Sounds like it could be an issue in the web service.
Try running the service in debug moe then, submit the InfoPath form you
should be able to step through the code and find out whats happening.

Hope this helps

Cheers,
Ben
 
S

sadhana

Hi Ben,
I have tested the webservice in the local machine and in the sharepoint
server machine as well.
In sharepoint server machine, I am just running the service.asmx file as
"View in Browser" because its .cs file is in the local machine. The
webservice is working in the server machine at the url
http://server:7000/Service.asmx and I am able to view the INVOKE of the web
method.
when it is connected to the infopath, then only it is giving me the error.
Could you please tell me how can I test it in the server machine in debug
mode? Once I have deployed the webservice with a specific assembly, in the
server machine I am just copying the file from the local system to server
system and I am specifiying the assembly name in service.asmx file in the
server machine.

Thanks

Ben Walters said:
Sadhana,
Sounds like it could be an issue in the web service.
Try running the service in debug moe then, submit the InfoPath form you
should be able to step through the code and find out whats happening.

Hope this helps

Cheers,
Ben

sadhana said:
Hi,
I am trying to submit data to the sharepoint server through a web service.
I
have deployed web service to the sharepoint server machine.Its path in
that
machine is as follows:
http://server:7020/Service.asmx
I have created a data connection with the Infopath form to submit the data
to the above web service. Now, I am executing this web service in the
submit_button click event using the code below.
DataConnection submit=this.DataConnections["Web Service Submit"];
submit.Execute();

But, it is giving me the exception at run time, when I click on submit
button, it is giving me the following error at the second line of code.

System.Net.WebException was unhandled by user code
Message="InfoPath cannot submit the form.\nAn error occurred while the
form was being submitted."
Source="Microsoft.Office.InfoPath.Client.Internal.Host"
StackTrace:
at
Microsoft.Office.InfoPath.Internal.MomExceptionHelper.ExecuteDataConnectionAction(OMCall
d)
at
Microsoft.Office.InfoPath.Internal.WebServiceConnectionHost.Execute()
at
Microsoft.Office.InfoPath.Internal.FormEventsHost.OnSubmit(DocReturnEvent
pEvent)
at
Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_SinkHelper.OnSubmitRequest(DocReturnEvent
pEvent)

Can any body tell me what would be the error?

Thanks
 

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