简体   繁体   中英

Accessing result of method generated by WSDL.EXE

Hello I have got WebService that I generated via WSDL using Visual Studio Command promt and via this command

string[] ahoj = new string[] { 28156609.ToString() };

Rozhranice.StatusType[] ahoj2;

Rozhranice.InformaceOPlatciType[] ahoj3;

Rozhranice.rozhraniCRPDPH srv = new Rozhranice.rozhraniCRPDPH();

StreamWriter writer = new StreamWriter(@"C:\Users\marek\Desktop\spol.txt");

string abc = (srv.getStatusNespolehlivyPlatce(ahoj, out ahoj3).bezVypisuUctu.ToString());

textBox1.Text = abc;

I`m able to call the result of this: 在此输入图像描述

But how can I get result of this? 在此输入图像描述

I tried this:

string abc = (srv.getSeznamNespolehlivyPlatce(ahoj, out ahoj3).ToString());

but after ..., out ahoj3). isn't option to select values from informaceOPlatciType

May I ask where do I make a mistake?

When I try to write srv. (the options are only getStatusNespolehlivyPlace and getSeznamNespolehlivyPlace)

If there is need of providing webservice url just let me know.

This question is not duplicate of : Create SOAP envelope of XML and send it as HttpWebRequest to WebService - this is just Creating but now I'm trying to call an exact reasulf of before generated code by WSDL Command Prompt, may this be re-opened please?

In mentioned article I was trying to send it via SOAP now I have quiet working code generated by WSDL Command Prompt (which is different way then asked in previous question) and I'm stuck with getting result of it. In my opinion it is very different question.

After calling

srv.getSeznamNespolehlivyPlatce(ahoj, out ahoj3) 

the ahoj3 variable should be set unless something is wrong with the method. You can access its properties later in code as usual:

ahoj3.SomeProperty.

ahoj3 is an array of Rozhranice.InformaceOPlatciType . You need to access each element of the array to get the contents.

string[] ahoj = new string[] { "28156609" };
Rozhranice.InformaceOPlatciType[] ahoj3;
Rozhranice.rozhraniCRPDPH srv = new Rozhranice.rozhraniCRPDPH();
StatusType status = srv.getStatusNespolehlivyPlatce(ahoj, out ahoj3);
string abc = status.bezVypisuUctu.ToString();   // If it is already a string, then ToString not needed
for (int i=0; i<ahoj3.Length; i++)
{
    Rozhranice.InformaceOPlatciType info = ahoj3[i];
    // Do something with info.cisloFu;
    // Do something with info.dic;
    // etc.
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM