Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

webservice to classic asp 1

Status
Not open for further replies.

onressy

Programmer
Mar 7, 2006
421
CA
greetings,

i created a test asp page like so:
Code:
<!--#include file="includes/dbconstants.asp"-->
<%
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open CONSTdbConnStr

For Each item In Request.Form
  objNode = objNode & item

  strSQL = "INSERT INTO GDSconfirm (ReservationID, StatusR) VALUES ('11111', '"& objNode &"')"

  objConn.Execute(strSQL)
Next

objConn.Close
%>

I also create a simple form an posted to the above asp page. The value entered the database. Now, i'll be working with a remote server that is using a java based webservice to push an xml file to the aformentioned asp page?

Would i be able to grab the xml packed as an item?
 
If I understand correctly which I usually don't...yes with XMLDOM

General FAQ faq333-2924
5 steps to asking a question faq333-3811
 
Heh, I almost posted a link to another post that I thought covered this...untli irealized that you had posted that other post :p

The best way to tell is just to try it. I'm not sure Request can handle a POST'ed file and form inputs in one go (at least not with out some additional specifiers or possible an upload script). But I could be wrong. I've never tried posting form information and an XML file in the same post.



 
Thanks Onpnt and Tarwn,

I recieve an email in regards to the remote server ungin a webservice to push the xml pack to me, this is what they said:
What is the WSDL interface about your web service? What method you expect us to push the reservation?

Since i'm using classic asp, i don't have a web service (like soap) I'm looking into WSDL to see in relation to classic asp methods.

I'm not sure how to answer the following questions?
Thanks
 
Basically a WSDL is what defines your web service and what data formats it expects/provides.

You can implement web services with classic ASP:
1) The page has to accept POST'd XML that consist of a SOAP envelope and payload
2) Parse, do it's thing
3) Respond with another chunk of XML in a SOAP envelope
and
4) Have a WSDL that explains the service/functions/etc

As you can see, the first three tasks are all things you have done in the past. The last one is a bit more complicated if I remember correctly (haven't hand written a WSDL in a few years).

the one problem is that this stuff can get fairly complicated when your figuring out how to build a compliant SOAP envelope and WSDL. If you want or need a quick solution you may want to look into using a language with some built-in methods (like .Net) or look at some components for ASP.

 
Generally Web Services don't talk to one another, or they do , but not any differantly than any other piece of code talks to a web service.

Basically there is a service and there is a client. The service provides a way to call a function by passing the approporiate information (ie, function, args, etc) encapsulated in XML. The Service does it's thing then returns a SOAP Response, basically several pieces of informaiton and some sort of data structure (also in XML).

If it is only necessary for you to talk to their web service, then you could use XMLHTTP to send your initial SOAP Request and receive the services Response.

Now if you are building a web service that they are going to consume, then you will need a WSDL to define what service you provide and the data formats, and a page to parse an incoming SOAP Request and execute the requested piece of functionaloity, then return a response. The only major difference betwene this and your earlier posts about receiving a POST'd XML chunk is that you need to parse the SOAP XML in order to determine what piece of code you will run, and your output will need to be in XML (with a SOAP envelope). Though that is just the mater of setting Response.ContectType = "text/xml" and Response.Writeing everythign to the screen (or in this case, the Response stream to the consumer).

I caution you not to read the too much into article you linked above, the author apparently had some confusion on the difference between SOAP and REST.

There is a package out there (supposedly) calle dthe SOAP Toolkit that can make consuming web services easier. Personally I'm pretty slack and hate installing new packages, so I generally write up the chunk of XML as a string, drop it into an XMLHTTP object, and parse the response. Then again I haven't written a .Net service in classic ASP in over 5 years...and looking through google I don't see a large number of others that have either.

 
Thanks again Tarwn,

So are you basically saying that an asp page can recieve a SOAP request and parse it, and return a SOAP envelop rely?

I know that there are many details involved, but simply stated, would the remote server just need a url to the ASP page to push the SOAP/xml packet to? another words if i give the remote server people an ASP page url to my server, when they send an xml packet over via SOAP, the ASP page should fire and do it thing..

Thanks again for the clarification.
 
May be this instead... I can't seem to find an atricle on using classic asp to interpret a soap call, any links?

Thanks
 
I guess my main questions is Does i need a webservice to recieve an xml/soap packet from a soap service?

Thanks
 
Does i need a webservice to recieve an xml/soap packet from a soap service?
No. If you interacting with someone else's service, then you are the consumer and can use any of the dozens of articles to consume that service.

if they are expecting to consume your web service, then you need to be the one that accepts a SOAP request and returns a SOAP response (as well as having a WSDL to define your service).

 
Thanks Tarwn, your explainations, i am grateful for.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top