Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / September 2005

Tip: Looking for answers? Try searching our database.

Help with web service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kevin - 30 Aug 2005 15:00 GMT
I am experimenting with a web service - trying to connect to the
AdventureWorks sample database, But I can not get the web service to connect.

I have not got the correct syntax for the connection string for SqlConnection.

Any Ideas Appreciated....
Scott L. Heim [MSFT] - 30 Aug 2005 15:29 GMT
Hi Kevin,

Here is some sample VB.NET code that connects to the Northwind SQL Server
database to return a list of Customers:

** NOTE: You would need to replace "yourserver" in the connection string
with the appropriate name of your SQL Server machine.

   <WebMethod()> _
   Public Function GetCustomers() As DataSet
       Dim CN As New SqlClient.SqlConnection("Data
Source=yourserver;Initial Catalog=Northwind;Integrated Security=SSPI")
       CN.Open()

       Dim strSQL As String = "SELECT CustomerID, CompanyName FROM
Customers"
       Dim DA As New SqlClient.SqlDataAdapter(strSQL, CN)
       Dim DS As New DataSet

       DA.Fill(DS, "Customers")
       Return DS
   End Function

Let me know if this helps or if you need something else.

Best regards,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
Kevin - 31 Aug 2005 02:30 GMT
It was actually a problem with granting access to the ASPNET user... that
fixed the web service... now I have another problem...

When I try to connect to the web service method that returns a data set
(this works in the debug mode, I see all the XML data).. I get the following
error

[.......some stuff about GetEmplyeeRespone and GetEmployeeResult..........]

Undeclared XSD Element: '{http://www.w3.org/2001/XMLSchema}'schema

This is automatically generated by the web service???

Any ideas on how to solve this issue?

Regards
Kevin

> Hi Kevin,
>
[quoted text clipped - 27 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights
Scott L. Heim [MSFT] - 01 Sep 2005 13:35 GMT
Hi Kevin,

Can you try using the sample code I sent against the Northwind (or Pubs)
database to see if you can reproduce the error? If you can, then please
post your web service code so we can have a look.

Thanks,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
Kevin - 01 Sep 2005 22:40 GMT
Hi Scott,

Thankyou for all of your help with this.... it seems to be a question that
no one is realy interested in answering.....

I have managed to make my web service work by using a work-around and
returning an XML document instead of a data set.... this is not ideal by any
means, as the changed data has to be manipulated in code when it is returned,
instead of the automatic functionality of the dataset...

It seems that InfoPath does not like the WSDL information generated by the
Web Service for the dataset, especially the "s:schema" reference from inside
the s:schema type....

It also did not like the data with its diffgram tags when I saved a copy of
the WSDL and edited it. (This allowed data access, but InfoPath could not use
the data).

I am using .NET 2.0 and ASP.NET 2.0 with Web Designer Express 2005 to create
the web service.

From my reading, I thought that the problems with InfoPath and ADO.NET
datasets had been resolved with SP1, but it looks like there might be some
new problems with .NET 2.0 or ASP.NET 2.0

Suggestions welcome, as I would like to use datasets idealy.

Kevin

> Hi Kevin,
>
[quoted text clipped - 8 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights
Scott L. Heim [MSFT] - 01 Sep 2005 23:04 GMT
Ah - now I have not done any testing with ASP.NET 2.0 with InfoPath 2003
SP1. Do you have ASP.NET 1.1 available still? If so, do you get the same
result?

Also, do you have Access or SQL Server available? If so, I would like to
provide you with sample code that I have used with VS.NET to create a web
service that retrieves and updates data from these databases.

Thanks,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.