Problems exposing COM through Web Service

Hi,

I am having exposing old COM components through web services.
I have a web service project (Project1), where I referenced my component and then tried instantiating an object in a function.
The component detail is as follows (looking in the Object Browser window):-
Public Function Questions(ByRef strSearch As String, Optional ByRef intlevel As Short) As Object
Member of StudentInterface.QAInterface
Now in my webservice project (Project1), this is what I coded after referencing the component.
<WebMethod()> Public Function result(ByVal strsearch As String) As Object
Dim vbcom As New StudentInterface.QAInterface()
result = vbcom.Questions(strsearch)
Return result ''''''*****Shows error in this line
End Function
I am a bit weary about how to use the optional, but I have ignored it. That might be the mistake. If it is, please guide me on how to use it.
There is an error when I use this webservice through my asp.net page.
ASP.NET Page:
Dim ws As New localhost.SWS()
TextBox2.Text = ws.result(TextBox1.Text.ToString)
_________________________________
Following error shows up:
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Runtime.InteropServices.COMException (0x800A01A8): Object required at StudentInterface.QAInterfaceClass.Questions(String& strSearch, Int16& intlevel) at SWS.SWS.result(String strsearch) in c:\inetpub\wwwroot\SWS\SWS.asmx.vb:line 63 --- End of inner exception stack trace ---
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Runtime.InteropServices.COMException (0x800A01A8): Object required at StudentInterface.QAInterfaceClass.Questions(String& strSearch, Int16& intlevel) at SWS.SWS.result(String strsearch) in c:\inetpub\wwwroot\SWS\SWS.asmx.vb:line 63 --- End of inner exception stack trace ---
Source Error:

Line 58: <System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/result", RequestNamespace:="http://tempuri.org/", ResponseNamespace:="http://tempuri.org/", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)> _
Line 59: Public Function result(ByVal strsearch As String) As Object
Line 60: Dim results() As Object = Me.Invoke("result", New Object() {strsearch})
Line 61: Return CType(results(0),Object)
Line 62: End Function

Source File: c:\inetpub\wwwroot\QAX\Web References\localhost\Reference.vb Line: 60
Stack Trace:

[SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Runtime.InteropServices.COMException (0x800A01A8): Object required
at StudentInterface.QAInterfaceClass.Questions(String& strSearch, Int16& intlevel)
at SWS.SWS.result(String strsearch) in c:\inetpub\wwwroot\SWS\SWS.asmx.vb:line 63
--- End of inner exception stack trace ---]
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream)
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
QAX.localhost.SWS.result(String strsearch) in c:\inetpub\wwwroot\QAX\Web References\localhost\Reference.vb:60
QAX.Questionws.OK_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\QAX\Questionws.aspx.vb:55
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain() +1263


0
mothsmoke
7/30/2003 8:36:49 PM
asp.net.xml-web-services 7071 articles. 0 followers. Follow

4 Replies
671 Views

Similar Articles

[PageSpeed] 14

I could be wrong here but it looks like you are trying to return a complex type and as far as I know web services can only return standard types (i.e. string, double, int, etc.).
0
russnem
8/2/2003 8:42:24 PM
In Web Services, you can't return an object. First you have to create an object and that object you have to return.

In below example I tried to return an object has an array and string. For your example also, you have to return information similarly.
In below example I am trying to return an Object, which has an array and an element.
http://www.w3coder.com/contest/examples/WSObjSer.Asmx
http://www.w3coder.com/contest/examples/WSOBJSerAsmx.txt
[Note: On Client side, you have to use same object to get the result. and from there assign the values to needed controls or use in your business logic. If you use above example class, then in client side you have to accept data again using ObjSerEx]
This might help you, since the example what I provided also has object.

Sreedhar
http://www.w3coder.org
weblog http://weblogs.asp.net/skoganti
0
sreedhark
8/2/2003 11:03:34 PM
Yes, the problem you both mentioned is regarding returning the type. 

I will look through your examples and be back if there is any problem. Thanks for the help.
0
mothsmoke
8/4/2003 8:48:27 AM
I have a 2-d array in my case. 

I think I have a problem calling it.
Could you help me on how to set a 2d array in WS and call it in a client.
Thank You.
0
mothsmoke
8/4/2003 10:39:34 AM
Reply:

Similar Artilces:

