hello

THE PROBLEM
------------------------------------------------------------
I have an WCF operation exposed using an endpoint configured to use
"webHttpBinding". My problem is, while response code it seems to
suggest that operation was indeed completed successfully and returned
array of one "Blog" object (and I ran debugger on Visual Studio
against WCF operation code and it returned successfully and returned
one "Blog" object),  "responseJSON", "responseText" was all NULL (I am
expecting one "Blog" object, as seen on debugger attached to WCF on
server side).


DETAIL - WCF Operation Contract
------------------------------------------------------------
[WebGet(BodyStyle = WebMessageBodyStyle.WrappedRequest,
                                                         ResponseFormat = 
WebMessageFormat.Json)]
                Blog[] GetBlogstring strLogon);



DETAIL - Javascript invoke using prototype.js - Ajax.Request
------------------------------------------------------------
I called it from Javascript:

        function FindBlog() {
                var url = '<%=FindBlogServiceOpURL%>';
                var oUserNameTxt = document.getElementById('txtUserName');
                var oParam = 'strLogon=' + oUserNameTxt.value;

                var myAjax = new Ajax.Request(
                        url,
                        {
                                method: 'get',
                                contentType:
                                'application/json',
                                parameters: oParam,
                                onComplete: showResponse,
                               onFailure: function() {
                                   alert("FindAssociatedGroup call
                                   failed.");
                                }
                         }
                  );
        }


DETAIL - Javascript response handler
------------------------------------------------------------
        function showResponse(originalRequest) {
                var oLoading = document.getElementById('loadingimg');
                var oDivGroups = document.getElementById('divgroups');
                var oLoadingFailed = document.getElementById('loadingfailed');

                                /* REF: 
http://www.prototypejs.org/api/ajax/response

                                        0 corresponds to "Uninitialized"
                                        1 to "Loading"
                                        2 to "Loaded"
                                        3 to "Interactive"
                                        4 to "Complete"
                                */
                if (originalRequest.readyState == 4) {
                        alert('showResponse, operation completed. ' + 
originalRequest);
                        alert('responseJSON: ' + originalRequest.responseJSON + 
',
headerJSON: ' + originalRequest.headerJSON + ', responseText: ' +
originalRequest.responseText);

                        ...
                        oDivBlogs.innerHTML = originalRequest.responseJSON;

                } else {
                        alert('showResponse, operation failed.' + 
originalRequest);
                        ... more code ...
                }
        }

Any suggestion please? Thanks


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to