Re: DOJO AJAX *HELP*

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: DOJO AJAX *HELP*

Umashankar, Arvind

Hello All,

                I am novice to DOJO and I am trying to DOJO AJAX(xhrPost) for Server side communication .

 

My Deployment:

   I’ve a web service (hosted on IIS) and I’ve a thin Application based on DOJO hosted in CDN(later may be I will move it to Tomcat).

 

My Problem statement:

  I need to authenticate the Login [web Service provided Web APIs for the same.]

 

My HTTP Post Request is something like this:

 

URL:   http://IPAddress/ProcedureProvider_IISHost/ProcedureProvider_IISHost.svc/EP_Http_Simple_BasicCreds

Headers:

     Content-Type: “text/xml; charset=UTF-8”

      Authorization: Basic aW5nYnRjXHRyYWluaW5nOnRyYWluQDEyMzQ1

      SOAPAction: http://tempuri.org/IProcedureProvider_Service/GetEnterpriseConfiguration

 

Post Body:

    <some XML in UTF8>

 

 

DOJO XHR Post Statement which is tried:

 

 

var xhrArgs = {

                url: "http://ipAddress/ProcedureProvider_IISHost/ProcedureProvider_IISHost.svc/EP_Http_Simple_BasicCreds",

               

                postData:'<s:Envelope ></s:Envelope>',

                headers:{

                    'SOAPAction': 'http://tempuri.org/IProcedureProvider_Service/GetEnterpriseConfiguration',

                    'content-type': 'text/xml;charset=utf-8',

                    'Authorization': 'Basic aW5nYnRjXHRyYWluaW5nOnRyYWluQDEyMzQ1'

                },

                load: function (data) {

                    var jsonData = dojo.toJson(data, true);

                    alert("Response::" + data);

                },              

                error: function (error) {

                    alert("An unexpected error occurred: " + error);

                }

            }

           

            

        dojo.xhrPost(xhrArgs);

 

What I got as output:

·         I get a 403 exception(when I checked Fiddler)

·         The Post header was somewhat different from what I expected

o    From Fiddler:  

OPTIONS /ProcedureProvider_IISHost/ProcedureProvider_IISHost.svc/EP_Http_Simple_BasicCreds HTTP/1.1

Host: 161.85.25.166

Connection: keep-alive

Access-Control-Request-Method: POST

Origin: http://localhost:81

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4

Access-Control-Request-Headers: origin, authorization, x-requested-with, soapaction, content-type

Accept: */*

Referer: http://localhost:81/ECGAnywhere/main.html

Accept-Encoding: gzip,deflate,sdch

Accept-Language: en-US,en;q=0.8

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

 

Observations:

   When I tried this HTTP Post request with Advanced REST Client from Chorme , things work fine .

 

Can anyone please help me out in identifying the issue.

 

 

Regards,

Arvind

 

 

 

 

                                                                               

 



The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.

________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: DOJO AJAX *HELP*

Dustin Machi
Is this a cross domain request (a different host or port from what the page is loaded from).  Thats what it looks like to me. Do a search for CORS (cross origin resource sharing).

Dustin

On Oct 4, 2012, at 5:38 AM, Umashankar, Arvind wrote:

> Hello All,
>                 I am novice to DOJO and I am trying to DOJO AJAX(xhrPost) for Server side communication .
>  
> My Deployment:
>    I’ve a web service (hosted on IIS) and I’ve a thin Application based on DOJO hosted in CDN(later may be I will move it to Tomcat).
>  
> My Problem statement:
>   I need to authenticate the Login [web Service provided Web APIs for the same.]
>  
> My HTTP Post Request is something like this:
>  
> URL:   http://IPAddress/ProcedureProvider_IISHost/ProcedureProvider_IISHost.svc/EP_Http_Simple_BasicCreds
> Headers:
>      Content-Type: “text/xml; charset=UTF-8”
>       Authorization: Basic aW5nYnRjXHRyYWluaW5nOnRyYWluQDEyMzQ1
>       SOAPAction: http://tempuri.org/IProcedureProvider_Service/GetEnterpriseConfiguration
>  
> Post Body:
>     <some XML in UTF8>
>  
>  
> DOJO XHR Post Statement which is tried:
>  
>  
> var xhrArgs = {
>                 url:"http://ipAddress/ProcedureProvider_IISHost/ProcedureProvider_IISHost.svc/EP_Http_Simple_BasicCreds",
>                
>                 postData:'<s:Envelope ></s:Envelope>',
>                 headers:{
>                     'SOAPAction':'http://tempuri.org/IProcedureProvider_Service/GetEnterpriseConfiguration',
>                     'content-type': 'text/xml;charset=utf-8',
>                     'Authorization': 'Basic aW5nYnRjXHRyYWluaW5nOnRyYWluQDEyMzQ1'
>                 },
>                 load: function (data) {
>                     var jsonData = dojo.toJson(data, true);
>                     alert("Response::" + data);
>                 },              
>                 error: function (error) {
>                     alert("An unexpected error occurred: " + error);
>                 }
>             }
>            
>            
>         dojo.xhrPost(xhrArgs);
>  
> What I got as output:
> ·         I get a 403 exception(when I checked Fiddler)
> ·         The Post header was somewhat different from what I expected
> o    From Fiddler:  
> OPTIONS /ProcedureProvider_IISHost/ProcedureProvider_IISHost.svc/EP_Http_Simple_BasicCreds HTTP/1.1
> Host: 161.85.25.166
> Connection: keep-alive
> Access-Control-Request-Method: POST
> Origin: http://localhost:81
> User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4
> Access-Control-Request-Headers: origin, authorization, x-requested-with, soapaction, content-type
> Accept: */*
> Referer: http://localhost:81/ECGAnywhere/main.html
> Accept-Encoding: gzip,deflate,sdch
> Accept-Language: en-US,en;q=0.8
> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
>  
> Observations:
>    When I tried this HTTP Post request with Advanced REST Client from Chorme , things work fine .
>  
> Can anyone please help me out in identifying the issue.
>  
>  
> Regards,
> Arvind
>  
>  
>  
>  
>                                                                                
>  
>
> The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
> ________________________________________________________
> Dojo Toolkit: http://dojotoolkit.org/
> Tutorials: http://dojotoolkit.org/documentation/
> Reference Guide: http://dojotoolkit.org/reference-guide
> API Documentation: http://dojotoolkit.org/api
>
> [hidden email]
> To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: DOJO AJAX *HELP*

