Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / JScript / August 2003

Tip: Looking for answers? Try searching our database.

WebServices from within another htc behavior

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jason Kleban - 13 Aug 2003 17:53 GMT
I'm using the following code in the init of a custom
client-side web component.

objWebService = document.createElement("div");
objWebService.style.display = "none";
objWebService.style.behavior = "/theDir/webservice.htc";
objWebService.id = "WebServiceObject";
parentElement.appendChild(objWebService);
objWebService.useService("/theDir/MCInterface.asmx?
WSDL","MCI");

This object must be created at runtime on the client
side.  The files exist and are reachable, it seems, but
when I run this code, it has a problem with the last line,
telling me that the "Object doesn't support this property
or method."  I assume it's taking about the useService()
method.

I've done some fiddling and I added <PUBLIC:ATTACH    
EVENT="onload" HANDLER="DoInit" /> to the webservice.htc
file.  I also tried this with oncontentready.

This code doesn't seem to be called.  I wrote a function
that displays the current code in a new window and the
object does show up in the document:

<DIV id=WebServiceObject style="DISPLAY: none;
BEHAVIOR: /theDir/webservice.htc"></DIV>

how do behaviors work when being added after the page is
finished loading?  Why isn't this working overall?
Jason Kleban - 13 Aug 2003 18:38 GMT
For a test, I hard coded the div that has the behavior and
the init code is still not running and the object still
doesn't support the method, but the object is found and is
not null, and if I change the name of what I'm looking
for, it is null.

I have two htc files.  One is definately loading, the one
that's calling the webservice, and the webservice htc,
which appears not to be.

If I try to download either file directly, however, I get
an IE popup message box without delay:

"Internet Explorer cannot download [file] from [site].

Internet Explorer was not able to open this Internet site.
The requested site is either unavailable or cannot be
found.  Please try again later."

But again, one of these files is what defines the
behaviors that I am seeing on the page.  I've cleared my
cache too.  Changes in the code are reflected as well.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.