Test-ActiveSyncConnectivity fails with The remote server returned an error: (400) Bad Request.

Hi all,
I'm on the process of transition from Exchange 2003 to 2010, everything is going perfectly alright however ActiveSync is bugging me!
when I try to test activesync I get the following error:
[PS] C:\>Test-ActiveSyncConnectivity -MailboxCredential $user -TrustAnySSLCertificate |FL
RunspaceId                  : 136b8f68-26ec-4e29-a5bb-cf5ee816e04b
LocalSite                   : SITE
SecureAccess                : True
VirtualDirectoryName        :
Url                         :
UrlType                     : Unknown
Port                        : 0
ConnectionType              : Plaintext
ClientAccessServerShortName : cas01
LocalSiteShortName          : SITE
ClientAccessServer          : CASSERVERNAME
Scenario                    : Options
ScenarioDescription         : Issue an HTTP OPTIONS command to retrieve the Exchange ActiveSync protocol version.
PerformanceCounterName      :
Result                      : Success
Error                       :
UserName                    : user1
StartTime                   : 12/12/2012 1:02:23 PM
Latency                     : 00:00:00.0312496
EventType                   : Success
LatencyInMillisecondsString : 31.25
Identity                    :
IsValid                     : True
RunspaceId                  : 136b8f68-26ec-4e29-a5bb-cf5ee816e04b
LocalSite                   : Reckon_NS
SecureAccess                : True
VirtualDirectoryName        :
Url                         :
UrlType                     : Unknown
Port                        : 0
ConnectionType              : Plaintext
ClientAccessServerShortName : CASSERVERNAME
LocalSiteShortName          : SITE
ClientAccessServer          : CASSERVERNAME
Scenario                    : FolderSync
ScenarioDescription         : Issue a FolderSync command to retrieve the folder hierarchy.
PerformanceCounterName      : DirectPush Latency
Result                      : Failure
Error                       : [System.Net.WebException]: The remote server returned an error: (400) Bad Request.
                              HTTP response headers:
                              MS-Server-ActiveSync: 6.5.7638.1
                              Content-Length: 46
                              Cache-Control: private
                              Content-Type: text/html
                              Date: Wed, 12 Dec 2012 02:02:23 GMT
                              Server: Microsoft-IIS/7.5
                              X-AspNet-Version: 2.0.50727
                              X-Powered-By: ASP.NET
UserName                    : user1
StartTime                   : 12/12/2012 1:02:23 PM
Latency                     : -00:00:01
EventType                   : Error
LatencyInMillisecondsString :
Identity                    :
IsValid                     : True
environment: 
Ex 2003 'Exchange' virtual directory permission: Integrated Windows Authentication, Basic 
Ex 2003 'OMA' permission: Basic Authentication
Ex 2003 'ActiveSync' permission: Integrated, Basic
Ex 2010 successfully redirects users from 2010 to 2003 webmail if you login to OWA with a mailbox on 2003

Yes Martina,
It has been done through ESM 
I cannot test using testexchangeconnectivity.com since I cannot put the 2010 one into production, I will get into trouble if I change the DNS record to the new mail server!
Yes, EAS works perfectly fine with 2010 mailboxes.
OK.
It might be that it's not possible to run Test-ActiveSyncConnectivity against a mailbox stored in Exchange 2003.
Installing KB937031 and enabling Windows Authentication is really all that needs to be done in EX03, in order for Exchange 2010 to proxy the EAS requests.
Martina Miskovic