Umashankar, Arvind
Hi Dustin,
        Yes it is cross domain ...
I could not find any sample for the same. Is it possible for you to explain what I must do?

Thanks,
Arvind

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Dustin Machi
Sent: 04 October 2012 PM 05:27
To: [hidden email]
Subject: Re: [Dojo-interest] DOJO AJAX *HELP*

Is this a cross domain request (a different host or port from what the page is loaded from).  Thats what it looks like to me. Do a search for CORS (cross origin resource sharing).

Dustin

On Oct 4, 2012, at 5:38 AM, Umashankar, Arvind wrote:

> Hello All,
>                 I am novice to DOJO and I am trying to DOJO AJAX(xhrPost) for Server side communication .
>  
> My Deployment:
>    I've a web service (hosted on IIS) and I've a thin Application based on DOJO hosted in CDN(later may be I will move it to Tomcat).
>  
> My Problem statement:
>   I need to authenticate the Login [web Service provided Web APIs for the same.]
>  
> My HTTP Post Request is something like this:
>  
> URL:   http://IPAddress/ProcedureProvider_IISHost/ProcedureProvider_IISHost.svc/EP_Http_Simple_BasicCreds
> Headers:
>      Content-Type: "text/xml; charset=UTF-8"
>       Authorization: Basic aW5nYnRjXHRyYWluaW5nOnRyYWluQDEyMzQ1
>       SOAPAction: http://tempuri.org/IProcedureProvider_Service/GetEnterpriseConfiguration
>  
> Post Body:
>     <some XML in UTF8>
>  
>  
> DOJO XHR Post Statement which is tried:
>  
>  
> var xhrArgs = {
>                 url:"http://ipAddress/ProcedureProvider_IISHost/ProcedureProvider_IISHost.svc/EP_Http_Simple_BasicCreds",
>                
>                 postData:'<s:Envelope ></s:Envelope>',
>                 headers:{
>                     'SOAPAction':'http://tempuri.org/IProcedureProvider_Service/GetEnterpriseConfiguration',
>                     'content-type': 'text/xml;charset=utf-8',
>                     'Authorization': 'Basic aW5nYnRjXHRyYWluaW5nOnRyYWluQDEyMzQ1'
>                 },
>                 load: function (data) {
>                     var jsonData = dojo.toJson(data, true);
>                     alert("Response::" + data);
>                 },              
>                 error: function (error) {
>                     alert("An unexpected error occurred: " + error);
>                 }
>             }
>            
>            
>         dojo.xhrPost(xhrArgs);
>  
> What I got as output:
> *         I get a 403 exception(when I checked Fiddler)
> *         The Post header was somewhat different from what I expected
> o    From Fiddler:  
> OPTIONS /ProcedureProvider_IISHost/ProcedureProvider_IISHost.svc/EP_Http_Simple_BasicCreds HTTP/1.1
> Host: 161.85.25.166
> Connection: keep-alive
> Access-Control-Request-Method: POST
> Origin: http://localhost:81
> User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4
> Access-Control-Request-Headers: origin, authorization, x-requested-with, soapaction, content-type
> Accept: */*
> Referer: http://localhost:81/ECGAnywhere/main.html
> Accept-Encoding: gzip,deflate,sdch
> Accept-Language: en-US,en;q=0.8
> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
>  
> Observations:
>    When I tried this HTTP Post request with Advanced REST Client from Chorme , things work fine .
>  
> Can anyone please help me out in identifying the issue.
>  
>  
> Regards,
> Arvind
>  
>  
>  
>  
>                                                                                
>  
>
> The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
> ________________________________________________________
> Dojo Toolkit: http://dojotoolkit.org/
> Tutorials: http://dojotoolkit.org/documentation/
> Reference Guide: http://dojotoolkit.org/reference-guide
> API Documentation: http://dojotoolkit.org/api
>
> [hidden email]
> To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: DOJO AJAX *HELP*

wagner



maybe this post can help

http://dojo-toolkit.33424.n3.nabble.com/CrossDomain-POST-request-td3990012.html





2012/10/6 Umashankar, Arvind <[hidden email]>
Hi Dustin,
        Yes it is cross domain ...
I could not find any sample for the same. Is it possible for you to explain what I must do?

Thanks,
Arvind

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Dustin Machi
Sent: 04 October 2012 PM 05:27
To: [hidden email]
Subject: Re: [Dojo-interest] DOJO AJAX *HELP*

Is this a cross domain request (a different host or port from what the page is loaded from).  Thats what it looks like to me. Do a search for CORS (cross origin resource sharing).

Dustin

On Oct 4, 2012, at 5:38 AM, Umashankar, Arvind wrote:

> Hello All,
>                 I am novice to DOJO and I am trying to DOJO AJAX(xhrPost) for Server side communication .
>
> My Deployment:
>    I've a web service (hosted on IIS) and I've a thin Application based on DOJO hosted in CDN(later may be I will move it to Tomcat).
>
> My Problem statement:
>   I need to authenticate the Login [web Service provided Web APIs for the same.]
>
> My HTTP Post Request is something like this:
>
> URL:   http://IPAddress/ProcedureProvider_IISHost/ProcedureProvider_IISHost.svc/EP_Http_Simple_BasicCreds
> Headers:
>      Content-Type: "text/xml; charset=UTF-8"
>       Authorization: Basic aW5nYnRjXHRyYWluaW5nOnRyYWluQDEyMzQ1
>       SOAPAction: http://tempuri.org/IProcedureProvider_Service/GetEnterpriseConfiguration
>
> Post Body:
>     <some XML in UTF8>
>
>
> DOJO XHR Post Statement which is tried:
>
>
> var xhrArgs = {
>                 url:"http://ipAddress/ProcedureProvider_IISHost/ProcedureProvider_IISHost.svc/EP_Http_Simple_BasicCreds",
>
>                 postData:'<s:Envelope ></s:Envelope>',
>                 headers:{
>                     'SOAPAction':'http://tempuri.org/IProcedureProvider_Service/GetEnterpriseConfiguration',
>                     'content-type': 'text/xml;charset=utf-8',
>                     'Authorization': 'Basic aW5nYnRjXHRyYWluaW5nOnRyYWluQDEyMzQ1'
>                 },
>                 load: function (data) {
>                     var jsonData = dojo.toJson(data, true);
>                     alert("Response::" + data);
>                 },
>                 error: function (error) {
>                     alert("An unexpected error occurred: " + error);
>                 }
>             }
>
>
>         dojo.xhrPost(xhrArgs);
>
> What I got as output:
> *         I get a 403 exception(when I checked Fiddler)
> *         The Post header was somewhat different from what I expected
> o    From Fiddler:
> OPTIONS /ProcedureProvider_IISHost/ProcedureProvider_IISHost.svc/EP_Http_Simple_BasicCreds HTTP/1.1
> Host: 161.85.25.166
> Connection: keep-alive
> Access-Control-Request-Method: POST
> Origin: http://localhost:81
> User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4
> Access-Control-Request-Headers: origin, authorization, x-requested-with, soapaction, content-type
> Accept: */*
> Referer: http://localhost:81/ECGAnywhere/main.html
> Accept-Encoding: gzip,deflate,sdch
> Accept-Language: en-US,en;q=0.8
> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
>
> Observations:
>    When I tried this HTTP Post request with Advanced REST Client from Chorme , things work fine .
>
> Can anyone please help me out in identifying the issue.
>
>
> Regards,
> Arvind
>
>
>
>
>
>
>
> The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
> ________________________________________________________
> Dojo Toolkit: http://dojotoolkit.org/
> Tutorials: http://dojotoolkit.org/documentation/
> Reference Guide: http://dojotoolkit.org/reference-guide
> API Documentation: http://dojotoolkit.org/api
>
> [hidden email]
> To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest



