robespierre_2010
asked on
simple question: SOAP, ASP.NET and C#
Hi,
I want to use the following web service:
http://www.webservicex.net/medicareSupplier.asmx
For that, I have added a web reference in VWD 2008 express. In my C# code behind I have added the following code:
medicare.MediCareSupplier mc = new medicare.MediCareSupplier( );
I want to display the results for one specific zip code, so I make the call by doing something like this:
mc.GetSupplierByZipCode("1 0016", ...);
but the method requires a second input parameter. I cannot get this second parameter right. The second argument is supposed to be "out medicare.SupplierDataList"
I am sure this is a simple SOPA issue that has to do with the second parameter being of List type, but as I do not know much about C# I am lost. Any valuable help will be most welcome.
Thanks and regards.
I want to use the following web service:
http://www.webservicex.net/medicareSupplier.asmx
For that, I have added a web reference in VWD 2008 express. In my C# code behind I have added the following code:
medicare.MediCareSupplier mc = new medicare.MediCareSupplier(
I want to display the results for one specific zip code, so I make the call by doing something like this:
mc.GetSupplierByZipCode("1
but the method requires a second input parameter. I cannot get this second parameter right. The second argument is supposed to be "out medicare.SupplierDataList"
I am sure this is a simple SOPA issue that has to do with the second parameter being of List type, but as I do not know much about C# I am lost. Any valuable help will be most welcome.
Thanks and regards.
ASKER
I cannot call it because there are the following compilation errors:
cannot convert from string to 'out medicare.SupplierDataList'
cannot convert from string to 'out medicare.SupplierDataList'
try this
medicare.SupplierDataList supList;
Bool resOK;
resOK = mc.GetSupplierByZipCode("1 0016", supList);
medicare.SupplierDataList supList;
Bool resOK;
resOK = mc.GetSupplierByZipCode("1
ASKER
that is not giving errors but how do I display the result of the call?
loop all items
foreach (medicare.SupplierData s in supList) {
Response.Write("<li>Suppli erNumber : " + s.SupplierNumber);
Response.Write("<li>Compan yName: " + s.CompanyName);
...
}
not sure abouth the structure, you should check the classes in medicare
foreach (medicare.SupplierData s in supList) {
Response.Write("<li>Suppli
Response.Write("<li>Compan
...
}
not sure abouth the structure, you should check the classes in medicare
ASKER
this does it, unless you have a better suggestion
for (int i = 0; i < supList.TotalRecords; i++)
{
Response.Write("<li>Suppli erDatas[i] .CompanyNa me : " + supList.SupplierDatas[i].C ompanyName );
}
for (int i = 0; i < supList.TotalRecords; i++)
{
Response.Write("<li>Suppli
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
String supList;
Bool resOK;
resOK = mc.GetSupplierByZipCode("1
what do you get as supList?