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 / May 2006

Tip: Looking for answers? Try searching our database.

Authenticate SOAP Message only no GET OR POST

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bhu - 26 May 2006 01:24 GMT
Hi
i need to write a webservice which will accept only soap message NO POST or
GET.
i can see this in WSE using RequestSoapContext.Current  but we don;t want to
use WSE,  is there way ?
Can any one post some link samples for this.

ALSO  i see this type of message on some of the services
SOAP RPC Router
Sorry, I don't speak via HTTP GET- you have to use HTTP POST to talk to me.

How to do this?

thanks
bhu
Gaurav Vaish (EduJini.IN) - 26 May 2006 03:54 GMT
> i need to write a webservice which will accept only soap message NO POST
> or
[quoted text clipped - 3 lines]
> use WSE,  is there way ?
> Can any one post some link samples for this.

Write an IHttpModule that will block all unwanted requests.

Signature

Happy Hacking,
Gaurav Vaish
http://www.mastergaurav.org
http://www.edujini.in
-------------------

Fabio - 26 May 2006 16:39 GMT
Hu Bhu,

ASP.NET generates information for HTTP GET and HTTP POST bindings unless it
is told not to. You can remove these bindings by editing the web.config file
and adding the following lines inside the /configuration/system.web element.

<webServices>
  <protocols>
     <remove name="HttpGet" />
     <remove name="HttpPost" />
  </protocols>
</webServices>

--
Fabio Scagliola
http://fabioscagliola.com

Gaurav Vaish (EduJini.IN) - 27 May 2006 14:58 GMT
Just wondering... if the HTTPPost from the WebService is removed, how will
it receive the SOAP-Requests?

or am I confused with something else?

Signature

Happy Hacking,
Gaurav Vaish
http://www.mastergaurav.org
http://www.edujini.in
-------------------

> Hu Bhu,
>
[quoted text clipped - 15 lines]
> Fabio Scagliola
> http://fabioscagliola.com
Fabio - 27 May 2006 15:30 GMT
> Just wondering... if the HTTPPost from the WebService is removed, how will
> it receive the SOAP-Requests?

That will not prevent the web service to receive HTTP POST messages. SOAP
messages are HTTP POST messages indeed, but the content is different. See
samples below.

The following is a sample SOAP 1.1 request.

Message header:

POST /WebSite/AboutMe.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: ...
SOAPAction: "http://fabioscagliola.com/webservices/GetMyFavoriteBook"

Message body:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 <soap:Body>
   <GetMyFavoriteBook xmlns="http://fabioscagliola.com/webservices/" />
 </soap:Body>
</soap:Envelope>

The following is a sample HTTP POST request.

Message header:

POST /WebSite/AboutMe.asmx/GetMyFavoriteBook HTTP/1.1
Host: localhost
Content-Type: application/x-www-form-urlencoded
Content-Length: ...

Message body:

EMPTY

--
Fabio Scagliola
http://fabioscagliola.com

Gaurav Vaish (EduJini.IN) - 27 May 2006 19:29 GMT
>> Just wondering... if the HTTPPost from the WebService is removed, how
>> will
[quoted text clipped - 3 lines]
> messages are HTTP POST messages indeed, but the content is different. See
> samples below.

Hmmm.... got it now. Thanks, Fabio.

But I think HttpPostLocalhost should be remove and not HttpPost... not sure.
Actually, I just looked into WebServiceProtocols enum and then back into
WebServicesSection... and found the following protocols:

1. Documentation
2. HttpPostLocation
3. HttpSoap (v1.1)
4. HttpSoap12 (v1.2)

To test, just do
   System.Configuration.ConfigurationManager.GetSection("system.web/webServices")
and get the Protocols property of the WebServicesSection that you get.

Signature

Happy Hacking,
Gaurav Vaish
http://www.mastergaurav.org
http://www.edujini.in
-------------------


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.