Similar Messages

  • "the remote server returned an error (400) bad request." can't able to upload file size 1 MB

    I cant able to upload the file size >1 MB its showing error."the remote server returned an error (400) bad request."
    any one kindly help to fix the issue.

    Hi,
    Are you trying thru OOB or how..
    Please check the "maximum file size for sharepoint".
    refer below links for the same.
    https://angler.wordpress.com/2012/03/21/increase-the-sharepoint-2010-upload-file-size-limit/
    https://msdn.microsoft.com/en-us/library/ff487972.aspx
    Don't forget to mark it as an Answer if it resolves your problem or Vote Me if it useful.
    Mahesh

  • ESB Portal : The remote server returned an error: (400) Bad Request

    Hi,
    I am getting the below error message while trying to access ESB Portal:
    ========================
    Event code: 3005 
    Event message: An unhandled exception has occurred. 
    Event time: 12/18/2013 12:07:10 PM 
    Event time (UTC): 12/18/2013 12:07:10 PM 
    Event ID: 2a429911fb69455ab3b77348c8b259ce 
    Event sequence: 10 
    Event occurrence: 2 
    Event detail code: 0 
    Application information: 
        Application domain: /LM/W3SVC/1/ROOT/ESB.Portal-1-130318418493427545 
        Trust level: Full 
        Application Virtual Path: /ESB.Portal 
        Application Path: C:\Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\ESB.Portal\ 
        Machine name: WIN-HG1MJEC7KJS 
    Process information: 
        Process ID: 3220 
        Process name: w3wp.exe 
        Account name: NT AUTHORITY\SYSTEM 
    Exception information: 
        Exception type: WebException 
        Exception message: The remote server returned an error: (400) Bad Request. 
    Request information: 
        Request URL: http://localhost/esb.portal/default.aspx 
        Request path: /esb.portal/default.aspx 
        User host address: ::1 
        User: WIN-HG1MJEC7KJS\ESBUser 
        Is authenticated: True 
        Authentication Type: Negotiate 
        Thread account name: NT AUTHORITY\SYSTEM 
    Thread information: 
        Thread ID: 4 
        Thread account name: NT AUTHORITY\SYSTEM 
        Is impersonating: False 
        Stack trace:    at System.Net.HttpWebRequest.GetResponse()
       at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
    Custom event details: 
    ====================
    I also looked at thread : http://social.msdn.microsoft.com/Forums/en-US/1fb510a8-9f4b-4e1e-9261-3273b037786c/esbportal-bad-request-400?forum=biztalkesb
    However didn't able to find the workaround for the same.
    Best Regards,
    Harkirat

    Hi,
    On a local server you don't have to change the web.config if you use local Windows Groups. Check if the User is added to the "BizTalk Server Administrators" Group. Also check if the Group or the User has rights to access EsbExceptionDb & ESBAdmin
    database. You also have to enable "Windows Authentication" in IIS for the ESB.Portal.
    Local Machine settings:
    ESB.Exceptions.Service\Web.config
    <connectionStrings><add providerName="System.Data.SqlClient" connectionString="Integrated Security=SSPI;Data Source=.;Initial Catalog=EsbExceptionDb" name="EsbExceptionDbConnectionString"/></connectionStrings>
    C:\Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\ESB.Portal\Web.config
    <connectionStrings>
    <add name="AdminDatabaseServer" providerName="System.Data.SqlClient" connectionString="Network Library=dbmssocn;Data Source=(local);Integrated Security=True;Initial Catalog=ESBAdmin;"/>
    </connectionStrings>
    <authentication mode="Windows"/>
    <authorization><allow roles="BizTalk Application Users"/>
    <allow roles="BizTalk Server Administrators"/>
    <allow roles="Administrators"/>
    <deny users="*"/>
    </authorization>
    Kind regards,
    Tomasso Groenendijk
    Blog 
    |  Twitter
    MCTS BizTalk Server 2006, 2010
    If this answers your question please mark it accordingly

  • Error occurred in deployment step 'Uninstall app for SharePoint': The remote server returned an error: (502) Bad Gateway.

    Installed SP 2013 Foundation in my Hyper-V machine
    Created and done all the steps mentioned here http://blogs.msdn.com/b/shariq/archive/2013/05/07/how-to-set-up-high-trust-apps-for-sharepoint-2013-amp-troubleshooting-tips.aspx && http://msdn.microsoft.com/en-us/library/office/fp179901%28v=office.15%29.aspx
    for self signed certificate
    copied those two certificates in my local machine(base machine) D drive
    (D:\Cert)
    Both VM and base machine are in same domain
    Installed VS 2013 in my base machine and create a Provided hosted app with the copied certificates, (For creation i followed the above mentioned URL)
    Just created and hit F5 to run in my base machine, but getting this error
    Error occurred in deployment step 'Uninstall app for SharePoint': The remote server returned an error: (502) Bad Gateway.
    Please help me to resolve this issue, trying to figure out from last 2 days
    Thanks in Advance
    Arun

    Hi Harminder,
    This happens because an app has already been deployed and you are deploying it again using the same version.
    Resolution:
    Open the AppManifest.xml file and change the version.
    Vivek Jagga - MCTS SharePoint
    SharePointExcellence

  • Risport Service: The remote server returned an error: (502) Bad Gateway

    Hi All.
    I am using the CUCM (System version: 6.1.3.2000-1) Risport function to get device information.
    When trying to connect to the service (https://<CUCM_IP>:8443/realtimeservice/services/RisPort) I receive the folowing error:
    The remote server returned an error: (502) Bad Gateway
    When entering the same URL into the browser on the same application server I get a Security Alert, user prompt and eventually the expected screen. So the service is running, but somhow I can not connect to it using the application.
    Does anyone know how to solve this?
    Thanks in advance

    It is an C#.NET Windows Service.
    I have solved "the problem". The service was running with "local system account". That user did not had the right proxy rights to connect to the CUCM service.
    So I changed the Windows Service user to the account that I use to login on that machine (with the right proxy rights) and now it is working ;-)
    I figured this out because when I logged into that machine, with my account, I could connect to the CUCM service without any problems with my browser.

  • Error: Load operation failed for query 'GetAuthenticationInfo'. The remote server returned an error: NotFound.

    Hello,
    I have a lightswitch web-application in development, which I need to copy from one computer to the other. I have tried doing it both through Git and by simply copying the solution and opening the project on another machine. The project builds without errors,
    but when I try to debug it, it opens a web-browser, loads to 100% and pops up an error - Load operation failed for query 'GetAuthenticationInfo'. The remote server returned an error: NotFound.
    Now, I have tried repairing Visual Studio on my machine, reinstalling .NET framework and setting  <basicAuthentication enabled="false" /> in web.config, yet it still does not run.
    When using Fiddler, it shows an error while loading the application - "HTTP/1.1 500 Internal Server Error" , which I honestly don't know what it means.
    The application uses ComponentOne and Telerik modules, but they are both installed on both machines. 
    The application does run perfectly on the original machine, but it is not working on any other one.
    Both machines are using Win 8.1 and Visual Studio 2013 Update 4.
    I have tried to look this up online, but most people's problem are when they are deploying the app, not just debugging. I would be really happy for any help with this issue.
    Thanks!

    I have the same problem on one of my development machines. Whenever I create a new project, the System.IdentityModel.Tokens.Jwt nuget package is not referenced properly. The project compiles correctly but you are not able to debug as I get the same error
    as you.
    If you open up your references and there is an error next to any of your references make sure that you correct them. In the case of the jwt reference error, I have to remove the jwt reference and then add it back from the packages folder.
    This may not be your problem but could point you in a direction?

  • SharePoint List Error :[DataSource.Error] SharePoint: Request failed: The remote server returned an error: (500) Internal Server Error. (An error occurred while processing this request.)

    When I connect to the SharePoint site that contains the lists I need to build my query from , Power Query enumerates the list and displays them in the tool. I can click on the system tables and view the records but any table
    in the list I created returns this  error.
    I can connect fine with InfoPath
    [DataSource.Error] SharePoint:   Request failed: The remote server returned an error: (500) Internal Server   Error. (An error occurred while processing this request.)
    thank you for your help
    Andrew
     

    Hi Andrew. In order for us diagnose this issue, you'll need to capture some network traces using a tool such as Fiddler and share them by sending a Frown.
    To capture a trace using Fiddler, start Fiddler, enable the Tools > Fiddler Options > HTTPS > Decrypt HTTPS traffic option, start the capture, reproduce your issue, then stop and save the capture. You can find more information here.
    Once you've done that, please send a Frown through the Power Query ribbon and attach the traces.
    Thanks,
    Ehren

  • DataSource.Error: SharePoint: Request failed: The remote server returned an error: (500) Internal Server Error.

    Seeing this error when retrieving data from a SharePoint list. I have full access to the list. Any help would be appreciated.
    DataSource.Error: SharePoint: Request failed: The remote server returned an error: (500) Internal Server Error. (An error occurred while processing this request.)
    Details:
    https://xyz/_vti_bin/ListData.svc/ListName
       

    I think I figured out how to use Fiddler. Here's the information I captured-
    This is a Tunnel. Status: OPEN, Raw Bytes Out: 3,797; In: 7,604
    The selected session is a HTTP CONNECT Tunnel. This tunnel enables a client to send raw traffic (e.g. HTTPS-encrypted streams or WebSocket messages) through a HTTP Proxy Server (like Fiddler).
    To enable Fiddler's HTTPS-decryption feature and view decrypted traffic, click Tools > Fiddler Options > HTTPS.
    Request Count:   1
    Bytes Sent:      107  (headers:107; body:0)
    Bytes Received:  107  (headers:107; body:0)
    Tunnel Sent:     3,797
    Tunnel Received: 7,604
    ACTUAL PERFORMANCE
    ClientConnected: 11:06:11.389
    ClientBeginRequest: 11:06:11.395
    GotRequestHeaders: 11:06:11.395
    ClientDoneRequest: 11:06:11.395
    Determine Gateway: 0ms
    DNS Lookup:   176ms
    TCP/IP Connect: 77ms
    HTTPS Handshake: 0ms
    ServerConnected: 11:06:11.649
    FiddlerBeginRequest: 11:06:11.649
    ServerGotRequest: 11:06:11.649
    ServerBeginResponse: 00:00:00.000
    GotResponseHeaders: 00:00:00.000
    ServerDoneResponse: 00:00:00.000
    ClientBeginResponse: 11:06:11.649
    ClientDoneResponse: 11:06:11.649
     Overall Elapsed: 0:00:00.254
    -= Fiddler Event Log =-
    See http://fiddler2.com/r/?FiddlerLog for details.
    10:33:33:8092 Fiddler Running...
    10:33:33:8118 Fiddler.Network.AutoProxy> AutoProxy Detection failed.
    10:33:33:8118 AutoProxy failed. Disabling for this network.
    10:33:33:8118 Windows 8+ AppContainer isolation feature detected.
    11:01:21:4125 HTTPSLint> Warning: ClientHello record was 382 bytes long. Some servers have problems with ClientHello's greater than 255 bytes. https://github.com/ssllabs/research/wiki/Long-Handshake-Intolerance
    11:01:21:4145 HTTPSLint> Warning: ClientHello record was 382 bytes long. Some servers have problems with ClientHello's greater than 255 bytes. https://github.com/ssllabs/research/wiki/Long-Handshake-Intolerance
    11:01:21:4185 HTTPSLint> Warning: ClientHello record was 382 bytes long. Some servers have problems with ClientHello's greater than 255 bytes. https://github.com/ssllabs/research/wiki/Long-Handshake-Intolerance
    11:01:21:4258 HTTPSLint> Warning: ClientHello record was 382 bytes long. Some servers have problems with ClientHello's greater than 255 bytes. https://github.com/ssllabs/research/wiki/Long-Handshake-Intolerance
    11:01:21:4268 HTTPSLint> Warning: ClientHello record was 382 bytes long. Some servers have problems with ClientHello's greater than 255 bytes. https://github.com/ssllabs/research/wiki/Long-Handshake-Intolerance
    11:01:21:4298 HTTPSLint> Warning: ClientHello record was 382 bytes long. Some servers have problems with ClientHello's greater than 255 bytes. https://github.com/ssllabs/research/wiki/Long-Handshake-Intolerance
    11:01:21:4398 HTTPSLint> Warning: ClientHello record was 382 bytes long. Some servers have problems with ClientHello's greater than 255 bytes. https://github.com/ssllabs/research/wiki/Long-Handshake-Intolerance
    11:01:21:4398 HTTPSLint> Warning: ClientHello record was 382 bytes long. Some servers have problems with ClientHello's greater than 255 bytes. https://github.com/ssllabs/research/wiki/Long-Handshake-Intolerance
    11:01:21:4518 HTTPSLint> Warning: ClientHello record was 382 bytes long. Some servers have problems with ClientHello's greater than 255 bytes. https://github.com/ssllabs/research/wiki/Long-Handshake-Intolerance
    11:01:21:4518 HTTPSLint> Warning: ClientHello record was 382 bytes long. Some servers have problems with ClientHello's greater than 255 bytes. https://github.com/ssllabs/research/wiki/Long-Handshake-Intolerance
    11:01:21:4528 HTTPSLint> Warning: ClientHello record was 382 bytes long. Some servers have problems with ClientHello's greater than 255 bytes. https://github.com/ssllabs/research/wiki/Long-Handshake-Intolerance
    11:01:21:4828 HTTPSLint> Warning: ClientHello record was 382 bytes long. Some servers have problems with ClientHello's greater than 255 bytes. https://github.com/ssllabs/research/wiki/Long-Handshake-Intolerance
    11:01:21:5789 HTTPSLint> Warning: ClientHello record was 382 bytes long. Some servers have problems with ClientHello's greater than 255 bytes. https://github.com/ssllabs/research/wiki/Long-Handshake-Intolerance
    11:01:21:5820 HTTPSLint> Warning: ClientHello record was 382 bytes long. Some servers have problems with ClientHello's greater than 255 bytes. https://github.com/ssllabs/research/wiki/Long-Handshake-Intolerance
    11:01:21:5879 HTTPSLint> Warning: ClientHello record was 382 bytes long. Some servers have problems with ClientHello's greater than 255 bytes. https://github.com/ssllabs/research/wiki/Long-Handshake-Intolerance
    11:01:21:6179 HTTPSLint> Warning: ClientHello record was 382 bytes long. Some servers have problems with ClientHello's greater than 255 bytes. https://github.com/ssllabs/research/wiki/Long-Handshake-Intolerance
    11:01:21:6530 HTTPSLint> Warning: ClientHello record was 382 bytes long. Some servers have problems with ClientHello's greater than 255 bytes. https://github.com/ssllabs/research/wiki/Long-Handshake-Intolerance
    11:01:21:6924 HTTPSLint> Warning: ClientHello record was 382 bytes long. Some servers have problems with ClientHello's greater than 255 bytes. https://github.com/ssllabs/research/wiki/Long-Handshake-Intolerance

  • Power BI analysis services connector - the remote server returned an error (403)

    Hi all, does any one have any suggestions what to try to identify the configuration problem I have?
    I have, a SSAS 2012 tabular instance with SP2, there is a database on the instance with a read role with everyone assigned permissions. 
    When configuring the Power BI analysis services connector, at the point where you enter Friendly Name, Description and Friendly error message, when you click next I receive the error "The remote server returned an error (403)." 
    I've tested connecting to the database from Excel on a desktop and connect fine.
    I don't use a "onmicrosoft" account so don't have that problem to deal with.
    We use Power BI Pro with our Office 365. As far as I can tell that part is working ok as I pass that stage of the configuration with a message saying connected to Power BI.
    The connector is installed on the same server as tabular services, its a Win2012 Standard server. The tabular instance is running a domain account that is the admin account for the instance (this is a dev environment) that account is what I've used in the
    connector configuration. It's also a local admin account. There is no gateway installed on the server.
    Any help would be greatly appreciated, thanks, Brian
    Brian Searle

    Brian-
    One other common issue I've seen is the UPN not quite matching. Log onto the SSAS server as the user who's logged into Power BI. Then open a command prompt and run:
    whoami /upn
    Hopefully the UPN it says will match your EffectiveUserName test and will match exactly how you're signing into the Power BI site.
    If that doesn't work, your best bet is to go to
    http://support.powerbi.com/ and click Contact Support and describe this situation and someone from the Power BI support team should get in touch with you to troubleshoot.
    http://artisconsulting.com/Blogs/GregGalloway

  • Urgent help On as2 error The remote server returned an error: (500) Internal Server Error.

    hi,
    im configured the as2 partner setup as per this http://msdn.microsoft.com/en-us/library/bb246129(BTS.20).aspx.
    but when im process file , then file try hit partner url goes dyhradated state,then failed. then i got below error.
    The remote server returned an error: (500) Internal Server Error.
    please any help..
    Thanks

    500 server error could be due to anyone of the following reasons:
    Party configuration is wrong. Party properties/configurations have  to be discussed upfront with the source/destination system and have to be in-line with
    them.
    Certificates have to be deployed in correct folders based on      certificate types like private/public/signed etc.
    Firewall (or network components) has to be opened accordingly for parties(systems) to interact. This change has to be done at the both the levels, source and destination.
    If you receive it through HTTPReceive.dll (may uses this for AS2), you have to check its configurations.
    Also 500 error, could occur even if your BizTalk artifacts has not been configured/deployed/enabled properly.
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • ASMX web service and The remote server returned an error: (500) Internal Server Error issue

    i have developed a very small web service and which is hosted along with our web site. our webservice url is
    http://www.bba-reman.com/Search/SearchDataIndex.asmx
    web service code
    namespace WebSearchIndex
    #region SearchDataIndex
    /// <summary>
    /// SearchDataIndex is web service which will call function exist in another library for part data indexing
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
    // [System.Web.Script.Services.ScriptService]
    public class SearchDataIndex : System.Web.Services.WebService
    //public AuthHeader ServiceAuth=null;
    public class AuthHeader : SoapHeader
    public string Username;
    public string Password;
    #region StartIndex
    /// <summary>
    /// this function will invoke CreateIndex function of SiteSearch module to reindex the data
    /// </summary>
    [WebMethod]
    public string StartIndex(AuthHeader auth)
    string strRetVal = "";
    if (auth.Username == "Admin" && auth.Password == "Admin")
    strRetVal = SiteSearch.CreateIndex(false);
    else
    SoapException se = new SoapException("Failed : Invalid credentials",
    SoapException.ClientFaultCode,Context.Request.Url.AbsoluteUri,new Exception("Invalid credentials"));
    throw se;
    return strRetVal;
    #endregion
    #endregion
    when i was calling that web service from my win apps using
    HttpWebRequest
    class then getting error The remote server returned an error: (500) Internal Server Error
    here is code of my win apps from where i am calling web service
    string strXml = "";
    strXml = "<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'><s:Body><StartIndex xmlns='http://tempuri.org/' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'><auth><Username>joy</Username><Password>joy</Password></auth></StartIndex></s:Body></s:Envelope>";
    string url = "http://www.bba-reman.com/Search/SearchDataIndex.asmx";
    HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
    req.Method = "POST";
    req.ContentType = "text/xml";
    req.KeepAlive = false;
    req.ContentLength = strXml.Length;
    StreamWriter streamOut = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII);
    streamOut.Write(strXml);
    streamOut.Close();
    StreamReader streamIn = new StreamReader(req.GetResponse().GetResponseStream());
    string strResponse = streamIn.ReadToEnd();
    streamIn.Close();
    i am just not being able to understand when this line execute
    StreamReader streamIn = new StreamReader(req.GetResponse().GetResponseStream());
    then getting the error The remote server returned an error: (500) Internal Server Error
    not being able to understand where i made the mistake. mistake is in the code of web service end or in calling code?
    help me to fix this issue. thanks

    Hi Mou,
    I just tried your win app code about calling web service, but failed. I got the 500 error after I called your service:
    The error message I quoted from Fiddler:
    <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>System.Web.Services.Protocols.SoapException: Failed : Invalid credentials ---&gt; System.Exception: Invalid credentials
    --- End of inner exception stack trace ---
    at BBAReman.WebSearchIndex.SearchDataIndex.StartIndex(AuthHeader auth)</faultstring><faultactor>http://www.bba-reman.com/Search/SearchDataIndex.asmx</faultactor><detail /></soap:Fault></soap:Body></soap:Envelope>
    I am not totally sure that error occurred by the authentication. But I suggest you can try to add this service into your project using this method below:
    1.right click the Reference and select Add Service Reference
    2.input your service link and click "Go"
    And you can use this service as the following:
    private async void callService()
    ServiceReference1.SearchDataIndexSoapClient client =new ServiceReference1.SearchDataIndexSoapClient();
    var Str= await client.StartIndexAsync(new ServiceReference1.AuthHeader { Username = "Admin", Password = "Admin" });
    Please try it.
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Provider hosted app error message: The remote server returned an error: (429) Too Many Requests.

    Hi,
    I have a customer running a provider hosted app and in Sharepoint 2013. Things have been working fine but recently they keep experiencing an issue where the all the app parts on the page show the following error message. Does anyone have an idea what
    could be causing this problem and how I can fix it? The Sharepoint site and provider hosted app site are running on a Server 2008 R2 box with IIS 7.5.
    Server Error in '/Test.Sharepoint.App' Application.
    The remote server returned an error: (429) Too Many Requests.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.           
    Exception Details: System.Net.WebException: The remote server returned an error: (429) Too Many Requests.
    Source Error:
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    Stack Trace:
    [WebException: The remote server returned an error: (429) Too Many Requests.]
    System.Net.HttpWebRequest.GetResponse() +8527180
    Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute() +58
    Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb) +975
    Test.Sharepoint.AppWeb.Pages.LatestAnnouncement.GetLatestAnnouncement(Boolean showFullText) +610
    Test.Sharepoint.AppWeb.Pages.LatestAnnouncement.Page_Load(Object sender, EventArgs e) +764
    System.Web.UI.Control.LoadRecursive() +71
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18034
    Impreza Software Development

    Hi GuYumming,
    I have checked the Sharepoint site using Fiddler and my X-SharePointHealthScore stays consistently on 1, I have even refreshed the site and had the "(429) Too Many Requests" error happen right in front of me whilst Fiddler is running and when I look at the
    200 response for the Sharepoint site it is still showing "X-SharePointHealthScore: 1".
    I assume because of this I do not need to make any of the changes suggested in your article above?
    I have also been through the ULS logs and found the following 3 log entries that appear to relate to the issue but they do not really mean much to me so I am hoping that you can help:
    Begin CSOM Request ManagedThreadId=59, NativeThreadId=12476
    SPResourceTally(ClientServiceRequestDuration) value 1 + 150425 > 150000
    ResourceBudgetExceeded, sending throttled status code. Exception=Microsoft.SharePoint.SPResourceBudgetExceededException: ResourceBudgetExceeded     at Microsoft.SharePoint.SPResourceTally.Check(Int32 value)    
    at Microsoft.SharePoint.SPAggregateResourceTally.Check(SPResourceKind kind, Int32 value)     at Microsoft.SharePoint.Client.SPClientServiceHost.OnBeginRequest()
    Impreza Software Development

  • Provider-hosted Apps debug error: The remote server returned an error: (401) unauthorised

    Hi,
    Any help appreciated!!
    I'm getting this error: "The remote server returned an error: (401) unauthorised when I debug a provider-hosted app.  I get the error on this line:  
    HttpWebResponse response = (HttpWebResponse)request.GetResponse();
    See code below
    I created a high trust development environment following the instructions provided here:
    http://msdn.microsoft.com/en-us/library/office/fp179901(v=office.15).aspx and
    http://msdn.microsoft.com/library/office/fp179923
    I created a provider-hosted app with the intent to:
    create a SharePoint list in the appweb
    Use self-signed certificate, tokenhepler.cs and sharepointcontext.cs to retrieve current user context and access on SharePoint.  (No changes were made to tokenhelper.cs and sharepointcontext.cs)
    retrieve list items from the SharePoint list in a button click event handler on a default.aspx of the remote web
    What happens:
    The app is deployed successfully to the Dev site
    The SharePoint feature is deployed and activated
    The default.aspx page of the remote web loads
    The error (see image) is returned on clicking of the button
    My environment is an on-premise SharePoint 2013 with AD and my dev box is standalone windows 8.1 running Visual Studio Professional 2013 Update 3.
    The code block below is a copy of the default.aspx code-behind
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Microsoft.SharePoint.Client;
    using Microsoft.IdentityModel.S2S.Tokens;
    using System.Net;
    using System.IO;
    using System.Xml;
    using System.Data;
    using System.Xml.Linq;
    using System.Xml.XPath;
    namespace Idea.GeneratorWeb
    public partial class Default : System.Web.UI.Page
    SharePointContextToken contextToken;
    string accessToken;
    Uri sharepointUrl;
    protected void Page_PreInit(object sender, EventArgs e)
    Uri redirectUrl;
    switch (SharePointContextProvider.CheckRedirectionStatus(Context, out redirectUrl))
    case RedirectionStatus.Ok:
    return;
    case RedirectionStatus.ShouldRedirect:
    Response.Redirect(redirectUrl.AbsoluteUri, endResponse: true);
    break;
    case RedirectionStatus.CanNotRedirect:
    Response.Write("An error occurred while processing your request.");
    Response.End();
    break;
    protected void Page_Load(object sender, EventArgs e)
    //// The following code gets the client context and Title property by using TokenHelper.
    //// To access other properties, the app may need to request permissions on the host web.
    var spContext = SharePointContextProvider.Current.GetSharePointContext(Context);
    //var spContext = new ClientContext("MySPDevInstance");
    //spContext.Credentials = new NetworkCredential("username", "password");
    //using (var clientContext = spContext.CreateUserClientContextForSPHost())
    // clientContext.Load(clientContext.Web, web => web.Title);
    // clientContext.ExecuteQuery();
    // Response.Write(clientContext.Web.Title);
    string contextTokenString = TokenHelper.GetContextTokenFromRequest(Request);
    if (contextTokenString != null)
    // Get context token
    contextToken = TokenHelper.ReadAndValidateContextToken(contextTokenString, Request.Url.Authority);
    // Get access token
    sharepointUrl = new Uri(Request.QueryString["SPAppWebUrl"]);
    accessToken = TokenHelper.GetAccessToken(contextToken, sharepointUrl.Authority).AccessToken;
    // Pass the access token to the button event handler.
    Button1.CommandArgument = accessToken;
    protected void Button1_Click(object sender, EventArgs e)
    // Retrieve the access token that the Page_Load method stored
    // in the button's command argument.
    string accessToken = ((Button)sender).CommandArgument;
    if (IsPostBack)
    sharepointUrl = new Uri(Request.QueryString["SPAppWebUrl"]);
    // REST/OData URL section
    string oDataUrl = "/_api/Web/lists/getbytitle('Diagrams In Idea Generator')/items?$select=Title,Diagram,SharingStatus";
    // HTTP Request and Response construction section
    HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(sharepointUrl.ToString() + oDataUrl);
    request.Method = "GET";
    request.Accept = "application/atom+xml";
    request.ContentType = "application/atom+xml;type=entry";
    request.Headers.Add("Authorization", "Bearer " + accessToken);
    HttpWebResponse response = (HttpWebResponse)request.GetResponse();
    // Response markup parsing section
    XDocument oDataXML = XDocument.Load(response.GetResponseStream(), LoadOptions.None);
    XNamespace atom = "http://www.w3.org/2005/Atom";
    XNamespace d = "http://schemas.microsoft.com/ado/2007/08/dataservices";
    XNamespace m = "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata";
    List<XElement> entries = oDataXML.Descendants(atom + "entry")
    .Elements(atom + "content")
    .Elements(m + "properties")
    .ToList();
    var entryFieldValues = from entry in entries
    select new
    Character = entry.Element(d + "Title").Value,
    Actor = entry.Element(d + "Diagram").Value,
    CastingStatus = entry.Element(d + "SharingStatus").Value
    GridView1.DataSource = entryFieldValues;
    GridView1.DataBind();
    Any ideas what I might be doing wrong

    Hi ,
    Use the below code
    Public string GetAccessToken(){
    string sharePointSiteUrlHost =  Page.Request["SPHostUrl"].Tostring();
    string AccessToken = tokenHelper.GetS2SAccessTokenWithWindowsIdentity(sharePointSiteUrlHost, Request.LogonUserIdentity);
    return accessToken;
    Than initialize the ClientCOntext with the below Method
     private static ClientContext GetClientContextWithAccessTokenString(string targetUrl, object accessToken)
                ClientContext clientContext = new ClientContext(targetUrl);
                clientContext.AuthenticationMode = ClientAuthenticationMode.Anonymous;
                clientContext.FormDigestHandlingEnabled = false;
                clientContext.ExecutingWebRequest +=
                    delegate(object oSender, WebRequestEventArgs webRequestEventArgs)
                        webRequestEventArgs.WebRequestExecutor.WebRequest.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)";
                        webRequestEventArgs.WebRequestExecutor.RequestHeaders["Authorization"] =
                            "Bearer " + accessToken;
                return clientContext;
    use this clientCOntext and it will work.
    Do not use
    SharePointContextProvider
    Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer

  • The remote server returned an error: (401) Unauthorized

    We are attempting to upload a file to SharePoint on Office 365 and get the following error:
    The remote server returned an error: (401) Unauthorized.
    We also tried using NetworkCredentials and that got the following error: The remote server returned an error: (404) Not Found.
    The code is shown below.
    Any idea on to fix this error?
    public
    void uploadDocument(string
    siteurl, string username,
    SecureString securepassword,
    string domain,
    string filestreamPath =
    "NewDocument.docx",
    string serverRelativeUrl =
    "/Shared Documents/NewDocument.docx")
    ClientContext context =
    new
    ClientContext(siteurl);
            //context.Credentials = new NetworkCredential(username, securepassword, domain);
    context.Credentials = new
    SharePointOnlineCredentials(username, securepassword);
    using (FileStream
    fileStream =
    new
    FileStream(filestreamPath,
    FileMode.Open))
    ClientOM.File.SaveBinaryDirect(context,
    serverRelativeUrl, fileStream, true);

    Yes, it has access.  In fact, it has no problem getting the site properties using the code below.  It is just when I am uploading a file that the error occurs.
    public Web getProperties(string
    siteurl, string username,
    SecureString securepassword)
    Web web = null;
    // Starting with ClientContext, the constructor requires a URL to the
    // server running SharePoint.
    ClientContext context = new ClientContext(siteurl);
    // The SharePoint web at the URL.
    web = context.Web;
    // We want to retrieve the web's properties.
    context.Load(web);
    // Execute the query to the server.
    context.Credentials = new SharePointOnlineCredentials(username, securepassword);
    context.ExecuteQuery();
    return web;

  • Powershell Error for SharePoint Online -"The remote server returned an error: (407) Proxy Authentication Required."

    I am trying to call sharepoint online from powershell. Below is the code. I get 
    Exception calling "ExecuteQuery" with "0" argument(s): "The remote server returned an error: (407) Proxy Authentication Required."
    $loadInfo1 = [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client")
    $loadInfo2 = [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime")
    $webUrl = "ZZZZ"
    $username = "XXX"
    $password = "YYYY"
    $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($webUrl) 
    $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
    $web = $ctx.Web
    $lists = $web.Lists 
    $ctx.Load($lists)
    $ctx.ExecuteQuery()
    $lists| select -Property Title
    Raj-Shpt

    Hi,
    About how to access SharePoint online site using PowerShell, the blog below would be helpful:
    http://social.technet.microsoft.com/wiki/contents/articles/29518.csom-sharepoint-powershell-reference-and-example-codes.aspx
    Another two demos for your reference:
    http://www.hartsteve.com/2013/06/sharepoint-online-powershell/
    http://www.sharepointnutsandbolts.com/2013/12/Using-CSOM-in-PowerShell-scripts-with-Office365.html
    Thanks
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

Maybe you are looking for