473,288 Members | 1,794 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,288 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 5409
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.