Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

Howto Send/GET a HTTP message in CRS

hi all!

In my solution, I need to communicate with third-party system via HTTP Protocol . So, How do I send a HTTP Request to a application server and receive the HTTP RESPONSE in CRS Script Editor?

It's very urgent. Please reply me as soon as possible. I'll vote you 5* :)

12 REPLIES
Gold

Re: Howto Send/GET a HTTP message in CRS

Hi,

You have to use 'Create URL document' step in the Document folder in CRS Script Editor.

To have an example of a basic script that it does the things you want, use this Cisco guide. I used the example to implement an scenario similar to you. Take a look to the chapter 'Designing a Web-Enabled Client Script':

http://www.cisco.com/application/pdf/en/us/guest/products/ps6488/c1626/ccmigration_09186a00804a2b0a.pdf

Hope this helps,

Juan Luis

Community Member

Re: Howto Send/GET a HTTP message in CRS

Thanks a lot Luis!

I have read that guide for many times but I still can't make it work.

Would you please do me a favor to send me your script like my scenario?

There is still another bug in CRS that I can't fix so I hope that you can help me. The problem is that I can't add a custom Java class into CRS. I do as steps below:

Step 1: Using CRS Application Administrator to upload the JAR file.

Step 2: Using CRS AA to configure a custom classpath

Step 3: restart the CRS Editor.

Then I open JAVA Exp. Editor and modify the Object but CRS doesn't load JAVA's contructor or Method.

I use CRS 4.5 (IP-IVR License).

Could you help me to resolve this problem.

Thanks

Gold

Re: Howto Send/GET a HTTP message in CRS

The script was simple: I prompted for an ID and password, sended a get to a web server and receives a very simple XML with 1 or 0 depends on the web server validation was true or false.

I can not provide the script because it is on the customer system.

Hope this helps,

Juan Luis

Community Member

Re: Howto Send/GET a HTTP message in CRS

Yes, it's exactly same to my situation.

I use IVR to collect user/pass and check it by an external server.

If you could, please cut the important parameters in your script, and send me just a simple script to SEND the request and RECEIVE the result.

It's very important to me now. Because I have to finish this project before tomorrow.

Thanks a lot.

Gold

Re: Howto Send/GET a HTTP message in CRS

Hi,

Here you have a simple script, Script1.aef, that sends a 'get' to a web server and receives a very simple answer in XML showed in the 'Servelet_Answer.txt' file. The value returned by the web server is stored in the variable 'Result' in the script.

Hope this helps,

Juan Luis

Community Member

Re: Howto Send/GET a HTTP message in CRS

Thanks a lot!

Now, I know what I should do.

I'm finding the way to return the XML file from web application (which is written by Java) after receiving HTTP request.

Thanks again.

Community Member

Re: Howto Send/GET a HTTP message in CRS

Hi,

I'm trying to do something similar but is not working.

I'm trying to send a parameter to an ASP webpage to make it run. All I want is to deliver it.

I was reading the cisco guide and it says to use the Create URL Document + the Send HTTP Response step but it doesn't work.

my Create URL Document:

URL= http://x.x.x.x/webpage.asp

Method = Post

Parameters = name = f, values = "something"

document = doc

Send HTTP Response step:

Document = doc

Any help will be greatly appreciated.

thank you

Community Member

Re: Howto Send/GET a HTTP message in CRS

Hi,

I'm trying to do something similar but is not working.

I'm trying to send a parameter to an ASP webpage to make it run. All I want is to deliver it.

I was reading the cisco guide and it says to use the Create URL Document + the Send HTTP Response step but it doesn't work.

my Create URL Document:

URL= http://x.x.x.x/webpage.asp

Method = Post

Parameters = name = f, values = "something"

document = doc

Send HTTP Response step:

Document = doc

Any help will be greatly appreciated.

thank you

Re: Howto Send/GET a HTTP message in CRS

Hi,

You talked above how to receive a response from a web application by creating the xml data

But please advise how to send a request to this web service to receive this response based on the sent request ?

Thanks

Green

Re: Howto Send/GET a HTTP message in CRS

The normal way you talk to a Web service is to send an HTTP POST to a URL. The URL consists of a URI + a query string defining the arguments. name=value pairs in the query string are separated by ampersands, and the query string is separated from the URI with a question mark.

So perhaps your Web service is located at http://some_server:8000/someApp and you want to pass arguments name1=value1 and name2=value2. The software will build up a URL like this

http://some_server:8000/someApp?name1=value1&name2=value2

I suspect the CRS application does this.

What returns from the POST could be an XML document which you can parse.

Regards,

Geoff

Re: Howto Send/GET a HTTP message in CRS

Hi geoff,

Thanks for your reply

So you see the in the create url doc , I'll fill in the parameters: name and vlaue - for the values I need to send to the webservices to ask about?

as if i have a caller ID and he choose for example menu number 4 in my script

then I'll need to send the webservice the caller ID and the 4 ,, then I'll expect a response from the webservice to play it for the customer

So you see I'll send as for example:

name:Calling , vlaue:19723783748

name:choose, value: 4

then the webservice will receive them and respond, I'll make xml doc,and get the value using xpath ?

Also the above 2-name: Calling & choose should be defined in the webservice ?

thanks

Green

Re: Howto Send/GET a HTTP message in CRS

Does the Web service already exist? Is it a Tomcat server or some ASP server? If Tomcat, what port is it listening on? 8000?

If you paste something like (make the obvious substitutions)

http://some_server:8000/someApp?Calling=4085551234&choose=4

into your browser, what do you get back?

Regards,

Geoff

636
Views
5
Helpful
12
Replies
CreatePlease to create content