Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Calling WebService from Aspx


Message #1 by "Uma M" <maheswarim@c...> on Tue, 20 Mar 2001 18:00:35 +0530

hi,



I am trying to call a Web Service developed from

Soap Toolkit 2.0(Beta)(whose Service Description

will be in WSDL 1.0 format) from a .Net Application

(Aspx page).  At first I tried calling that Web Service

from VBScript client, in which case it works fine.

From Aspx, I followed the same way, but I am not

able to successfully compile that code.



if anyone have tried this before,

please go through the following code and help

me to locate where I went wrong.



Thank You

Regards,



Uma





Here is a detailed view of my problem:



I referred the MSSOAPLib, MSXML3 and Microsoft Active Server Pages Object

(COM dll's)

in my .Net project. Here is the code I tried to call the Web Service:



1	protected void ConnectToService_Click(object sender,EventArgs e)

2	{

3		MSSOAPLib.SoapSerializer Serializer = new MSSOAPLib.SoapSerializer();

4		MSSOAPLib.SoapReader Reader = new MSSOAPLib.SoapReader();

5		MSXML2.IXMLDOMElement ResultElm,FaultElm;

6		MSSOAPLib.SoapConnector Connector;



7		Connector = new MSSOAPLib.HttpConnector();

8		Connector.Property("EndPointURL")

				"http://muma:8080/MyServer/Soap/DocSample2/DocSample2.asp";

9		Connector.Connect(null);

10		Connector.Property("SoapAction") = "uri:" + "Add";

11		Connector.BeginMessage(null);

12		Serializer.Init(Connector.InputStream);

13		Serializer.startEnvelope("","","");

14		Serializer.startBody("");

15		Serializer.startElement



("Add","http://muma:8080/MyServer/Soap/DocSample2/DocSample2.asp","","m");

16		Serializer.startElement("A","","","");

17		Serializer.writeString("10");

18		Serializer.endElement();

19		Serializer.startElement ("B","","","");

20		Serializer.writeString("20");

21		Serializer.endElement();

22		Serializer.endElement();

23		Serializer.endBody();

24		Serializer.endEnvelope();



25          Connector.EndMessage();



26		Reader = new MSSOAPLib.SoapReader();

27		Reader.Load(Connector.OutputStream,"");



28		if (Reader.Fault == null)

29		{

30			Result.Text = Reader.faultstring.text;

31		}

32		else

33		{

34			Result.Text = Reader.RPCResult.text;

35		}

36	}



When I compile this code, these are the errors I get,

----------------------------------------------------------------------------

--------------------

Line 7: Cannot implicitly convert type 'MSSOAPLib.HttpConnector' to

MSSOAPLib.SoapConnector'



Line 8:



 Property or indexer 'Property' is not supported by the language; try

directly calling accessor  methods

'MSSOAPLib.SoapConnector.get_Property(string)' or

'MSSOAPLib.SoapConnector.set_Property(string, object)'



Line 9:



Property or indexer 'Property' is not supported by the language; try

directly calling accessor methods

'MSSOAPLib.SoapConnector.get_Property(string)' or

'MSSOAPLib.SoapConnector.set_Property(string, object)'

----------------------------------------------------------------------------

--------------------















Message #2 by "dave" <support@1...> on Tue, 20 Mar 2001 07:35:52 -0600
Hi Uma,

Unfortunately WSDL is not supported by the current beta version of ASP.NET.

It is suppose to be supported in Beta2.



Cheers!

dave

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

http://www.123aspx.com

The Largest ASP.NET Directory!

Find the latest ASP.NET resources --

Subscribe to our newsletter!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

----- Original Message -----

From: "Uma M" <maheswarim@c...>

To: "ASP+" <aspx@p...>

Sent: Tuesday, March 20, 2001 6:30 AM

Subject: [aspx] Calling WebService from Aspx





>

> hi,

>

> I am trying to call a Web Service developed from

> Soap Toolkit 2.0(Beta)(whose Service Description

> will be in WSDL 1.0 format) from a .Net Application

> (Aspx page).  At first I tried calling that Web Service

> from VBScript client, in which case it works fine.

> >From Aspx, I followed the same way, but I am not

> able to successfully compile that code.

>

> if anyone have tried this before,

> please go through the following code and help

> me to locate where I went wrong.

>

> Thank You

> Regards,

>

> Uma

>

>

> Here is a detailed view of my problem:

>

> I referred the MSSOAPLib, MSXML3 and Microsoft Active Server Pages Object

> (COM dll's)

> in my .Net project. Here is the code I tried to call the Web Service:

>

> 1 protected void ConnectToService_Click(object sender,EventArgs e)

> 2 {

> 3 MSSOAPLib.SoapSerializer Serializer = new MSSOAPLib.SoapSerializer();

> 4 MSSOAPLib.SoapReader Reader = new MSSOAPLib.SoapReader();

> 5 MSXML2.IXMLDOMElement ResultElm,FaultElm;

> 6 MSSOAPLib.SoapConnector Connector;

>

> 7 Connector = new MSSOAPLib.HttpConnector();

> 8 Connector.Property("EndPointURL")

> "http://muma:8080/MyServer/Soap/DocSample2/DocSample2.asp";

> 9 Connector.Connect(null);

> 10 Connector.Property("SoapAction") = "uri:" + "Add";

> 11 Connector.BeginMessage(null);

> 12 Serializer.Init(Connector.InputStream);

> 13 Serializer.startEnvelope("","","");

> 14 Serializer.startBody("");

> 15 Serializer.startElement

>

> ("Add","http://muma:8080/MyServer/Soap/DocSample2/DocSample2.asp","","m");

> 16 Serializer.startElement("A","","","");

> 17 Serializer.writeString("10");

> 18 Serializer.endElement();

> 19 Serializer.startElement ("B","","","");

> 20 Serializer.writeString("20");

> 21 Serializer.endElement();

> 22 Serializer.endElement();

> 23 Serializer.endBody();

> 24 Serializer.endEnvelope();

>

> 25          Connector.EndMessage();

>

> 26 Reader = new MSSOAPLib.SoapReader();

> 27 Reader.Load(Connector.OutputStream,"");

>

> 28 if (Reader.Fault == null)

> 29 {

> 30 Result.Text = Reader.faultstring.text;

> 31 }

> 32 else

> 33 {

> 34 Result.Text = Reader.RPCResult.text;

> 35 }

> 36 }

>

> When I compile this code, these are the errors I get,

> --------------------------------------------------------------------------

--

> --------------------

> Line 7: Cannot implicitly convert type 'MSSOAPLib.HttpConnector' to

> MSSOAPLib.SoapConnector'

>

> Line 8:

>

>  Property or indexer 'Property' is not supported by the language; try

> directly calling accessor  methods

> 'MSSOAPLib.SoapConnector.get_Property(string)' or

> 'MSSOAPLib.SoapConnector.set_Property(string, object)'

>

> Line 9:

>

> Property or indexer 'Property' is not supported by the language; try

> directly calling accessor methods

> 'MSSOAPLib.SoapConnector.get_Property(string)' or

> 'MSSOAPLib.SoapConnector.set_Property(string, object)'

> --------------------------------------------------------------------------

--

> --------------------

>

>

>

>

>

>

>

>

> ---

> SoftArtisans helps developers build robust, scalable Web applications!

> Excel Web reports, charts: http://www.softartisans.com/excelwriter.html

> File uploads: http://www.softartisans.com/saf.html

> Transactional file management: http://www.softartisans.com/saf1.html

> Scalability: http://www.softartisans.com/saxsession.html

> ASPstudio value pack: http://www.softartisans.com/aspstudiosuite.html




>

>




  Return to Index