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 / ASP.NET / Web Services / November 2005

Tip: Looking for answers? Try searching our database.

SoapReceivers.Add

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Glover - 18 Nov 2005 18:27 GMT
I think I've been asking the wrong questions.

I have an instance of a WSE 3.0 SoapService derived class, and I want to add
it to the SoapReceivers collection so that it will receive requests.

However, when I make the call as SoapReceivers.Add(Uri, Object) where the
Uri is http, I get the message “WSE802: Unsupported SoapChannelCapabilities
Flags.”  Trying different ports don't produce different results.

Out of desperation I tried SoapReceivers.Add(Uri, Object, true).  This code
produced the error message “WSE2129: Can only request a response input
channel.”

I have absolutely no problem making the call for soap.tcp or soap.inproc
Uris.  This makes me think that http is unsupported or that I need to do
something special when I use http, but I can't find documentation of that
anywhere.

I've tinkered with my app.config file a bit, but haven't found a solution
that works.  

I've also gone off on several tangents as I became more and more desperate,
but I'm convinced that none of these were the right direction.  

Surely somebody else must have faced this problem by now?

Thanks,
John Glover
Kevin Yu [MSFT] - 19 Nov 2005 06:02 GMT
Hi John,

We have reviewed this issue and are currently researching on it. We will
update you ASAP. Thanks for your patience!

Kevin Yu
Signature

=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Steven Cheng[MSFT] - 19 Nov 2005 15:48 GMT
Hi John,

As for this WSE802 error, it indicates that the certain protocol schema we
specified in the Service's EndPointReference address is not support by the
current hosting enviornemnt( appdomain...). Actually as for WSE SoapService
over http protocol, we must host it in ASP.NET web application (deploy in
IIS or through the VS.NET 2005's test server when developing ...). Normal
application domain (console or winform) doesn't contain such a HTTP channel
for processing http request so that it throws this exception...  For
registering and hosting SoapService over HTTP protocol in ASP.NET host
environment, you can refer to the "HttpSyncStockService" example in the
WSE3.0 sample....

Thanks,

Steven Cheng
Microsoft Online Support

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
Thread-Topic: SoapReceivers.Add
thread-index: AcXsba5BOzxrvWsmQJOfZkjpnDQLUg==
X-WBNR-Posting-Host: 157.254.98.204
From: "=?Utf-8?B?Sm9obiBHbG92ZXI=?=" <john.glover@newsgroups.nospam>
Subject: SoapReceivers.Add
Date: Fri, 18 Nov 2005 10:27:06 -0800
Lines: 28
Message-ID: <5A8F3F6F-5CA3-4C79-8C27-1B054F8C9E63@microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
    charset="Utf-8"
Content-Transfer-Encoding: 8bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices.enhancements
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.webservices.enhancements:7669
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices.enhancements

I think I've been asking the wrong questions.

I have an instance of a WSE 3.0 SoapService derived class, and I want to
add
it to the SoapReceivers collection so that it will receive requests.

However, when I make the call as SoapReceivers.Add(Uri, Object) where the
Uri is http, I get the message “WSE802: Unsupported
SoapChannelCapabilities
Flags.� Trying different ports don't produce different results.

Out of desperation I tried SoapReceivers.Add(Uri, Object, true).  This code
produced the error message “WSE2129: Can only request a response input
channel.�

I have absolutely no problem making the call for soap.tcp or soap.inproc
Uris.  This makes me think that http is unsupported or that I need to do
something special when I use http, but I can't find documentation of that
anywhere.

I've tinkered with my app.config file a bit, but haven't found a solution
that works.  

I've also gone off on several tangents as I became more and more desperate,
but I'm convinced that none of these were the right direction.  

Surely somebody else must have faced this problem by now?

Thanks,
John Glover
John Glover - 21 Nov 2005 22:44 GMT
Steven,

Thanks for your response.

I have no problem hosting the service in IIS, I've reviewed the example you
referenced as well as the other examples that ship with the WSE 3.0 bits.  I
was trying to avoid having to instantiate a new object every time my service
gets called.  I would like to instantiate the object once, either on the
first call to it or by starting it up manually, and then use it every time
the service is called until I turn it off.  

Is there an easy way to do this with an asmx web service?  I would
appreciate any resources you can point me to that might get me started.

In some of our existing code we have a service running which maintains the
state, and when a web service is called it runs some code to determine where
the service is living and then uses the service.  I would like to avoid this
kind of look-up if possible.

Thanks,
John Glover

> Hi John,
>
[quoted text clipped - 13 lines]
> Steven Cheng
> Microsoft Online Support
Steven Cheng[MSFT] - 23 Nov 2005 07:38 GMT
Hi John,

Thanks for your  response.
Regarding on your further question about
=============
I was trying to avoid having to instantiate a new object every time my
service
gets called.  I would like to instantiate the object once, either on the
first call to it or by starting it up manually, and then use it every time
the service is called until I turn it off.  
=============

I'm afraid this is not configureable in ASP.NET asmx webservice model. I
think what you want is something like the Singletom object in .net
remoting....   However, as for ASP.NET webservice, it is following the same
request/response model as asp.net web page, when a request arrive the
server , the ASP.NET runtime will pick up a worker thread and intialize a
PageHanlder or webservice handler to process this request, so our
webservcie object is created and process the request. After that the object
is disposed....   We're not able to explicitly create the webService
service class instance to service client request... ..  If there're some
states info we need to share between mutiple webservice method call... we
may need to create a custom storage to maintain them (e.g using a static
state collection.... in service class). This is also somewhat due to the
XML webservcie's stateless and not object oriented...

Thanks,

Steven Cheng
Microsoft Online Support

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
Thread-Topic: SoapReceivers.Add
thread-index: AcXu7RNUFp1BIb+BSTaF75ij9sY9bw==
X-WBNR-Posting-Host: 157.254.98.204
From: "=?Utf-8?B?Sm9obiBHbG92ZXI=?=" <john.glover@newsgroups.nospam>
References:  <5A8F3F6F-5CA3-4C79-8C27-1B054F8C9E63@microsoft.com>
<$aj6qCS7FHA.1236@TK2MSFTNGXA02.phx.gbl>
Subject: RE: SoapReceivers.Add
Date: Mon, 21 Nov 2005 14:44:04 -0800
Lines: 43
Message-ID: <AAF03AC6-54CB-4F28-AD25-F6DF879EA293@microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
    charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices.enhancements
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.webservices.enhancements:7690
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices.enhancements

Steven,

Thanks for your response.

I have no problem hosting the service in IIS, I've reviewed the example you
referenced as well as the other examples that ship with the WSE 3.0 bits.  
I
was trying to avoid having to instantiate a new object every time my
service
gets called.  I would like to instantiate the object once, either on the
first call to it or by starting it up manually, and then use it every time
the service is called until I turn it off.  

Is there an easy way to do this with an asmx web service?  I would
appreciate any resources you can point me to that might get me started.

In some of our existing code we have a service running which maintains the
state, and when a web service is called it runs some code to determine
where
the service is living and then uses the service.  I would like to avoid
this
kind of look-up if possible.

Thanks,
John Glover

"Steven Cheng[MSFT]" wrote:

> Hi John,
>
[quoted text clipped - 13 lines]
> Steven Cheng
> Microsoft Online Support
Roman Kiss [MVP] - 20 Nov 2005 03:27 GMT
Hi John,

have a look at this link:
http://pluralsight.com/blogs/aaron/archive/2005/10/14/15571.aspx

hth

Roman

>I think I've been asking the wrong questions.
>
[quoted text clipped - 28 lines]
> Thanks,
> John Glover
John Glover - 21 Nov 2005 22:34 GMT
Roman,

I appreciate your response.  I've seen the code you're referencing here, but
it only gets me part way to the answer I'm looking for.

I hate to admit that I don't know what I'm doing, but I don't.  I'm fairly
new to .NET and I don't have a full grasp of the available APIs.  

So, using Aaron's code, I can receive messages with no problem.  When I try
to initiate messages this call fails in Aaron's code:

HttpListenerContext context =
message.Context.SessionState.Get<HttpListenerContext>("HttpSysAdapter");

I believe it fails because Aaron has only accounted for responding to
requests, and when an instance of his HttpSysOutputChannel tries to send a
request, it expects to be sending a response to a query -- meaning there is
already an existing Session from which to pull session state.  Then he simply
writes to the OutputStream made available in the Response which is just
waiting to go back to the client that sent the request.

I've tried to fill in the gaps to make the code work for me, but I'm a
little lacking in this area.  I tried to send a request (if the previous code
resulted in a null) using this code:

               HttpWebRequest request = System.Net.WebRequest.Create (
message.Context.Addressing.To.Value ) as HttpWebRequest;
               request.ContentType = "text/xml";
               request.Method = "POST";
               request.ContentLength = message.InnerXml.Length;

               using ( XmlTextWriter tw = new XmlTextWriter (
request.GetRequestStream ( ), System.Text.Encoding.UTF8 ) ) {
                   message.WriteTo ( tw );
               }

               WebResponse response = request.GetResponse ( );
               response.Close ( );

But this failed to produce anything meaningful to me.

Thanks,
John Glover

> Hi John,
>
[quoted text clipped - 4 lines]
>
> Roman

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.