--
Wagner França Marques
54731643 (vivo)
70768470 (claro)


________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: DOJO AJAX *HELP*

tameritoke
Hi Wagner,
The best way to solve it, without doing real miracle programming work,
where the API would break in future and where you have to start over is
the following:



On the server side create a url, on it's script responding the backend
that does a second request for you and hand you over the response.


workout:

1. create a serverside script in python or PHP or whatever.
2. create a unique url, where the script receives the request you did
form JS

3. the script receives the request, inside this script you make a 2nd
request. The 2nd request is that to other other domain.

4. The script receives from domain 2 the answer, you encode it to json
and return it to the app with "print or echo" or whatever.


But the scross domain issue is difficult, because it is standartized.
So, library here or there, the browsers themselfes have those limitations.



Tamer



Am 08.10.2012 14:38, schrieb Wagner Marques:

>
>
>
> maybe this post can help
>
> http://dojo-toolkit.33424.n3.nabble.com/CrossDomain-POST-request-td3990012.html
>
>
>
>
>
> 2012/10/6 Umashankar, Arvind <[hidden email]
> <mailto:[hidden email]>>
>
>     Hi Dustin,
>             Yes it is cross domain ...
>     I could not find any sample for the same. Is it possible for you to
>     explain what I must do?
>
>     Thanks,
>     Arvind
>
>     -----Original Message-----
>     From: [hidden email]
>     <mailto:[hidden email]>
>     [mailto:[hidden email]
>     <mailto:[hidden email]>] On Behalf Of
>     Dustin Machi
>     Sent: 04 October 2012 PM 05:27
>     To: [hidden email]
>     <mailto:[hidden email]>
>     Subject: Re: [Dojo-interest] DOJO AJAX *HELP*
>
>     Is this a cross domain request (a different host or port from what
>     the page is loaded from).  Thats what it looks like to me. Do a
>     search for CORS (cross origin resource sharing).
>
>     Dustin
>
>     On Oct 4, 2012, at 5:38 AM, Umashankar, Arvind wrote:
>
>     > Hello All,
>     >                 I am novice to DOJO and I am trying to DOJO
>     AJAX(xhrPost) for Server side communication .
>     >
>     > My Deployment:
>     >    I've a web service (hosted on IIS) and I've a thin Application
>     based on DOJO hosted in CDN(later may be I will move it to Tomcat).
>     >
>     > My Problem statement:
>     >   I need to authenticate the Login [web Service provided Web APIs
>     for the same.]
>     >
>     > My HTTP Post Request is something like this:
>     >
>     > URL:  
>     http://IPAddress/ProcedureProvider_IISHost/ProcedureProvider_IISHost.svc/EP_Http_Simple_BasicCreds
>     > Headers:
>     >      Content-Type: "text/xml; charset=UTF-8"
>     >       Authorization: Basic aW5nYnRjXHRyYWluaW5nOnRyYWluQDEyMzQ1
>     >       SOAPAction:
>     http://tempuri.org/IProcedureProvider_Service/GetEnterpriseConfiguration
>     >
>     > Post Body:
>     >     <some XML in UTF8>
>     >
>     >
>     > DOJO XHR Post Statement which is tried:
>     >
>     >
>     > var xhrArgs = {
>     >                
>     url:"http://ipAddress/ProcedureProvider_IISHost/ProcedureProvider_IISHost.svc/EP_Http_Simple_BasicCreds",
>     >
>     >                 postData:'<s:Envelope ></s:Envelope>',
>     >                 headers:{
>     >                    
>     'SOAPAction':'http://tempuri.org/IProcedureProvider_Service/GetEnterpriseConfiguration',
>     >                     'content-type': 'text/xml;charset=utf-8',
>     >                     'Authorization': 'Basic
>     aW5nYnRjXHRyYWluaW5nOnRyYWluQDEyMzQ1'
>     >                 },
>     >                 load: function (data) {
>     >                     var jsonData = dojo.toJson(data, true);
>     >                     alert("Response::" + data);
>     >                 },
>     >                 error: function (error) {
>     >                     alert("An unexpected error occurred: " + error);
>     >                 }
>     >             }
>     >
>     >
>     >         dojo.xhrPost(xhrArgs);
>     >
>     > What I got as output:
>     > *         I get a 403 exception(when I checked Fiddler)
>     > *         The Post header was somewhat different from what I expected
>     > o    From Fiddler:
>     > OPTIONS
>     /ProcedureProvider_IISHost/ProcedureProvider_IISHost.svc/EP_Http_Simple_BasicCreds
>     HTTP/1.1
>     > Host: 161.85.25.166
>     > Connection: keep-alive
>     > Access-Control-Request-Method: POST
>     > Origin: http://localhost:81
>     > User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4
>     (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4
>     > Access-Control-Request-Headers: origin, authorization,
>     x-requested-with, soapaction, content-type
>     > Accept: */*
>     > Referer: http://localhost:81/ECGAnywhere/main.html
>     > Accept-Encoding: gzip,deflate,sdch
>     > Accept-Language: en-US,en;q=0.8
>     > Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
>     >
>     > Observations:
>     >    When I tried this HTTP Post request with Advanced REST Client
>     from Chorme , things work fine .
>     >
>     > Can anyone please help me out in identifying the issue.
>     >
>     >
>     > Regards,
>     > Arvind
>     >
>     >
>     >
>     >
>     >
>     >
>     >
>     > The information contained in this message may be confidential and
>     legally protected under applicable law. The message is intended
>     solely for the addressee(s). If you are not the intended recipient,
>     you are hereby notified that any use, forwarding, dissemination, or
>     reproduction of this message is strictly prohibited and may be
>     unlawful. If you are not the intended recipient, please contact the
>     sender by return e-mail and destroy all copies of the original message.
>     > ________________________________________________________
>     > Dojo Toolkit: http://dojotoolkit.org/
>     > Tutorials: http://dojotoolkit.org/documentation/
>     > Reference Guide: http://dojotoolkit.org/reference-guide
>     > API Documentation: http://dojotoolkit.org/api
>     >
>     > [hidden email]
>     <mailto:[hidden email]>
>     > To unsubscribe, visit:
>     http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>
>     ________________________________________________________
>     Dojo Toolkit: http://dojotoolkit.org/
>     Tutorials: http://dojotoolkit.org/documentation/
>     Reference Guide: http://dojotoolkit.org/reference-guide
>     API Documentation: http://dojotoolkit.org/api
>
>     [hidden email]
>     <mailto:[hidden email]>
>     To unsubscribe, visit:
>     http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>
>     ________________________________________________________
>     Dojo Toolkit: http://dojotoolkit.org/
>     Tutorials: http://dojotoolkit.org/documentation/
>     Reference Guide: http://dojotoolkit.org/reference-guide
>     API Documentation: http://dojotoolkit.org/api
>
>     [hidden email]
>     <mailto:[hidden email]>
>     To unsubscribe, visit:
>     http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>
>
>
>
> --
> Wagner França Marques
> 54731643 (vivo)
> 70768470 (claro)
>
>
>
> ________________________________________________________
> Dojo Toolkit: http://dojotoolkit.org/
> Tutorials: http://dojotoolkit.org/documentation/
> Reference Guide: http://dojotoolkit.org/reference-guide
> API Documentation: http://dojotoolkit.org/api
>
> [hidden email]
> To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>

________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: DOJO AJAX *HELP*

wagner

thanks for you attention Tamer,

I am in a similar necessity as Umashankar: make a soap request from a dojo form to start a bpel process.

My conclusion, in the context of this post, is that the best strategy is use a connector framework like camel or jbi. In this case I will submit form data to a simple camel servlet component. The camel can transform data to make a soap request  and camel smart enough to get soap response and use it to compose the dojo form request response.

That solution is not so simple, but well knowed by the community and may not be dificult to find docs.



But I wandering why general interface makes soap request so easely fo its users? I am little envious gi users at this point :)

regards


2012/10/9 Tamer Higazi <[hidden email]>
Hi Wagner,
The best way to solve it, without doing real miracle programming work,
where the API would break in future and where you have to start over is
the following:



On the server side create a url, on it's script responding the backend
that does a second request for you and hand you over the response.


workout:

1. create a serverside script in python or PHP or whatever.
2. create a unique url, where the script receives the request you did
form JS

3. the script receives the request, inside this script you make a 2nd
request. The 2nd request is that to other other domain.

4. The script receives from domain 2 the answer, you encode it to json
and return it to the app with "print or echo" or whatever.


But the scross domain issue is difficult, because it is standartized.
So, library here or there, the browsers themselfes have those limitations.



Tamer



Am 08.10.2012 14:38, schrieb Wagner Marques:
>
>
>
> maybe this post can help
>
> http://dojo-toolkit.33424.n3.nabble.com/CrossDomain-POST-request-td3990012.html
>
>
>
>
>
> 2012/10/6 Umashankar, Arvind <[hidden email]
> <mailto:[hidden email]>>
>
>     Hi Dustin,
>             Yes it is cross domain ...
>     I could not find any sample for the same. Is it possible for you to
>     explain what I must do?
>
>     Thanks,
>     Arvind
>
>     -----Original Message-----
>     From: [hidden email]
>     <mailto:[hidden email]>
>     [mailto:[hidden email]
>     <mailto:[hidden email]>] On Behalf Of
>     Dustin Machi
>     Sent: 04 October 2012 PM 05:27
>     To: [hidden email]
>     <mailto:[hidden email]>
>     Subject: Re: [Dojo-interest] DOJO AJAX *HELP*
>
>     Is this a cross domain request (a different host or port from what
>     the page is loaded from).  Thats what it looks like to me. Do a
>     search for CORS (cross origin resource sharing).
>
>     Dustin
>
>     On Oct 4, 2012, at 5:38 AM, Umashankar, Arvind wrote:
>
>     > Hello All,
>     >                 I am novice to DOJO and I am trying to DOJO
>     AJAX(xhrPost) for Server side communication .
>     >
>     > My Deployment:
>     >    I've a web service (hosted on IIS) and I've a thin Application
>     based on DOJO hosted in CDN(later may be I will move it to Tomcat).
>     >
>     > My Problem statement:
>     >   I need to authenticate the Login [web Service provided Web APIs
>     for the same.]
>     >
>     > My HTTP Post Request is something like this:
>     >
>     > URL:
>     http://IPAddress/ProcedureProvider_IISHost/ProcedureProvider_IISHost.svc/EP_Http_Simple_BasicCreds
>     > Headers:
>     >      Content-Type: "text/xml; charset=UTF-8"
>     >       Authorization: Basic aW5nYnRjXHRyYWluaW5nOnRyYWluQDEyMzQ1
>     >       SOAPAction:
>     http://tempuri.org/IProcedureProvider_Service/GetEnterpriseConfiguration
>     >
>     > Post Body:
>     >     <some XML in UTF8>
>     >
>     >
>     > DOJO XHR Post Statement which is tried:
>     >
>     >
>     > var xhrArgs = {
>     >
>     url:"http://ipAddress/ProcedureProvider_IISHost/ProcedureProvider_IISHost.svc/EP_Http_Simple_BasicCreds",
>     >
>     >                 postData:'<s:Envelope ></s:Envelope>',
>     >                 headers:{
>     >
>     'SOAPAction':'http://tempuri.org/IProcedureProvider_Service/GetEnterpriseConfiguration',
>     >                     'content-type': 'text/xml;charset=utf-8',
>     >                     'Authorization': 'Basic
>     aW5nYnRjXHRyYWluaW5nOnRyYWluQDEyMzQ1'
>     >                 },
>     >                 load: function (data) {
>     >                     var jsonData = dojo.toJson(data, true);
>     >                     alert("Response::" + data);
>     >                 },
>     >                 error: function (error) {
>     >                     alert("An unexpected error occurred: " + error);
>     >                 }
>     >             }
>     >
>     >
>     >         dojo.xhrPost(xhrArgs);
>     >
>     > What I got as output:
>     > *         I get a 403 exception(when I checked Fiddler)
>     > *         The Post header was somewhat different from what I expected
>     > o    From Fiddler:
>     > OPTIONS
>     /ProcedureProvider_IISHost/ProcedureProvider_IISHost.svc/EP_Http_Simple_BasicCreds
>     HTTP/1.1
>     > Host: 161.85.25.166
>     > Connection: keep-alive
>     > Access-Control-Request-Method: POST
>     > Origin: http://localhost:81
>     > User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4
>     (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4
>     > Access-Control-Request-Headers: origin, authorization,
>     x-requested-with, soapaction, content-type
>     > Accept: */*
>     > Referer: http://localhost:81/ECGAnywhere/main.html
>     > Accept-Encoding: gzip,deflate,sdch
>     > Accept-Language: en-US,en;q=0.8
>     > Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
>     >
>     > Observations:
>     >    When I tried this HTTP Post request with Advanced REST Client
>     from Chorme , things work fine .
>     >
>     > Can anyone please help me out in identifying the issue.
>     >
>     >
>     > Regards,
>     > Arvind
>     >
>     >
>     >
>     >
>     >
>     >
>     >
>     > The information contained in this message may be confidential and
>     legally protected under applicable law. The message is intended
>     solely for the addressee(s). If you are not the intended recipient,
>     you are hereby notified that any use, forwarding, dissemination, or
>     reproduction of this message is strictly prohibited and may be
>     unlawful. If you are not the intended recipient, please contact the
>     sender by return e-mail and destroy all copies of the original message.
>     > ________________________________________________________
>     > Dojo Toolkit: http://dojotoolkit.org/
>     > Tutorials: http://dojotoolkit.org/documentation/
>     > Reference Guide: http://dojotoolkit.org/reference-guide
>     > API Documentation: http://dojotoolkit.org/api
>     >
>     > [hidden email]
>     <mailto:[hidden email]>
>     > To unsubscribe, visit:
>     http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>
>     ________________________________________________________
>     Dojo Toolkit: http://dojotoolkit.org/
>     Tutorials: http://dojotoolkit.org/documentation/
>     Reference Guide: http://dojotoolkit.org/reference-guide
>     API Documentation: http://dojotoolkit.org/api
>
>     [hidden email]
>     <mailto:[hidden email]>
>     To unsubscribe, visit:
>     http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>
>     ________________________________________________________
>     Dojo Toolkit: http://dojotoolkit.org/
>     Tutorials: http://dojotoolkit.org/documentation/
>     Reference Guide: http://dojotoolkit.org/reference-guide
>     API Documentation: http://dojotoolkit.org/api
>
>     [hidden email]
>     <mailto:[hidden email]>
>     To unsubscribe, visit:
>     http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>
>
>
>
> --
> Wagner França Marques
> 54731643 (vivo)
> 70768470 (claro)
>
>
>
> ________________________________________________________
> Dojo Toolkit: http://dojotoolkit.org/
> Tutorials: http://dojotoolkit.org/documentation/
> Reference Guide: http://dojotoolkit.org/reference-guide
> API Documentation: http://dojotoolkit.org/api
>
> [hidden email]
> To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>

________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest



--
Wagner França Marques
54731643 (vivo)
70768470 (claro)


________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: DOJO AJAX *HELP*

tameritoke
Hi Marques!
What do you mean witrh this sentence?!

As I understood, you will make a soap request from the server side
servlet component.....

Consider:

socket->get/post->soap/rest/rpc_call

socket is the fastest way, on 2nd line I would get something else.


SOAP is usually offered for OOP issues to execute remote function calls.
nothing else, but is on the other side very slow.


if you have the chance to make a "get" query, I would persist in that
instead of "Webservices".




Tamer

Am 09.10.2012 15:03, schrieb Wagner Marques:

>
> But I wandering why general interface makes soap request so easely fo
> its users? I am little envious gi users at this point :)
>
> regards
>
________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: DOJO AJAX *HELP*

wagner

My apologises Tamer, sometimes (or often), my english is not good enougth!


In my opinion, you are completely correct about the rest be the fastest and easily method to make the "first request", no doubt about it.
I think that to use camel to receive this "first request" can be in this context too.


I was trying to say, with the expression "camel servlet component", that I am considering to use camel to receive this "first request".
This url introduce referred component: http://camel.apache.org/servlet.html


But why use camel to receive this first request? Because camel provide methods to transform this first request data in a soap request to the webservice.
This is a Enterprise Integration Pattern: http://camel.apache.org/normalizer.html.
I thinks that this a suitable strategy for me because I am using servicemix and camel is naturally integrated in there. But camel is simple jar and can be integrated in a java webapp without problems.
Beside this, camel can receive the soap response back and work with response data to construct a suitable response for the "first request" using message tranformation pattern again.

To receive the first request with a rest request, camel provide http://camel.apache.org/cxfrs.html component that can work within same strategy above.


But I am still studing this strategy and I am open to new remarks about it.


best regards






2012/10/9 Tamer Higazi <[hidden email]>
Hi Marques!
What do you mean witrh this sentence?!

As I understood, you will make a soap request from the server side
servlet component.....

Consider:

socket->get/post->soap/rest/rpc_call

socket is the fastest way, on 2nd line I would get something else.


