?
Solved

simple question: SOAP, ASP.NET and C#

Posted on 2010-03-27
8
Medium Priority
?
623 Views
Last Modified: 2013-11-18
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.


0
Comment
Question by:robespierre_2010
  • 4
  • 4
8 Comments
 
LVL 61

Expert Comment

by:HainKurt
ID: 28795263
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
 

Author Comment

by:robespierre_2010
ID: 28798470
I cannot call it because there are the following compilation errors:

cannot convert from string to 'out medicare.SupplierDataList'

0
 
LVL 61

Expert Comment

by:HainKurt
ID: 28798995
try this

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

0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 

Author Comment

by:robespierre_2010
ID: 28799872
that is not giving errors but how do I display the result of the call?
0
 
LVL 61

Expert Comment

by:HainKurt
ID: 28801502
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
 

Author Comment

by:robespierre_2010
ID: 28803924
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
 
LVL 61

Accepted Solution

by:
HainKurt earned 2000 total points
ID: 28804417
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
 

Author Closing Comment

by:robespierre_2010
ID: 31707899
thanks
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

589 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question