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 / December 2004

Tip: Looking for answers? Try searching our database.

WebService, Soap, and Firewall

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Q. John Chen - 27 Oct 2004 06:44 GMT
All,

I have a WebService created in .NET.
I have VB6 Client consume the WebService (using Soap ToolKit 3.0)

But I have couple user who got error accessing the WebServer with
error message "Unable to handle request without a valid parameter ..."
After hours of research, my conclusion is that the firewall treat
"SOAPAction" as unknow header and blocked it.

So, I am thinking do away with the SOAP and use HTTP POST. Here are
some questions:

1. Can I still use the Web Reference and somewhere set a property
using HTTP POST other than SOAP? I don't think so. The way I figured
is to use HttpWebRequest/Response to get the response back in XML
format and then parse out the result.

2. The WebMethods I created using reference data type so it will
return multiple value with one single call. Can do the same with HTTP
POST? And How?

TIA.

John
Sami Vaaraniemi - 27 Oct 2004 09:09 GMT
I'm not sure if this solves your problem, but I think it's worth trying. You
can tell the Web Service to not require a SOAPAction header, and instead
route the message to the correct web method based on the request element
within the Soap body. You do this by attaching
[SoapDocumentService(RoutingStyle=SoapServiceRoutingStyle.RequestElement)]
attribute to the web service (see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwebsrv/html/h
owwebmeth.asp
).

Regards,
Sami

> All,
>
[quoted text clipped - 21 lines]
>
> John
Q. John Chen - 01 Nov 2004 22:34 GMT
All,

Thanks for Sami's suggestion.

I impplemented what Sami suggested. But it still does NOT solve my
problem. The generated WSDL (I post it here for reference) shows that
the action is empty string. So, for me, it may not be the problem with
the SoapAction heading issue.

<wsdl:binding name="MySvcSoap" type="tns:MySvcSoap">
   <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
                 style="document" />
   <wsdl:operation name="GetMethod">
       <soap:operation soapAction="" style="document" />
       <wsdl:input>
           <soap:body use="literal" />
       </wsdl:input>
       <wsdl:output>
           <soap:body use="literal" />
       </wsdl:output>
    </wsdl:operation>
</wsdl:binding>

So any other clue with the error message I got? (See my first post for
the error message)?

Thanks

John
Dan Rogers - 03 Dec 2004 23:12 GMT
Hi John,

I'm afraid that if your company's firewall is blocking SOAP requests (many
firewalls can do this at the administrators option) then you are stuck.  It
IS possible to call a SOAP method with an HTTP Get - and this might be your
only option.

Firewalls that block SOAP requests often do so by looking for the
SOAPAction HTTP header.  Since valid SOAP implementations require this
header to be standard compliant, I cannot advise you to build your own
Soap-Like packet handlers.  I could not guarantee that other issues
wouldn't arise.

I think the most expedient thing is to talk to your firewall
administrators, explain the business need, get the right business sponsors,
and have them open an exception for your messages.

I hope this helps

Dan Rogers
Microsoft Corporation
--------------------
From: qjchen@email.com (Q. John Chen)
Newsgroups: microsoft.public.dotnet.framework.webservices
Subject: Re: WebService, Soap, and Firewall
Date: 1 Nov 2004 13:34:54 -0800
Organization: http://groups.google.com
Lines: 30
Message-ID: <98456896.0411011334.1ae3678e@posting.google.com>
References: <98456896.0410262144.167eea50@posting.google.com>
<#bpQau$uEHA.3828@TK2MSFTNGP12.phx.gbl>
NNTP-Posting-Host: 152.140.119.126
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1099344895 32192 127.0.0.1 (1 Nov 2004 21:34:55
GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 1 Nov 2004 21:34:55 +0000 (UTC)
Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFTNGP08.phx.gbl!news-out.cwi
x.com!newsfeed.cwix.com!newsfeed.icl.net!proxad.net!postnews2.google.com!pos
tnews1.google.com!not-for-mail
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:7200
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

All,

Thanks for Sami's suggestion.

I impplemented what Sami suggested. But it still does NOT solve my
problem. The generated WSDL (I post it here for reference) shows that
the action is empty string. So, for me, it may not be the problem with
the SoapAction heading issue.

<wsdl:binding name="MySvcSoap" type="tns:MySvcSoap">
   <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
                 style="document" />
   <wsdl:operation name="GetMethod">
       <soap:operation soapAction="" style="document" />
       <wsdl:input>
           <soap:body use="literal" />
       </wsdl:input>
       <wsdl:output>
           <soap:body use="literal" />
       </wsdl:output>
    </wsdl:operation>
</wsdl:binding>

So any other clue with the error message I got? (See my first post for
the error message)?

Thanks

John
qjchen@email.com - 09 Dec 2004 06:44 GMT
Dan,

The application is distributed to UNKNOWN users. I have no choice but
to write my own "SOAP" - Custom HTTP handler on the server with XMLHTTP
(VB6) for the client.

So far so good since my "SOAP" implementation. I even replaced FTP with
this method (one user's company does NOT allow FTP.)
Thanks for your suggestion though. I learned more.

John
qjchen@email.com - 09 Dec 2004 07:00 GMT
Dan,

The application is distributed to UNKNOWN users. I have no choice but
to write my own "SOAP" - Custom HTTP handler on the server with XMLHTTP
(VB6) for the client.

So far so good since my "SOAP" implementation. I even replaced FTP with
this method (one user's company does NOT allow FTP.)
Thanks for your suggestion though. I learned more.

John
Q. John Chen - 11 Nov 2004 05:44 GMT
I am back working on this issue. Someone give a suggestion and I think
it will work. Here is the idea:
  Use WS-Addressing on server side (WS-Routing is also OK but WSE2.0
basically replaced it with WS-Addressing).
  One option on the client side is to using .NET make SoapClient then
COM interop with VB client. But we don't distribute .NET runtime. So I
am going to use  XmlHTTP simulate request .NET SoapClient sent to the
the server.

But I have some details that need to be addressed:

In the SoapEnvelope sent to the server. Are all the SoapHeaders
required?:
  <wsa:Action>  -- This is must for sure
  <wsa:To> - I thinks so. Can be
"http://mycompany.com/myservices/oneservice.ashx"

  <wsa:MessageID>  ???   <wsa:ReplyTo> ??? and timestampe, etc, etc.

> I'm not sure if this solves your problem, but I think it's worth trying. You
> can tell the Web Service to not require a SOAPAction header, and instead
[quoted text clipped - 32 lines]
> >
> > John
Q. John Chen - 20 Nov 2004 06:00 GMT
Tried everything with the Soap (WS-Routing, WS-Addressing). Nothing
works. It seems that the framework is using "SoapAction" to determine
if the request is a soap request or dispatch to the correct method.

So, I have to write my "own" SOAP. it is pretty simple. Create
Customer HttpHandler for each request and return text/xml. On client
side, I use XMLHTTP as suggest by an expert on soap to send request.

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.