SOAP is usually offered for OOP issues to execute remote function calls.
nothing else, but is on the other side very slow.


if you have the chance to make a "get" query, I would persist in that
instead of "Webservices".




Tamer

Am 09.10.2012 15:03, schrieb Wagner Marques:

>
> But I wandering why general interface makes soap request so easely fo
> its users? I am little envious gi users at this point :)
>
> regards
>
________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest



--
Wagner França Marques
54731643 (vivo)
70768470 (claro)


________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: DOJO AJAX *HELP*

tameritoke
Hi Wagner,

fastest timing: Socket, Websocket
2nd fastest: GET/POST
slow: REST/SOAP/RPC_CALL


It doesn't matter.......

if you have the chance to make from your servlet component a GET query
instead of using Webservices like (SOAP ....), I would heavily advise
you todo this.

You have to consider, you have a lots of users, and webservices CAN
REALLY SLOW DOWN your app, when many requests at the same time is being
done.



More I don't like to tell you.



Have a nice day.



Tamer


Am 10.10.2012 05:08, schrieb Wagner Marques:

>
> My apologises Tamer, sometimes (or often), my english is not good enougth!
>
>
> In my opinion, you are completely correct about the rest be the fastest
> and easily method to make the "first request", no doubt about it.
> I think that to use camel to receive this "first request" can be in this
> context too.
>
>
> I was trying to say, with the expression "camel servlet component", that
> I am considering to use camel to receive this "first request".
> This url introduce referred component:
> http://camel.apache.org/servlet.html.
>
>
> But why use camel to receive this first request? Because camel provide
> methods to transform this first request data in a soap request to the
> webservice.
> This is a Enterprise Integration Pattern:
> http://camel.apache.org/normalizer.html.
> I thinks that this a suitable strategy for me because I am using
> servicemix and camel is naturally integrated in there. But camel is
> simple jar and can be integrated in a java webapp without problems.
> Beside this, camel can receive the soap response back and work with
> response data to construct a suitable response for the "first request"
> using message tranformation pattern again.
>
> To receive the first request with a rest request, camel provide
> http://camel.apache.org/cxfrs.html component that can work within same
> strategy above.
>
>
> But I am still studing this strategy and I am open to new remarks about it.
>
>
> best regards
>
>
>
>
>
>
> 2012/10/9 Tamer Higazi <[hidden email]
> <mailto:[hidden email]>>
>
>     Hi Marques!
>     What do you mean witrh this sentence?!
>
>     As I understood, you will make a soap request from the server side
>     servlet component.....
>
>     Consider:
>
>     socket->get/post->soap/rest/rpc_call
>
>     socket is the fastest way, on 2nd line I would get something else.
>
>
>     SOAP is usually offered for OOP issues to execute remote function calls.
>     nothing else, but is on the other side very slow.
>
>
>     if you have the chance to make a "get" query, I would persist in that
>     instead of "Webservices".
>
>
>
>
>     Tamer
>
>     Am 09.10.2012 15:03, schrieb Wagner Marques:
>
>     >
>     > But I wandering why general interface makes soap request so easely fo
>     > its users? I am little envious gi users at this point :)
>     >
>     > regards
>     >
>     ________________________________________________________
>     Dojo Toolkit: http://dojotoolkit.org/
>     Tutorials: http://dojotoolkit.org/documentation/
>     Reference Guide: http://dojotoolkit.org/reference-guide
>     API Documentation: http://dojotoolkit.org/api
>
>     [hidden email]
>     <mailto:[hidden email]>
>     To unsubscribe, visit:
>     http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>
>
>
>
> --
> Wagner França Marques
> 54731643 (vivo)
> 70768470 (claro)
>
>
>
> ________________________________________________________
> Dojo Toolkit: http://dojotoolkit.org/
> Tutorials: http://dojotoolkit.org/documentation/
> Reference Guide: http://dojotoolkit.org/reference-guide
> API Documentation: http://dojotoolkit.org/api
>
> [hidden email]
> To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>