How to call a .net web service from another .net web service?
Hi all,I have developed two asp .net web services using visual studio .net 2003.I wish to call one web service from another web service.I tried adding a web reference of the web service in another web service and was able to do so.but i m not able to access the web methods provided by the web servicecould you please suggest a way to go about itExpecting quick replyThanxCharmy try to make sure that you reference it in the web reference and call it properly this is sample  [WebMethod()] public double CalcDistance(int x1, int y1, int x2, int y2) { Calculator.Service1 calc = new...

xml web service --uploading the file to the xml web service
how can we upload the file in the xml web service 1.i mean what will be the return value in the proxy class 2.and how am i going to send the file to the xml web service----regards Bipul Kumar Here are some links to articles that helped us get this done: http://msdn.microsoft.com/webservices http://www.microsoft.com/downloads/details.aspx?familyid=06255a94-2635-4d29-a90c-28b282993a41&displaylang=en https://www.sys-con.com/dotnet/article.cfm?id=458 Hope this helps....

Web service in .NET from Java Web Service
Hi there,I'm pretty new to .net (although i have years of experience with the old vb 6, access 2k, as well as java)... and need some with perhaps either some syntax or something.Here is the wsdl.<wsdl:definitions targetNamespace="http://www.dynix.com/schema/book">−<wsdl:types>−<schema targetNamespace="GetBookInfoByISBN">−<complexType name="BookInfoType">−<sequence><element maxOccurs="1" minOccurs="0" name="Title" nillable="true" type="xsd:string"/><element maxOccurs=&quo...

.NET web services Vs Java Web Services
Hello, does anyone know of a book or good source of information that compares .NET and Java Web Services? (I would like soemthing neutral if possible). I am thinking of approaching this subject for my dissertation? Many Thanks Rob Hi Rob, Last year I had to give a powepoint presentation on Web Services. I noticed some good books at barnes and noble that discussed the subject. These books were specific to Java and discussed Web Services in a very clear fashion. They gave some elementary examples that were easy to understand. I have not yet had the pleasure of creatin .NET Web Servi...

SOAP Web Service Problem (problema con un web service)
Please help, I can't read a webservice method (webmethod) from asmx web service, with Delphi firemonkey, In my first try I put a WDSL Importer, and I can retrive data from simplex type (string, booleans, integers) but when the method returns a DataSet, i loose my way. Por favor, ayuda, no puedo leer datos de un web service si el metodo que regresa es un DataSet, el web service esta hecho en dot.net así que es un asmx, utilizando el WDSL importes, traje datos sencillos como enteros, boleanos y otros, pero en el caso de arreglos como un DataSet no lo he conseguido, estoy perdido, y l...

what are web services and what are the advantages of web services?
 Hello  i am new to this .net stuff and i was ask on the job interview what a web services is?and if i did not know given that i had a project ( as a project manager,  or a web developer)   what  is it? how do i start a >NET project on it? what are the main advantages is?  HOW DO I START THIS IN THE INTERVIEW>  and what basic books do i buy?   Hi There, There plenty of source on the net about webservice Definiton: http://en.wikipedia.org/wiki/Web_service http://www.codeproject.com/Purgatory/Defining_Web_Services.asp...

Calling a Web Service from a Web Service
Hello,I was looking for some feedback on calling a web service from within a web service. I've heard that it's not good practice (or not possible). I have a scenario where I think it might make some sense.Within our infrastructure, we've created a web service that handles incoming updates on the statuses of all processes. This has proven to be a good thing since it allows applications to communicate across server to make status updates. It's also used by third party developers and applications to communicate with our infrastructure.Along these lines ... we are planning to create a new compon...

Is web services a part of web Service?
  I have a question: Is web services a part of web server?? And when the client calls web service, it means that client calls web server?? Or is it a different entity in itself which communicates separately both with client and server and acts as middleware application.. I am very confused.. Can someone explain me the architecture...??? Thanks..Dont forget to click "Mark as Answer" on the post that helped you.This credits the member,earns you a point & marks your thread as Resolved so that new users will know where to search for their queries. When you build and dep...

Web Site Project: How to configure web service URL in web.config (web service defined in a referenced DLL)
I have a web site that references a business logic DLL project. In the business logic project, there is a web service defined in its app.config file something like this: <applicationSettings>  <MyNamespace.BLL.Properties.Settings>    <setting name="MyNamespace_BLL_MyServer_ServiceName" serializeAs="String">    <value>http://blah.blah.blah.asmx</value>  </setting>  </MyNamespace.BLL.Properties.Settings></applicationSettings> When the web site is published, the web ...

create valid xml to send to web service based on the schema provided by web service
Problem: I have a web page which is being populated from a dataset containing multiple tables.  I now need to call a web service and send the majority of this data to be incorporate into a mainframe system.  I have been supplied with the schema that the web service will be using to validate the data.  I am new to web services and I am not sure how to take my existing dataset and transform it into an xml document that matches the schema I was provided with. There is a main schema with an element which is a custom complex type.  This custom type consists of an element whi...

Best Practice for .Net Web Service access to a Web Service on a Test and Production Servers
Hello All, What is the best way to control a .Net web service to be able to access a remote server for testing and then point to another remote server to access the web service in production? Do I need to generate and maintain 2 different proxy objects? TIA, Bob Bob // first create the proxy if not isvalid( i_service) then i_service = create fundtraderproxy_TradeServicesClient_BasicHttpBinding_ITradeServices end if ///You'll see code something like this in the constructor of your proxy //dynamically set the endpoint url with the user supplied value - //r...

Asasp.net web service and xml problem
Hi all ,Im using ,net framework 2.0This is the web service I wrote by request of AS developer (Action script) but when he consume the service  he got the result like this .. <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">   <soap:Body>     <GetTransportDetailsResponse xmlns="http://tempuri.org/">       <GetTransportDetailsResult>&lt;TransportMethods&a...

What action by a web service requires an app to update their web reference to a Web Service
I create a web reference to a web service in my aspx web application which returns an XML object. If the owner of the web service makes a change to their object am I required to do an update web reference? What if I dont use the information from the new object? thanks Larry You should make the change only if the contract b/w the two has changed (e.g. parameters, return values), etc.-Mathew Nolton Website=www.cybral.com Email=mnolton@cybral.com Blog=weblogs.asp.net/mnolton If the web service now returns a new element and my class reference doesn't match their new class ref...

New to web services, why does PB10 web service proxy wizard say there are no services?
here... http://webservices.amazon.com/AWSECommerceService/205-10-05/AWSECommerceService.wsdl oops typo... still doesn't show any services though... http://webservices.amazon.com/AWSECommerceService/2005-10-05/AWSECommerceService.wsdl "Chance" <chance@booklog.com> wrote in message news:43b44cb3$1@forums-1-dub... > here... > > http://webservices.amazon.com/AWSECommerceService/205-10-05/AWSECommerceService.wsdl > Upgraded to 10.2x and now seems to be working...at least it created the proxy. "Chance" <chance@booklog.co...

Web resources about - Problems exposing COM through Web Service - asp.net.xml-web-services

Is–ought problem - Wikipedia, the free encyclopedia
The is–ought problem in meta-ethics as articulated by Scottish philosopher and historian David Hume (1711–76) is that many writers make claims ...

Refugee crisis: Germany has a problem
GERMANY is a country on edge.

Asylum seekers: The ‘Pacific solution’ seeds local problems
In its desperation to stop asylum seekers, Australia has deserted the goal of promoting good governance in two of its closest neighbours.

A truly Canadian problem: Who do I complain to about Netflix?
The CRTC is promising some new code of conduct for the broad TV industry, including possibly video streaming, this year. But having already blinked ...

Review: Battery life and keyboard problems hinder HP Envy 13 Ultrabook
Andrew Cunningham HP's Envy 13 Ultrabook. 11 more images in gallery The Asus Zenbook UX305C and Dell XPS 13 are two of our favorite thin-and-light ...

First admitting there is a problem by @BloggersRUs
First admitting there is a problem by Tom Sullivan Nancy LeTourneau at Political Animal wrote yesterday about the crisis of confidence in the ...

Larwyn’s Linx: America Doesn't Have a Gun Problem, It Has a Democrat Problem
Send us tips ! Bloggers: install a Larwyn's Linx widget . Get real-time news, 24/7, at BadBlue . Nation America Doesn't Have a Gun Problem, ...

Denmark "Temporarily" Tightens Border Controls; Trains Cancelled; Cascade of Border Controls Grows; Understanding ...
... to restrict pedestrian access to trains and buses. Swedish train operator SJ has suspended services to Denmark until it can iron out such problems. ...

December 2015: Unofficial Problem Bank list declines to 250 Institutions, Q4 2015 Transition Matrix
This is an unofficial list of Problem Banks compiled only from public sources. Here is the unofficial problem bank list for December 2015. Changes ...

Hawaii's homeless problem reaches crisis level
There are now more than 7,000 homeless people in Hawaii the highest per capita rate in the nation

Resources last updated: 1/5/2016 10:42:37 PM