Click here to Skip to main content
13,052,163 members (37,557 online)
Rate this:
Please Sign up or sign in to vote.
I am using ajax enabled wcf and deployed it on iis8. when i access the service from localhost the required result displayed

{"GetInsuranceResult":[{"ItemID":6,"ItemName":"Adam Insur ( Nov 19
2012  6:11PM )"},{"ItemID":7,"ItemName":"State Life ( Nov 19 2012  6:12PM )"},{"ItemID":8,"ItemName":"Jublie Ins ( Nov 19 2012  2:36PM
)"},{"ItemID":10,"ItemName":"State Life ( Mar  5 2013  3:26PM
)"},{"ItemID":13,"ItemName":"medicare ( Mar 25 2013  3:43PM
)"},{"ItemID":14,"ItemName":"medicate ( Mar 25 2013  3:44PM )"}]}

but when i access the service from client(through ip address) the result is different.

 {"GetInsuranceResult":[{"ItemID":7,"ItemName":"State Life2-edit ( Nov
 19 2012  6:12PM )"},{"ItemID":8,"ItemName":"Jublie Insurance Com ( Nov
 19 2012  2:36PM )"},{"ItemID":10,"ItemName":"State Life -3 ( Mar  5
 2013  3:26PM )"},{"ItemID":14,"ItemName":"medicate ( Mar 25 2013 
3:44PM )"},{"ItemID":15,"ItemName":"test ( Mar 27 2013  3:24AM
)"},{"ItemID":16,"ItemName":"new test ( Mar 27 2013  6:31AM )"}]}

And WCF web.config


        <binding crossDomainScriptAccessEnabled="true" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferPoolSize="524288"
          <readerQuotas maxDepth="32" maxStringContentLength="2147483647"
                      maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"  />


        <standardEndpoint name="" crossDomainScriptAccessEnabled="true" />
      <service name="PHRWCFService.Service1"  behaviorConfiguration="ServBehave">
        <!--Endpoint for SOAP-->
        <!--Endpoint for REST-->

        <behavior name="ServBehave">
          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>

        <!--Behavior for the REST endpoint for Help enability-->
        <behavior name="restPoxBehavior">
          <webHttp helpEnabled="true"/>
          <dataContractSerializer maxItemsInObjectGraph="2147483647" />
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>

        <requestLimits maxAllowedContentLength="2147483647" maxUrl="4294967295" maxQueryString="4294967295" />
    <directoryBrowse enabled="true" />
    <modules runAllManagedModulesForAllRequests="true" />
        <add name="Access-Control-Allow-Origin" value="*" />
        <add name="Access-Control-Allow-Headers" value="Content-Type" />

Can any one tell me why this problem occurred.

Posted 27-Mar-13 3:39am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 27 Mar 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100