Groups | Blog | Home
all groups > dotnet web services enhancements > november 2004 >

dotnet web services enhancements : How create Prosy Class for soap.tcp


MrDotNet
11/17/2004 11:39:14 AM
hi
Here is my Web service and one Soapmethod how can I create proxy class for
that and hows client access that web service. I try generated proxy class but
that give me error.
HELP.....
Public Class WSE2Test
Inherits SoapService
<SoapMethod("CreateDataTable")> Public Function CreateDataTable(ByVal
NCConnection As String, ByVal strSQL As String) As DataSet
Try
'......................
' Here some code fill out dataset
return dataset
Catch ex As Exception
Throw ex
End Try
dbDA = Nothing
dbCmd = Nothing
dbConn = Nothing

End Function

--
-MrDotNet MCAD, MCSD
Sr. Software Engineer / Lead Architect
John Paul. A
11/23/2004 3:33:03 AM
Dear MrDotNet,
Within the SDK, there is a tool called the Web Services Description Language
tool (WSDL.exe). This command-line tool is used to create proxy classes from
WSDL. For example, you could enter:

WSDL http://abc.xyz.com/testpage/HelloWorld/HelloWorld.asmx?WSDL

to create a proxy class called HelloWorld.cs.

Rgds,
John Paul. A


[quoted text, click to view]
MrDotNet
12/1/2004 3:53:01 PM
Hi John,

I Know that I asking about soao.tcp proxy.


[quoted text, click to view]
Drew Marsh
12/1/2004 4:14:17 PM
[quoted text, click to view]

Use WseWsdl2.exe. You'll find the instructions for doing so, right here[1].

HTH,
Drew

[1] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wse/html/gxaconwsdltosoapclienttool.asp
BenW
2/3/2005 11:09:06 AM
Yes I'm tring the same thing and don't seem to be able to get it to work.

Details:

Console application

namespace SoapService1
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
Uri address = new Uri("soap.tcp://" + System.Net.Dns.GetHostName() +
"/MySoapService");
EndpointReference endpoint = new EndpointReference(address);
SoapReceivers.Add(endpoint, typeof(MySoapService));
Console.WriteLine( "Listening for messages at " + address);
Console.ReadLine();
}
}
}
namespace SoapService1
{
/// <summary>
/// Summary description for MySoapService.
/// </summary>
[SoapService("MySoapService")]
public class MySoapService : SoapService
{
public MySoapService() {}


[SoapMethod("GetQuote")]
public string GetQuote(int i, string b)
{
return "xyz";
}
}
}

Started application.

Then ran from the command prompt:

C:\Program Files\Microsoft WSE\v2.0\Tools\Wsdl>wsewsdl2.exe
"soap.tcp://MYMACHINE/MySoapService" c:\myproxy.cs



Output:

Microsoft (R) WSDL to SoapClient Utility
[Microsoft (R) Web Services Enhancements, Version 2.0]
Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.


An error occurred processing this WSDL. More information:
System.Web.Services.Protocols.SoapException: Server unavailable, please try
late
r
at
Microsoft.Web.Services2.Messaging.SoapClient.SendRequestResponse(String me
thodname, SoapEnvelope envelope)
at ClientGen.TcpProxy.RequestDescription(SoapEnvelope message)
at ClientGen.ClientGen.Download(String location)
at ClientGen.ClientGen.GenerateCode(String descriptionFile, String
outputFile
, XmlSchemas schemas)
at ClientGen.Class1.Main(String[] arguments)



[quoted text, click to view]
BenW
2/3/2005 12:57:03 PM
Thanks for the quick reply but I get this:

If I use localhost rather than my "machine name", I get Server unavailable
please try later, where I specify localhost in the URi of the class.

However of I specify the machine name in the URis in my class and call with
localhost in the command line I get "Destination Unreachable". Which a new
one.

The new code is :

Uri addressUri = new Uri("soap://MYMACHINE/MyServiceV1");
Uri viaUri = new Uri("soap.tcp://MYMACHINE/MySoapService");
Microsoft.Web.Services2.Referral.Via via = new
Microsoft.Web.Services2.Referral.Via(viaUri);
Microsoft.Web.Services2.Addressing.Address address = new
Address(addressUri);
EndpointReference endpoint = new EndpointReference(address, via);
SoapReceivers.Add(endpoint, typeof(MySoapService));

BenW

WSE 2 SP2





C:\Program Files\Microsoft WSE\v2.0\Tools\Wsdl>wsewsdl2
soap.tcp://MYMACHINE/MySoa
pService -name soap://MYMACHINE/MyServiceV1 myproxy01.cs
Microsoft (R) WSDL to SoapClient Utility
[Microsoft (R) Web Services Enhancements, Version 2.0]
Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.


An error occurred processing this WSDL. More information:
Microsoft.Web.Services2.AsynchronousOperationException: WSE101: An
asynchronous
operation raised an exception. ---> System.Net.Sockets.SocketException: No
conne
ction could be made because the target machine actively refused it

Server stack trace:
at Microsoft.Web.Services2.Messaging.SoapTcpConnection.Connect()
at Microsoft.Web.Services2.Messaging.SoapTcpConnection..ctor(Uri
remoteEndpoi
nt, SoapTcpTransportOptions options, ISoapFormatter formatter)
at Microsoft.Web.Services2.Messaging.SoapTcpTransport.GetConnection(Uri
desti
nation)
at
Microsoft.Web.Services2.Messaging.SoapTcpOutputChannel.Send(SoapEnvelope m
essage)
at
System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(M
ethodBase mb, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInC
ontext, Object[]& outArgs)
at
System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMe
ssage msg, IMessageSink replySink)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message
reqMsg,
Boolean bProxyCase)
at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed,
Messa
geData& msgData)
at Microsoft.Web.Services2.Messaging.SendDelegate.EndInvoke(IAsyncResult
resu
lt)
at
Microsoft.Web.Services2.Messaging.SoapOutputChannel.EndSend(IAsyncResult r
esult)
at Microsoft.Web.Services2.Messaging.SoapSender.EndSend(IAsyncResult
result)
at
Microsoft.Web.Services2.Messaging.SoapClientAsyncResult.OnSendComplete(IAs
yncResult result)
--- End of inner exception stack trace ---
at Microsoft.Web.Services2.AsyncResult.End(IAsyncResult result)
at
Microsoft.Web.Services2.Messaging.SoapClient.SendRequestResponse(String me
thodname, SoapEnvelope envelope)
at ClientGen.TcpProxy.RequestDescription(SoapEnvelope message)
at ClientGen.ClientGen.Download(String location)
at ClientGen.ClientGen.GenerateCode(String descriptionFile, String
outputFile
, XmlSchemas schemas)
at ClientGen.Class1.Main(String[] arguments)

[quoted text, click to view]
William Stacey [MVP]
2/3/2005 2:46:17 PM
http://spaces.msn.com/members/staceyw/Blog/cns!1pnsZpX0fPvDxLKC6rAAhLsQ!304.entry

--
William Stacey, MVP
http://mvp.support.microsoft.com

[quoted text, click to view]
William Stacey [MVP]
2/3/2005 4:37:33 PM
Use the DNS domain name that will "ping". If your running on the same host,
localhost should work unless something else is going on.

--
William Stacey, MVP
http://mvp.support.microsoft.com

[quoted text, click to view]
BenW
2/4/2005 10:45:03 AM
Tried all options.

I still get the error message below. What else can I try? Anyone else
succeeded?

Thanks.

[quoted text, click to view]
AddThis Social Bookmark Button