How to use WebServiceConnection to call webservoce ...

W

Wozza

Does anybody know how to use this method to update data using a web service
call ....

I am getting the following error!

"Exception from HRESULT: 0x8004304D"
at
Microsoft.Office.InfoPath.Internal.MomExceptionHelper.ExecuteDataConnectionAction(OMCall
d)
at
Microsoft.Office.InfoPath.Internal.WebServiceConnectionHost.Execute(XPathNavigator
input, XPathNavigator output, XPathNavigator errors)
at InfoPathBook.FormCode.btnSubmit_Clicked(Object sender,
ClickedEventArgs e)

My code is ...

// Create XmlDocuments.

XmlDocument inputDocument = new XmlDocument();

XmlDocument outputDocument = new XmlDocument();

XmlDocument errorsDocument = new XmlDocument();

// Create XPathNavigator objects for documents.

XPathNavigator inputNav = this.MainDataSource.CreateNavigator();

XPathNavigator outputNav = outputDocument.CreateNavigator();

XPathNavigator errorsNav = errorsDocument.CreateNavigator();

WebServiceConnection wsc =
(WebServiceConnection)this.DataConnections["MyServicePUT"];

Trace.WriteLine(inputNav.OuterXml);

wsc.Execute(inputNav, outputNav, errorsNav);
 
W

Wozza

Some more detail ...

1. If null is passed as the inputNav then the call seems to work
(documentation says "If the input parameter is specified as null then the
declarative settings are used.")

2. If the inputNav XPathNavigator is specified the errorNav.Value is:
[5208] soap:ServerSystem.Web.Services.Protocols.SoapException: Server was
unable to process request. ---> System.ArgumentNullException: Value cannot
be null.
[5208] Parameter name: s
[5208] at System.IO.StringReader..ctor(String s)
[5208] at System.Xml.XmlDocument.LoadXml(String xml)
[5208] at Audit.Service.PutAuditDocument(String xmlDocument) in
P:\Projects\Audit\Audit.Service\AuditService.asmx.cs:line 457
[5208] --- End of inner exception stack trace ---
[5208] System.Net.WebException
[5208] Exception from HRESULT: 0x8004304D
[5208] at
Microsoft.Office.InfoPath.Internal.MomExceptionHelper.ExecuteDataConnectionAction(OMCall
d)
[5208] at
Microsoft.Office.InfoPath.Internal.WebServiceConnectionHost.Execute(XPathNavigator
input, XPathNavigator output, XPathNavigator errors)
[5208] at InfoPathBookControlSizing.FormCode.btnSubmit_Clicked(Object
sender, ClickedEventArgs e)
 

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