473,386 Members | 1,763 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,386 software developers and data experts.

XML Post / Reply

I need to make a web service call using an HTTPS POST. XML data is returned
in the body of the
HTTPS reply. What is the best way to do this with asp.net web services?

I am very comfortable in the world of asp.net and C# but have done nothing
with web services or XML. My first incling is to stream an XML document to
an HTTP Request object and then stream the response back to an XML document
but guessing there is a better way?

Thanks,
Sample data:

<Request StoreID="myStoreID" StoreKey="myStoreKey"
ApplicationID="My Application Name Ver 1.0">
<CreditCardAuthorize>
<ReferenceNumber>1234</ReferenceNumber>
<TransactionAmount>1.00</TransactionAmount>
<AccountNumber>4111111111111111</AccountNumber>
<ExpirationMonth>12</ExpirationMonth>
<ExpirationYear>99</ExpirationYear>
</CreditCardAuthorize>
</Request>

Reply:

<Reply>
<TransactionReply>
<ResponseCode>0</ResponseCode>
<ResultCode>00</ResultCode>
<ResultMessage>APPROVED</ResultMessage>
<TransactionID>100000182165</TransactionID>
<AVSResponseCode />
<CVVResponseCode />
<ApprovalNumber>123456</ApprovalNumber>
<AuthorizationNumber>123456</AuthorizationNumber>
<TransactionDate>021112</TransactionDate>
<TransactionTime>110544</TransactionTime>
<ReferenceNumber>1234</ReferenceNumber>
<AccountNumber>XXXXXXXXXXXX1111</AccountNumber>
<TransactionAmount>1.00</TransactionAmount>
</TransactionReply>
</Reply>
Oct 4 '06 #1
2 4051


Andrew Robinson wrote:
I need to make a web service call using an HTTPS POST. XML data is returned
in the body of the
HTTPS reply. What is the best way to do this with asp.net web services?

I am very comfortable in the world of asp.net and C# but have done nothing
with web services or XML. My first incling is to stream an XML document to
an HTTP Request object and then stream the response back to an XML document
but guessing there is a better way?
HTTP request/response handling in the .NET framework is done with
HttpWebRequest/HttpWebResponse. Those expose streams (input or output
stream) and if you want to write or read XML then all XML APIs .NET have
overloads taking a stream (e.g. XmlWriter over a stream to post the XML
as part of a HTTP request body, XmlReader or XPathDocument or
XmlDocument over a stream to parse the XML in a HTTP response body).

If you web service follows standards like SOAP and WSDL then there are
additional tools to simply generate .NET proxy class code and make calls
to the web service by calling methods of a proxy object.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Oct 4 '06 #2
Our vendor has a SOAP / WSDL interface but the raw XML using POST is their
preferred interface (and they offer some additional functionality with it.).

Sounds like I was heading down the correct path based on your posting.
Thanks,
"Martin Honnen" <ma*******@yahoo.dewrote in message
news:ue**************@TK2MSFTNGP03.phx.gbl...
>

Andrew Robinson wrote:
>I need to make a web service call using an HTTPS POST. XML data is
returned in the body of the
HTTPS reply. What is the best way to do this with asp.net web services?

I am very comfortable in the world of asp.net and C# but have done
nothing with web services or XML. My first incling is to stream an XML
document to an HTTP Request object and then stream the response back to
an XML document but guessing there is a better way?

HTTP request/response handling in the .NET framework is done with
HttpWebRequest/HttpWebResponse. Those expose streams (input or output
stream) and if you want to write or read XML then all XML APIs .NET have
overloads taking a stream (e.g. XmlWriter over a stream to post the XML as
part of a HTTP request body, XmlReader or XPathDocument or XmlDocument
over a stream to parse the XML in a HTTP response body).

If you web service follows standards like SOAP and WSDL then there are
additional tools to simply generate .NET proxy class code and make calls
to the web service by calling methods of a proxy object.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Oct 4 '06 #3

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

Similar topics

1
by: Alec | last post by:
Hi All, I have recently built a site using PHP and MySQL, and started to implement a basic forum into it. However, the form to post messages doesnt do what I want it to. If there is no user...
15
by: Thomas Scheiderich | last post by:
I am trying to understand Session variables and ran into a question on how they work with data that is passed. I have an HTM file that calls an ASP file and sends the name either by GET or POST....
1
by: Taggy | last post by:
hi, Can someone help me with this. I am having this codes: WebRequest myRequest = WebRequest.Create( myurl ); -line1 WebResponse myResponse = myRequest.GetResponse(); -line2 ...... to get...
10
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a...
7
by: | last post by:
Hello, I would like to do the following from a asp.net button click: <form method="POST" action="https://www.1234.com/trans_center/gateway/direct.cgi"> <input type="hidden" name="Merchant"...
2
by: Leon | last post by:
Hi, Basically I've written a NNTP-client which is able to post new messages, but inable to post replies to messages. I've tried posting a reference string into the header of the new article...
48
by: Ravishankar S | last post by:
hello, would any kind soul explain what is top posting, since i dont have www access. to reply to a post, i open it in the outlook express and click reply group and that's all. what the top...
7
by: php_mysql_beginer911 | last post by:
Hi .. hope someone will help i am trying to figure it out why i cannot post string "union select" every time i try to post data which content union and select .. the page doesn't get posted and...
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:
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.