________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: DOJO AJAX *HELP*

wagner


I see... camel works with websockets too and could be a good choice when some message transformation is needed, otherwise I think websocket is the way.

I've never used websockets, time to learn...

thanks for your remarks!!!



2012/10/10 Tamer Higazi <[hidden email]>
Hi Wagner,

fastest timing: Socket, Websocket
2nd fastest: GET/POST
slow: REST/SOAP/RPC_CALL


It doesn't matter.......

if you have the chance to make from your servlet component a GET query
instead of using Webservices like (SOAP ....), I would heavily advise
you todo this.

You have to consider, you have a lots of users, and webservices CAN
REALLY SLOW DOWN your app, when many requests at the same time is being
done.



More I don't like to tell you.



Have a nice day.



Tamer


Am 10.10.2012 05:08, schrieb Wagner Marques:
>
> My apologises Tamer, sometimes (or often), my english is not good enougth!
>
>
> In my opinion, you are completely correct about the rest be the fastest
> and easily method to make the "first request", no doubt about it.
> I think that to use camel to receive this "first request" can be in this
> context too.
>
>
> I was trying to say, with the expression "camel servlet component", that
> I am considering to use camel to receive this "first request".
> This url introduce referred component:
> http://camel.apache.org/servlet.html.
>
>
> But why use camel to receive this first request? Because camel provide
> methods to transform this first request data in a soap request to the
> webservice.
> This is a Enterprise Integration Pattern:
> http://camel.apache.org/normalizer.html.
> I thinks that this a suitable strategy for me because I am using
> servicemix and camel is naturally integrated in there. But camel is
> simple jar and can be integrated in a java webapp without problems.
> Beside this, camel can receive the soap response back and work with
> response data to construct a suitable response for the "first request"
> using message tranformation pattern again.
>
> To receive the first request with a rest request, camel provide
> http://camel.apache.org/cxfrs.html component that can work within same
> strategy above.
>
>
> But I am still studing this strategy and I am open to new remarks about it.
>
>
> best regards
>
>
>
>
>
>
> 2012/10/9 Tamer Higazi <[hidden email]
> <mailto:[hidden email]>>
>
>     Hi Marques!
>     What do you mean witrh this sentence?!
>
>     As I understood, you will make a soap request from the server side
>     servlet component.....
>
>     Consider:
>
>     socket->get/post->soap/rest/rpc_call
>
>     socket is the fastest way, on 2nd line I would get something else.
>
>
>     SOAP is usually offered for OOP issues to execute remote function calls.
>     nothing else, but is on the other side very slow.
>
>
>     if you have the chance to make a "get" query, I would persist in that
>     instead of "Webservices".
>
>
>
>
>     Tamer
>
>     Am 09.10.2012 15:03, schrieb Wagner Marques:
>
>     >
>     > But I wandering why general interface makes soap request so easely fo
>     > its users? I am little envious gi users at this point :)
>     >
>     > regards
>     >
>     ________________________________________________________
>     Dojo Toolkit: http://dojotoolkit.org/
>     Tutorials: http://dojotoolkit.org/documentation/
>     Reference Guide: http://dojotoolkit.org/reference-guide
>     API Documentation: http://dojotoolkit.org/api
>
>     [hidden email]
>     <mailto:[hidden email]>
>     To unsubscribe, visit:
>     http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>
>
>
>
> --
> Wagner França Marques
> 54731643 (vivo)
> 70768470 (claro)
>
>
>
> ________________________________________________________
> Dojo Toolkit: http://dojotoolkit.org/
> Tutorials: http://dojotoolkit.org/documentation/
> Reference Guide: http://dojotoolkit.org/reference-guide
> API Documentation: http://dojotoolkit.org/api
>
> [hidden email]
> To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>

________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest



--
Wagner França Marques
54731643 (vivo)
70768470 (claro)


________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest