An error occurred while calling WebService by the thread...

Source: Internet
Author: User
An error occurred while calling WebService by the thread... Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiNetwork/html/delphi_20061201110329221.html
VaR
Ht: thttprio;
It1: ifilews;
Markinfo: integer;
Begin
Try
Ht: = thttprio. Create (NiL );
// It1: = getifilews (true, '', HT );
It1: = getifilews ========================> if it is a thread, an error occurs here
Markinfo: = it1.isfileexists ('e: \ 12.txt ');
If markinfo = 0 then
Begin
Self. Caption: = 'file exist ';
End
Else
Begin
Self. Caption: = 'file does not exist ';
End;
Finally
Ht. Free;
End;
End;
// The above section Code ,
// On the main interface, OK. The abstract error occurs in the code in the thread.
// Why can't I find the cause?

We can see that Delphi is not popular ......

From your perspective, this question has nothing to do With WebService. I would like to ask, have you implemented the execute method in your test thread?

You guys are not joking.

Please give me a good explanation of this problem.
If the explanation is not clear, you will be deducted 10000 points.
I have explained that laifeng will give you a lollipop.

Sorry, I sent an error.

Ah... No one else ....

Tthread is an abstract class. Please refer to LZ if you haven't implemented execute in your testing thread?

I copied the above paragraph to the execute of the thread.

The problem is as mentioned above.

Let's take a look at the WebService lines involved.
What is in getifilews ??
In addition, there is no caption in the thread.

Used in the thread. coinitialize and couninitialize must be added to the Code.


// Start the thread
Coinitialize (NiL );
Try
... // Create Rio
... // Call

Finally
Couninitialize;
End;

====
In create and destory, I made coinitialize (NiL); couninitialize;
====
Getifilews is the method to obtain the interface, which is generated by the WSDL import.
====
The current error is as follows:
// On the main interface, OK. The abstract error occurs in the code in the thread.

Network lookup is to instantiate the interface, but I don't know how to correct this error.
Can you give me a clearer explanation?

The main problem is in getifilews,
Another
Getifilews is the method to obtain the interface, which is not very clear when generated by the WSDL import.

I think it's a problem in the getifilews function. Let's take a look at what has been done in it. It should be related to function processing.

Ah ~~
Getifilews is correct. It's my problem.

This is OK.
Coinitialize (NiL );
Try
Ht: = thttprio. Create (NiL );
Ht. url: = 'HTTP: // ../webservicetest/filews. dll/soap/ifilews ';
Ht. wsdllocation: = 'HTTP: // ../webservicetest/filews. dll/WSDL/ifilews ';
Ht. Service: = 'ifilewsservic'
Ht. Port: = 'ifilewsport ';

It1: = HT as ifilews;
It1.xxx (...)
Finally
Couninitialize;
End;
In the final analysis, I still do not know about the WebService transmission process. Thank you for your attention.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.