[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1249
  • Last Modified:

Web Services - Non-Soap and Soap - How?

I have worked with several commercial APIs and WebServices.  Just about all of them are designed for novice programmers to be able to use.  As such, most of the services accept Non-Soap messages, Plain XML, and/or Name Value Pairs.

The following companies I have integrated with recently have Non-Soap services: FedEx (soap and non-soap), Google (plain xml), eBay (plain xml and soap), UPS (plain xml), PayPal (name value pair and plain xml)

I have been studying ASP.NET web services and they are all geared for SOAP.  I want to accept soap, but also want to accept plain XML or name value pairs.

ASP.NET allows you to accept name value pairs in HTTP-POST or HTTP-GET, but if you do that you cannot handle error messages.  ASP.NET web services only handle errors when SOAP is used.   When I use POST with an incorrect parameter I get a big server error.

Another problem I found with ASP.NET web services is that the XML posted must include every parameter or there will be a big old server error.

When I use FedEx and Google I can leave out any optional parameter in my XML.


So here are my questions:
 -  what technology will allow me to create a service like the many Non-Soap commercial services I just described?
 -  Is .NET capable of accepting plain xml and outputing plain xml in a web service?
 -  Is .NET capable of handling error messages that occur globally, such as when you leave out a parameter?

Summary:   I want to build a web service that works like the commerical services I am familiar with.  However, .NET seems very rigid and locked into SOAP protocals.   There does not appear to be a way to handle errors, use plain xml,  or accept conditional xml elements.

Anyone have any advice for me about how to create the type of service I want?
0
o1mattweber
Asked:
o1mattweber
1 Solution
 
apeterCommented:
By default asp.net web services are xml web services. The request and message are sent in xml.

If you want to use SOAP with asp.net web service then you have follow Standards. Like you should have "Envelope" Tag Which will have a body and Optional header.

below are the answers for your questions
-  what technology will allow me to create a service like the many Non-Soap commercial services I just described?
          ASP.NET XML Web Service
 -  Is .NET capable of accepting plain xml and outputing plain xml in a web service?
          Yes
 -  Is .NET capable of handling error messages that occur globally, such as when you leave out a parameter?
     Yes, you can use try Catch Block in client which captures all exceptions raised/thrown from the web service method.    

Below link explains in detail of XML web Servre and using SOAP in xml web service in detail
http://msdn.microsoft.com/en-us/library/7bkzywba(VS.71).aspx
0
 
o1mattweberAuthor Commented:
Hi apeter,

To clarify, when I said "XML" I meant (Plain Old XML).  I have been researching this for hours since I posted and have found ASP.NET Web Services (ASMX) to not accept plain XML.  They only deal with SOAP.  You can do a HTTP-GET or POST and get XML back, but you cannot send plain XML.  

If you know of a way to send plain Non-Soap XML to a .NET web service please let me know.

I did find a solution though.  I started using WCF.   WCF services can use plain XML, JSON, or SOAP.  They also support global error handling, exceptions, faults, and try catch style.  They meet all of my requirements.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now