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("10016", ...);

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.


robespierre_2010Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

HainKurtSr. System AnalystCommented:
when you call it with a string parameter, what do you get

String supList;
Bool resOK;
resOK = mc.GetSupplierByZipCode("10016", supList);

what do you get as supList?
0
robespierre_2010Author Commented:
I cannot call it because there are the following compilation errors:

cannot convert from string to 'out medicare.SupplierDataList'

0
HainKurtSr. System AnalystCommented:
try this

medicare.SupplierDataList supList;
Bool resOK;
resOK = mc.GetSupplierByZipCode("10016", supList);

0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

robespierre_2010Author Commented:
that is not giving errors but how do I display the result of the call?
0
HainKurtSr. System AnalystCommented:
loop all items

foreach (medicare.SupplierData s in supList) {
  Response.Write("<li>SupplierNumber : " + s.SupplierNumber);
  Response.Write("<li>CompanyName: " + s.CompanyName);
...
}

not sure abouth the structure, you should check the classes in medicare
0
robespierre_2010Author Commented:
this does it, unless you have a better suggestion

          for (int i = 0; i < supList.TotalRecords; i++)
          {
              Response.Write("<li>SupplierDatas[i].CompanyName : " + supList.SupplierDatas[i].CompanyName);
          }
0
HainKurtSr. System AnalystCommented:
both should do the same thing...

28803924 & 28801502

I prefer first one, but if you want to use i, second one is better ;)

loop all items

int i = 0;
foreach (medicare.SupplierData s in supList) {
  i++;
  Response.Write("<li>Supplier " + i.toString());
  Response.Write("<li>SupplierNumber : " + s.SupplierNumber);
  Response.Write("<li>CompanyName: " + s.CompanyName);
...
}
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
robespierre_2010Author Commented:
thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.