473,376 Members | 1,079 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,376 software developers and data experts.

Http Post Web Service

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
Feb 26 '07 #1
2 5413
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.
--
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"phenglai" wrote:
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
Feb 27 '07 #2
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/boo...chap/6723.aspx
I hope that previous post has answered your question.
--
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"phenglai" wrote:
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
Feb 27 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: turnit \(removethis\) | last post by:
I have a login form that uses the post method to carry the information to the next page. The form works just fine in ie6.0, but fails in mozilla and fails in ie5.2 on a mac. "HTTP/1.1 400 Bad...
17
by: Patrick | last post by:
I am almost certain that I could use HTTP Post/Get to submit XML Web Service call (over SSL as well, if using Version 3 of MSXML2) from an ASP Application? However, would I only be able to call...
3
by: Geoff | last post by:
I have been asked to add postal rates to a web page shopping cart checkout procedure. After contacting the post office I discovered that they used XML to receive postal rate requests and send back...
6
by: JK | last post by:
Can anyone provide me with an ASP 2.0 example of how to call the geocoder service. They provide the following perl example for XML-RPC : #!/usr/bin/perl use XMLRPC::Lite; use Data::Dumper;...
0
by: DT | last post by:
I'm writing a .NET 1.1 client that invokes a method of a Web Service running on another organization's IIS 5 server. I need help understanding a fine point about HTTP, specifically in relation to...
5
by: David Lozzi | last post by:
Howdy, I wrote a web service in .Net for my customer. My customer has another vendor who now has to consume it but they are not using Visual Studio. Most of their pages are jsp, and they said...
0
by: SimonDev | last post by:
Hi I've got an unusual problem I'm hoping someone could advise me on, regarding the formatting of the body of an HTTP response from a web service. We are using HTTP POST rather than SOAP for...
3
by: Jason Zhou | last post by:
I understand how to consume a web service by registering it as a web reference in my project, but how to use HTTP Post to call a web service? For example I have a web service called TestService,...
6
by: Brybot | last post by:
I am trying to allow HTTP POST file uploads to my web service. Currently I have it working perfectly for a SOAP/XML request reading in a byte using MemoryStream/FileStream but I cannot figure out...
5
by: Thomas Lunsford | last post by:
I have been asked to allow one of our old-school .asp pages to support being used as a web service. Specifically, WSDL was mentioned. I am not an expert on this , but I have done quite a bit of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.