soap and http post

22 views
Skip to first unread message

Gina_Marano

unread,
Jun 29, 2009, 11:50:17 AM6/29/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
I have a soap page. Is there a way to support HTTP Post (synchronous)
as well.

Other question... Difference between a web server that accepts HTTP
Post and a REST server?

I am all new to ASP.Net so please forgive me.

~Gina_M~

Cerebrus

unread,
Jun 29, 2009, 1:35:28 PM6/29/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
I think we need MUCH more detail... for instance, what is a "SOAP
page" ?

Gina_Marano

unread,
Jun 29, 2009, 2:16:41 PM6/29/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
I have a web service that uses the SOAP protocol and takes in an order
(XML) processes the order and returns the order id (request/response).
I want to be able to support the HTTP Post protocol.

http://en.wikipedia.org/wiki/SOAP

~Gina_M~

Cerebrus

unread,
Jun 30, 2009, 1:34:22 AM6/30/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Thanks for that useful link about SOAP !

You used the term "soap page" which is not equivalent to saying "SOAP
webservice". A webservice is not a page in common parlance .

As to your answer, any .NET webservice allows GET and POST requests.
If you browse to the asmx file and click any webmethod that uses
parameters, you will find the supported protocols listed. It will also
show you the sample request that must be sent as well as the
parameters and content-type expected. For instance, HTTP Post would
require a content-type of "application/x-www-form-urlencoded" (as
usual). That is what you must replicate.

You can use the HttpWebRequest class or (possibly, but I'm not sure)
the WebClient class to send an HTTP POST request.
> > > ~Gina_M~- Hide quoted text -
>
> - Show quoted text -

NaeiKinDus

unread,
Jun 30, 2009, 4:06:28 AM6/30/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
A REST server allows HTTP POST aswell.
The question should be : "What is the difference between a SOAP server
and a REST server". Which is basically, if I'm not wrong, the way
requests are handled (I believe SOAP is an RPC server). A RESTful
server handles requests using the CRUD scheme (Create, Read, Update,
Delete).
Create: POST
Read: GET
Update: PUT
Delete: DELETE

Gina_Marano

unread,
Jun 30, 2009, 2:16:09 PM6/30/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Sorry Cerebrus,

I missed your post. Sorry for my mis-speak. I spend way to much time
programming and not enough time learning the normenclature.

I will look in to what you posted.

Thanks

~Gina_M~
(when do I get off of my posts being moderated so I can get quicker
responses)
> > - Show quoted text -- Hide quoted text -

Gina_Marano

unread,
Jun 30, 2009, 1:56:38 PM6/30/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Well it doesn't sound like I need REST.

I need to be able to receive an XML post and return feedback
syncronously.

Am I making this too hard for myself? How do I create a service/page
that receives HTTP Post.

Notes: Visual Studios 2005/ C#

We have a SOAP service currently running. I need to support both (SOAP/
HTTP Post)

Thanks much!

~Gina_M~

Cerebrus

unread,
Jul 1, 2009, 1:44:16 AM7/1/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Gina,

That's alright. But when asking for directions, it helps if you speak
the same language as the natives! ;-)

Many of the webservices I build accept all three kinds of requests
(HTTP GET, POST and SOAP) and I have to do nothing extra other than
adding a webServices section in the web.config with entries enabling
HTTP GET and POST.

The entries look like:

---
<system.web>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
</system.web>
---

Gina_Marano

unread,
Jul 20, 2009, 7:31:09 PM7/20/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Hey Cerebrus,

I added what you stated to the web.config.

Then I use .Net Webservice studio and set the protocol to HTTPPost
and http://localhost/myservice/service.asmx?WSDL

and I get the following error:

Initializing
Generating WSDL
Generating Proxy
System.ArgumentException: Protocol with name 'HttpPost' is not
recognized.
Parameter name: protocolName
at
System.Web.Services.Description.ServiceDescriptionImporter.FindImporterByName
(String protocolName)
at System.Web.Services.Description.ServiceDescriptionImporter.Import
(CodeNamespace codeNamespace, ImportContext importContext, Hashtable
exportContext, StringCollection warnings)
at System.Web.Services.Description.ServiceDescriptionImporter.Import
(CodeNamespace codeNamespace, CodeCompileUnit codeCompileUnit)
at WebServiceStudio.Wsdl.GenerateCode(ServiceDescriptionCollection
sources, XmlSchemas schemas, String uriToWSDL, ICodeGenerator codeGen,
String fileExtension)
at WebServiceStudio.Wsdl.Generate()

A little snipit from my services.cs

[WebMethod]
[SoapHeader("credentials")]
public string SubmitOrder(string orderxmlid, string xmlOrder)
{
SoapEngine se = new SoapEngine(Db.Session,
CustomerGroupID, EmployeeID);
return se.SubmitOrder(orderxmlid, xmlOrder);
}

Snipit from web.config:

<system.web>
...
<sessionState timeout="10" mode="StateServer"
cookieless="UseCookies"/>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
</system.web>
</configuration>

~Gina_M~

Cerebrus

unread,
Jul 21, 2009, 4:34:08 AM7/21/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Gina,

I don't think Webservice Studio supports anything other than SOAP. Why
not use Visual Studio, instead ?

On Jul 21, 4:31 am, Gina_Marano <ginals...@gmail.com> wrote:
> Hey Cerebrus,
>
> I added what you stated to the web.config.
>
> Then  I use .Net Webservice studio and set the protocol to HTTPPost
> andhttp://localhost/myservice/service.asmx?WSDL
>
> and I get the following error:
>
> Initializing
> Generating WSDL
> Generating Proxy
> System.ArgumentException: Protocol with name 'HttpPost' is not
> recognized.
> Parameter name: protocolName
>    at
> System.Web.Services.Description.ServiceDescriptionImporter.FindImporterByNa­me

Gina_Marano

unread,
Jul 21, 2009, 12:04:09 PM7/21/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
ok, will do that today!

~Gina_M~

Gina_Marano

unread,
Jul 21, 2009, 2:06:56 PM7/21/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Hey Cerebrus,

ok, I have a http test app written.

I get:

HTTPPost response error.

"The remote server returned an error: (500) Internal Server Error."
"ProtocolError"

~Gina_M~

Gina_Marano

unread,
Jul 21, 2009, 5:01:41 PM7/21/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
How to determine the request protocol?

The following are the same for both SOAP and HTTPPOST:

((System.Web.Services.WebService)(this)).Context.Request.RequestType =
"POST"
((System.Web.Services.WebService)(this)).Context.Request.HttpMethod =
"POST"

The only difference I can tell so far is:

HTTPPOST:

((System.Web.Services.WebService)(this)).Context.Request.ContentType =
"application/x-www-form-urlencoded"
((System.Web.Services.WebService)(this)).Context.Request.Form.HasKeys
() = true

SOAP:

((System.Web.Services.WebService)(this)).Context.Request.ContentType
="text/xml; charset=utf-8"
((System.Web.Services.WebService)(this)).Context.Request.Form.HasKeys
() = false

Is there a better way?

~Gina_M~

Gina_Marano

unread,
Jul 21, 2009, 3:26:33 PM7/21/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Awesome! Got it. My own credential check was getting in the way. The
actual exception was not being caught correctly.

Is there a way that I can tell which protocol was used? If soap then I
want to use the credentials, if HTTPPost I want to parse the
content....

~Gina_M~

On Jul 21, 9:04 am, Gina_Marano <ginals...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages