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 / February 2007

Tip: Looking for answers? Try searching our database.

Http Post Web Service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
phenglai - 26 Feb 2007 23:31 GMT
I am not sure really how to explain this but here goes.

I am creating some new web services and I want to be able to post data like
the following:

<Data>
  <some value>1</some value>
  <more info>2</more info>
</Data>

I have the object built and I can call the web service but all I get in
return is "ERROR". My webservice looks like this:

   [WebMethod]
   public string GeneratePDFBOL(BillInfo bi)
   {
       try
       {
           return bi.BillNumber;
       }
       catch(Exception e)
       {
           return e.Message;
       }
   }

If I take out the BillInfo and add a string value in there, I can post data
but when I try to pass complex data, it does not work.I have searched all
over and I can not find anything on how to do this. It seems to work for Soap
but I want to have unified calls for both SOAP and HTTP-POST.

Can someone point me in the right direction?

Jerel
Manish Bafna - 27 Feb 2007 04:55 GMT
Hi,
As per my uderstanding HTTP-GET or HTTP-POST supports only native data
types(primitive data types).Only SOAP allows the client to pass objects as
parameters.

However, SOAP toolkits exist for most programming languages, including Java
and COM-based Microsoft programming languages such as Visual C++ and Visual
Basic. You'll almost always use SOAP encoding with your XML Web services, for
the following reasons:
Only SOAP allows the client to pass objects as parameters. In other words,
the current version of the UpdateCustomers method wouldn't work over HTTP GET
or HTTP POST because it requires a CustomerDetails object as a parameter.
SOAP also provides support for ByRef parameters.

SOAP is more standardized. .NET defines its own rules for encoding
information in an HTTP GET or HTTP POST message.

SOAP provides better exception support with .NET clients. If a method called
over HTTP GET or if HTTP POST fails, it just returns an unhelpful HTTP error.
Signature

Thanks and Regards.
Manish Bafna.
MCP and MCTS.

> I am not sure really how to explain this but here goes.
>
[quoted text clipped - 30 lines]
>
> Jerel
Manish Bafna - 27 Feb 2007 05:52 GMT
Hi,
In the previous post i have forgotten to mention that i have taken that info
from sample chapter in the following link:
http://www.microsoft.com/mspress/books/sampchap/6723.aspx
I hope that previous post has answered your question.
Signature

Thanks and Regards.
Manish Bafna.
MCP and MCTS.

> I am not sure really how to explain this but here goes.
>
[quoted text clipped - 30 lines]
>
> Jerel

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.