MS Azure - Bad Request 400 Error

Hi, 
I have this line of code which throws a MobileServiceInvalidOperation exception every time the line of code is executed:
List<Account> accounts = await App.accountTable.Where(account => account.EmailAddress == email).ToListAsync();
This is the exception:
A first chance exception of type 'Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException' occurred in mscorlib.dll
Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException: The request could not be completed.  (Bad Request)
   at Microsoft.WindowsAzure.MobileServices.MobileServiceHttpClient.<ThrowInvalidResponse>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Microsoft.WindowsAzure.MobileServices.MobileServiceHttpClient.<SendRequestAsync>d__1d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.WindowsAzure.MobileServices.MobileServiceHttpClient.<RequestAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.WindowsAzure.MobileServices.MobileServiceTable.<ReadAsync>d__b.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.WindowsAzure.MobileServices.MobileServiceTable.<ReadAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.WindowsAzure.MobileServices.Query.MobileServiceTableQueryProvider.<Execute>d__8`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.WindowsAzure.MobileServices.Query.MobileServiceTableQueryProvider.<Execute>d__3`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.WindowsAzure.MobileServices.MobileServiceTableQuery`1.<ToListAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at eventsphere.Utilities.ValidationUtility.<CheckEmailExistsError>d__2.MoveNext()
I have a very similar line of code shown below which works perfectly fine:
List<Account> accounts = await App.accountTable.Where(account => account.Username == username).ToListAsync();
I am a bit puzzled by how one gives an error and the other doesn't.
This is my Accounts table definition:
CREATE TABLE [eventsphere].[Accounts] (
    [Id]           NVARCHAR (128)     DEFAULT (newid()) NOT NULL,
    [AccountId]    INT                IDENTITY (1, 1) NOT NULL,
    [Username]     NVARCHAR (MAX)     NULL,
    [EmailAddress] NVARCHAR (MAX)     NULL,
    [Password]     NVARCHAR (MAX)     NULL,
    [IsBusiness]   BIT                NOT NULL,
    [User_Id]      NVARCHAR (128)     NULL,
    [Business_Id]  NVARCHAR (128)     NULL,
    [Version]      ROWVERSION         NOT NULL,
    [CreatedAt]    DATETIMEOFFSET (7) DEFAULT (sysutcdatetime()) NOT NULL,
    [UpdatedAt]    DATETIMEOFFSET (7) NULL,
    [Deleted]      BIT                NOT NULL,
    CONSTRAINT [PK_eventsphere.Accounts] PRIMARY KEY NONCLUSTERED ([Id] ASC),
    CONSTRAINT [FK_eventsphere.Accounts_eventsphere.Businesses_Business_Id] FOREIGN KEY ([Business_Id]) REFERENCES [eventsphere].[Businesses] ([Id]),
    CONSTRAINT [FK_eventsphere.Accounts_eventsphere.Users_User_Id] FOREIGN KEY ([User_Id]) REFERENCES [eventsphere].[Users] ([Id])
GO
CREATE CLUSTERED INDEX [IX_CreatedAt]
    ON [eventsphere].[Accounts]([CreatedAt] ASC);
GO
CREATE NONCLUSTERED INDEX [IX_User_Id]
    ON [eventsphere].[Accounts]([User_Id] ASC);
GO
CREATE NONCLUSTERED INDEX [IX_Business_Id]
    ON [eventsphere].[Accounts]([Business_Id] ASC);
GO
CREATE TRIGGER [eventsphere].[TR_eventsphere_Accounts_InsertUpdateDelete] ON [eventsphere].[Accounts] AFTER INSERT, UPDATE, DELETE AS BEGIN UPDATE [eventsphere].[Accounts] SET [eventsphere].[Accounts].[UpdatedAt] = CONVERT(DATETIMEOFFSET, SYSUTCDATETIME())
FROM INSERTED WHERE inserted.[Id] = [eventsphere].[Accounts].[Id] END
This is the DataObject for the Accounts table:
namespace eventsphereService.DataObjects
    public class Account : EntityData
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int AccountId { get; set; }
        public string Username { get; set; }
        [DataType(DataType.EmailAddress)]
        public string EmailAddress { get; set; }
        public string Password { get; set; }
        public bool IsBusiness { get; set; }
        public string User_Id { get; set; }
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        [ForeignKey("User_Id")]
        [Association("UserIdAssociation", "UserId", "Id")]
        [Column(Order = 1)]
        public virtual User User { get; set; }
        public string Business_Id { get; set; }
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        [ForeignKey("Business_Id")]
        [Association("BusinessIdAssociation", "BusinessId", "Id")]
        public virtual Business Business { get; set; }
Any input or advice would be appreciated.
Thanks in advance!

You would need to use Fiddler tool to analyze the request sent to the Mobile Services to ensure you are sending the right data.
Let me know if this helps in investigating this issue.
Abdulwahab Suleiman

Similar Messages

  • CloudPageBlob.Create() Method throws StorageException - Bad Request 400

    Hello,
    I am working with Windows Azure Storage Client Library Version 3.0.2.0 and trying to create a CloudPageBlob.
    when calling to CloudPageBlob.Create(long size) I get a  Microsoft.WindowsAzure.Storage.StorageException with message :
    "The remote server returned an error: (400) Bad Request."
    I used fiddler to get the HTTP result and this is what I get:
    <?xml version="1.0" encoding="utf-8"?><Error><Code>InvalidHeaderValue</Code><Message>The value for one of the HTTP headers is not in the correct format.
    RequestId:9977d564-c5b2-4957-a64e-17a65ea7834c
    Time:2014-02-05T18:05:35.8265038Z</Message><HeaderName>x-ms-blob-content-length</HeaderName><HeaderValue>22600</HeaderValue></Error>
    The number is the value sent to CloudPageBlob.Create() Method.
    my code looks like:
    CloudPageBlob pageBlob = _BlobContainer.GetPageBlobReference(blobName);
    var stream = new MemoryStream(streamBytes);
    long messageSizeBytes = stream.Length;
    pageBlob.Create(messageSizeBytes);
    long offset = 0;
    //writing to page blob in 4 KB chunks
    while (offset < messageSizeBytes)
    pageBlob.WritePagesAsync(stream, offset, null);
    offset = offset + 4096;
    Would be happy for any assistance.
    Thanks.

    Hi,
    Are you running this in the Storage Emulator (locally)? If so, what version are you running? Storage Emulator 2.2 doesn't work against the version of the Client library you are running.
    You probably need the
    preview version of the Storage Emulator. 
    Edward

  • Web service in LV2013: Change answer for "Bad Request", "Access Error"...

    Hi there,
    I am building a large application in LabVIEW 2013. I use a Web Service Server in LabVIEW to communicate to other systems. All in all the new Web Service functions in LV2013 work pretty fine and Web Services are easy to implement. In case any Web Service is unknown or parameters (in the URL) are wrong, it returnsto the client a default error message (like: "Access Error: 404 -- Not Found" or "Access Error: 400 -- Bad Request"). Is there a possibility to change this default messages and its format (all answers in my application are in JSON, but errors appear in HTML)? I really need this feature.
    I spent a lot of time in the internet for finding an answer - but it seems that I am the first who need this feature. Thank you very much for any ideas.
    Attachments:
    AnswerOk.PNG ‏4 KB
    BadRequest.PNG ‏6 KB

    Hi Andy,
    I found a workaround: I added some additional resources using a link "http://localhost:8079/"NAME"/:x/:x/:x/:x/:x/:x/:x​/:x/:x/:x/:x/:x/:x/:x/:x/:x" for each type (PUT, GET, POST, DELETE) where I handle the error message with the "Set HTTP Response Code VI"
    Attachments:
    ws_error.PNG ‏9 KB

  • Internet Explorer 11 Bad Request 400

    I have looked at all the help online for this issue and I've tried them. However, it's not fixing the issue. I can only open up google, but if I go to any other site it always says bad request. How do I fix this? 

    Hi,
    HTTP 400 bad request:It means the request can not be understood by web server because of malformed syntax.
    What have you changed since you started getting the HTTP 400 error?
    To narrow down the possibility, you can try using the onther broswers to check if this issue only occurs in IE.
    Anyway, you can refer to the general fix for 400 error in the article below:
    http://www.checkupdown.com/status/E400.html
    Thanks!
    Andy Altmann
    TechNet Community Support

  • Help! Bad Request 400

    No matter what i try to watch, it doesnt work. I cannot watch youtube, movies, or the Keynote. Please could someone help me! I have uninstalled and reinstalled numerous times, and i also tried a new user but I as the same result.
    So one please help. I'm not to smart with this so you have to help me through it!
    Thank YOu

    Ok...let's try a few things..
    First...go and download the latest flash plug-in.
    http://www.adobe.com/shockwave/download/download.cgi?P1ProdVersion=ShockwaveFlash
    Second... Open the Quicktime systems Preference panel...go to advance...mime settings...scroll to the bottom of that list...Miscellaneous...uncheck flash media.

  • 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

  • Axis adapter : Bad Request error

    Hi,
    I have a File to SOAP scenario (PI 7.0) where I am using AXIS adapter in the receiver SOAP adapter for NTLM authorisation. In the xml that I am trying to post, i have characters like &amp; because of which I am getting a Bad Request error. Is there a way to resolve this? thanks!
    Regards
    Pushpinder

    In file sender channel, i am using binary mode, so no encoding specified.
    I see the error in the receiver SOAP adapter -
    Error Axis: error in invocation: (400)Bad Request
    Error Exception caught by adapter framework: (400)Bad Request
    Error MP: Exception caught with cause (400)Bad Request
    Error Delivery of the message to the application using connection SOAP_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: (400)Bad Request: (400)Bad Request.
    Error The message status set to NDLV.

  • ABAP Proxy throws HTTP-400 error

    Hi,
    I've created an ABAP Proxy/Enterprise Service in ECC6.0 to consume a webservice that is created in NetWeaver 2004s. Now, when I want to test the proxy, it gives me the error message:
    SOAP:1.007 SRT: Unsupported xstream found: ("HTTP Code 400  : Bad Request")
    The error originates from class CX_AI_SYSTEM_FAULT
    I don't know if it is related to the proxy or with some system settings on ECC 6.0/Netweaver2004s.
    Any help or document reference is appreciated.
    Regards.

    I investigated a little and here are a couple of things you could try:
    - In note 1139406, they are talking about a scenario with HTTP error 404... I realize it is different than the 400 you get, but it may be worth checking if you have a similar problem as described there - it may give a clue what your problem is.
    - Try to check if the endpoint URL to which the request is sent is correct... it may be missing the style parameter, like ?style=document. Go to SOAMANAGER and take a look at the system settings, perhaps there is a wrongly formulated URL that is missing the style parameter.
    Hope this helps a little...

  • LightSwitch HTML Client pubished on azure get an 400.0 bad request error

    Well, I have this problem: "Request failed with status code '400' and the status text 'Bad Request'." when I run my LightSwitch HTMLClient application that are published in Azure Web Applications.
    I already look everywhere for 3 days and still could not find the answer to this problem.
    I hope someone in this forum can help me.
    Thanks.

    Hi, thank you for respond.
    let's see, the fiddler throws these:
    NOTICE: Don't follow the links, they are dummies
    GET http://myapp.azurewebsites.net/ApplicationData.svc/$metadata
    400 Bad Request (text/html)
    The Request
    GET /ApplicationData.svc/$metadata HTTP/1.1
    MaxDataServiceVersion: 3.0
    Accept: application/xml
    Referer: http://myapp.azurewebsites.net/HTMLClient/default.htm
    Accept-Language: es-MX,es;q=0.8,en-US;q=0.5,en;q=0.3
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko
    Connection: Keep-Alive
    Host: myapp.azurewebsites.net
    Cookie: ARRAffinity=354b4b5b87b2f1e4e8b6c19a5566c6e055bf3e4047b54b4d2ea846ba1b33d561; msls-client-parameters=preferredLanguage=es-MX; ASP.NET_SessionId=bkf52whz0rkufhcxmqrfuirm
    The Response
    HTTP/1.1 400 Bad Request
    Cache-Control: private
    Content-Type: text/html
    Server: Microsoft-IIS/8.0
    X-AspNet-Version: 4.0.30319
    X-Content-Type-Options: nosniff
    X-Powered-By: ASP.NET
    Date: Wed, 01 Apr 2015 04:23:39 GMT
    Content-Length: 1647
    Connection: Keep-Alive
    The azure logs, the lightswitch diagnostic and the debugger not show any difference from these.

  • Workflow manager IIS site throws a 403 Forbidden error and published workflows throw an error 400 bad request

    Hello All , Request your help on the below issue ,
    We have a single server farm SP 2013 where workflow was working as expected but its broken now , Not sure
    what caused this. Workflow manager is installed alongside Service Bus. Workflow Manager client is installed on the same SP server.
    We are able to create and publish the workflows from SP Designer without errors but when we start the workflow from SharePoint list we get an error " Sorry something went wrong". We have tried creating new workflows but the same problem.
    We receive the below error in event viewer.
    Error processing management request. Method: PUT, RequestUri: http://server URL:12291/$Workflows/89c767d2-82d2-4bd9-8e5e-dcace81d844f, Error: System.ArgumentException: The remote server returned an error: (400) Bad Request. ---> System.Net.WebException:
    The remote server returned an error: (400) Bad Request.
       at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
       at Microsoft.ServiceBus.Messaging.ServiceBusResourceOperations.GetAsyncResult`1.EndGetResponse(GetAsyncResult`1 thisPtr, IAsyncResult ar)
       at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)
       --- End of inner exception stack trace ---
    Server stack trace: 
    Exception rethrown at [0]: 
       at Microsoft.Workflow.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
       at Microsoft.Workflow.Gateway.HttpAsyncResult.End[TAsyncResult](IAsyncResult result)
       at Microsoft.Workflow.Gateway.WorkflowServiceGateway.<>c__DisplayClass6a.<EndCreateOrUpdateWorkflow>b__69()
       at Microsoft.Workflow.Gateway.WorkflowServiceGateway.ExceptionFilter[T](Func`1 body)
       at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
    ULS logs give below error 
    Error 1 - Microsoft.Workflow.Client.InternalServerException: An internal error occured. For more details, please see the server logs. HTTP headers received from the server - ActivityId: ba6e77cb-aaae-41a0-9cc8-1ea817d0045e. NodeId: Servername.
    Scope: /SharePoint/default/bc694777-7bbb-473e-ab2d-20087221a97a/5229793b-31a1-44b1-9b0b-374f38b762fd. Client ActivityId : a6daec9c-7139-7034-b4ee-edeb1f96ec2a. ---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
     at Microsoft.Workflow.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)    
     at Microsoft.Workflow.Client.HttpGetResponseAsyncResult`1.End(IAsyncResult result)    
     at Microsoft.Workflow.Client.ClientHelpers.SendRequest[T](HttpWebRequest request, T content)     -
     -- End of inner exception stack trace ---    
     at Microsoft.Workflow.Client.ClientHelpers.SendRequest[T](HttpWebRequest request, T content)    
     at Microsoft.Workflow.Client.WorkflowManagementClient.SendRequest[T](HttpWebRequest request, T content)    
     at Microsoft.Workflow.Client.WorkflowManager.Publish(WorkflowDescription description, Boolean terminateActiveInstances)    
     at Microsoft.SharePoint.WorkflowServices.FabricWorkflowManagementClient.PublishWorkflow(String serviceGroupName, WorkflowDescription workflow)    
     at Microsoft.SharePoint.WorkflowServices.WorkflowProxy.CreateDefinitionSubscription(String subscriptionName, String eventSource, List`1 eventTypes, String definitionName, IDictionary`2 metadata, WorkflowEventContext eventContext) StackTrace: 
     at Microsoft.Office.Server.Native.dll: (sig=35339f9c-8871-4ef1-9118-9c1bd0cb6598|2|microsoft.office.server.native.pdb, offset=131CE)
     at Microsoft.Office.Server.Native.dll: (offset=21B4D)
    Error 2 - Error publishing workflow subscription (republish or retry publish) information: Microsoft.Workflow.Client.InternalServerException: An internal error occured. For more details, please see the server logs. HTTP headers received
    from the server - ActivityId: ba6e77cb-aaae-41a0-9cc8-1ea817d0045e. NodeId:
    ServerName. Scope: /SharePoint/default/bc694777-7bbb-473e-ab2d-20087221a97a/5229793b-31a1-44b1-9b0b-374f38b762fd. Client ActivityId : a6daec9c-7139-7034-b4ee-edeb1f96ec2a. ---> System.Net.WebException: The remote server returned an error: (500)
    Internal Server Error.    
     at Microsoft.Workflow.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)    
     at Microsoft.Workflow.Client.HttpGetResponseAsyncResult`1.End(IAsyncResult result)    
     at Microsoft.Workflow.Client.ClientHelpers.SendRequest[T](HttpWebRequest request, T content)     -
     -- End of inner exception stack trace ---    
     at Microsoft.Workflow.Client.ClientHelpers.SendRequest[T](HttpWebRequest request, T content)    
     at Microsoft.Workflow.Client.WorkflowManagementClient.SendRequest[T](HttpWebRequest request, T content)    
     at Microsoft.Workflow.Client.WorkflowManager.Publish(WorkflowDescription description, Boolean terminateActiveInstances)    
     at Microsoft.SharePoint.WorkflowServices.FabricWorkflowManagementClient.PublishWorkflow(String serviceGroupName, WorkflowDescription workflow)    
     at Microsoft.SharePoint.WorkflowServices.WorkflowProxy.CreateDefinitionSubscription(String subscriptionName, String eventSource, List`1 eventTypes, String definitionName, IDictionary`2 metadata, WorkflowEventContext eventContext)    
     at Microsoft.SharePoint.WorkflowServices.FabricSubscriptionService.<>c__DisplayClass1.<CreateDefinitionSubscription>b__0()    
     at Microsoft.SharePoint.WorkflowServices.WorkflowServiceContextExtensions.InvokeWithEcosystemRetry(WorkflowServicesContext context, EcosystemRequiredMethod method)    
     at Microsoft.SharePoint.WorkflowServices.FabricSubscriptionService.CreateDefinitionSubscription(String subscriptionName, Guid eventSourceId, String eventSource, List`1 eventNames, String definitionName, IDictionary`2 metadata, WorkflowEventContext eventContext)
     at Microsoft.SharePoint.WorkflowServices.WorkflowSubscriptionStorageEventReceiver.ItemUpdating(SPItemEventProperties properties)
    Error3 - Microsoft.Workflow.Client.InternalServerException: An internal error occured. For more details, please see the server logs. HTTP headers received from the server - ActivityId: ba6e77cb-aaae-41a0-9cc8-1ea817d0045e. NodeId: ServerName.
    Scope: /SharePoint/default/bc694777-7bbb-473e-ab2d-20087221a97a/5229793b-31a1-44b1-9b0b-374f38b762fd. Client ActivityId : a6daec9c-7139-7034-b4ee-edeb1f96ec2a. ---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
     at  SPRequest.AddOrUpdateItem: UserPrincipalName=i:0).w|s-1-5-21-182846760-3036401646-508972453-351846, AppPrincipalName= ,bstrUrl=http://sharepointsite ,bstrListName={48A21758-9123-48F0-9BDE-9EB632B07BC6} ,bAdd=False ,bSystemUpdate=False ,bPreserveItemVersion=False
    ,bPreserveItemUIVersion=False ,bUpdateNoVersion=False ,pbstrNewDocId=00000000-0000-0000-0000-000000000000 ,bHasNewDocId=False ,bstrVersion=16 ,bCheckOut=False ,bCheckin=False ,bUnRestrictedUpdateInProgress=True ,bMigration=False ,bPublish=False ,bstrFileName=<null>
    Any help appreciated. Thanks in advance.

    Hi,
    As I understand, you encountered the issue when you published a workflow on SharePoint 2013 workflow platform.
    I wonder does it work well before when using 2013 workflow platform? If it works before, did you install any updates or change the configuration to the workflow related settings?
    If this is the first time after you installed workflow manager 2013, then I’d recommend you try re-registering workflow service per the link below and post the result:
    http://technet.microsoft.com/en-us/library/jj663115(v=office.15).aspx
    http://technet.microsoft.com/en-us/library/jj658588(v=office.15).aspx
    From the message you accessed workflow host uri, please make sure the account to wfsetup and wfservice account are both in wfadmins group.
    http://blogs.msdn.com/b/briangre/archive/2013/02/20/least-privilege-configuration-for-windows-azure-workflow-with-sharepoint-2013.aspx
    Regards,
    Rebecca Tu
    TechNet Community Support

  • Content-Type is net being set in HTTP header. Server returns 400 Bad Request error.

    Hi,
    I am trying to access an XML WebService. This service requires the content type of the request to be set to "text/xml". As you can see in the source code, I am setting the req.ContentType property to "text/xml".
    However, this content type seems not to be added to the HTTP headers. The server returns a 400 Bad Request error as can be seen in the log.
    I've attached a System.Net.trace log and it states:
    [Public Key]
    Algorithm: RSA
    Length: 2048
    Key Blob: 30 82 01 0a 02 82 01 01 00 bc 09 30 8a 1e 03 4d 7a ea 16 d3 a8 5e d8 5b 00 c4 8a c5 9f 26 bd 7d d6 cb 8b d0 db bd 93 2d 2b 3b 84 f6 20 79 83 34 67 51 37 21 ea 56 5e 18 d8 a3 db 72 43 0e 14 77 e2 64 cb 07 b6 2a 81 c7 f5 16 dd 19 c7 d9 68 0b 3a 81 5c f0 05 c9 ed 2b 37 00 31 41 37 8b 3a 73 4a 4d ab d7 d8 87 79 35 82 01 97 e3 3c be bb 84 e5 94 bb 87 52 e3 9f b5 fb 3e 33 38 c3 eb 73 42 ee ba 1e c5 4a 33 18 a1 0d 8a d2 10 a8 c5 3....
    System.Net Information: 0 : [26780] SecureChannel#31884011 - Remote certificate was verified as valid by the user.
    System.Net Information: 0 : [26780] ConnectStream#26966483 - Sending headers
    API-VERSION: 1
    Host: test.myhost.com
    Content-Length: 329
    Expect: 100-continue
    Connection: Keep-Alive
    System.Net Information: 0 : [26780] Connection#3888474 - Received status line: Version=1.1, StatusCode=100, StatusDescription=Continue.
    System.Net Information: 0 : [26780] Connection#3888474 - Received headers
    System.Net Information: 0 : [26780] Connection#3888474 - Received status line: Version=1.1, StatusCode=400, StatusDescription=Bad Request.
    System.Net Information: 0 : [26780] Connection#3888474 - Received headers
    0: Content-type
    1: text/xml
    X-Debug-Token: a810dc
    X-Debug-Token-Link: /service/_profiler/a810dc
    Connection: keep-alive
    Content-Length: 3440
    Cache-Control: no-cache
    Content-Type: text/html; charset=UTF-8
    Date: Tue, 14 Apr 2015 11:07:11 GMT
    Server: Apache
    ...and here's the implementation of the web request:
    private void ButtonSend_Click(object sender, EventArgs e)
    WebHeaderCollection whCol = new WebHeaderCollection();
    whCol.Add("API-VERSION", "1");
    //whCol.Add("Content-Type", "text/xml; charset=UTF-8"); <-- That doesn't work in .NET. Content-Type has to be set on the ContentType-Property
    string msg = _textBoxReq.Text;
    HttpWebRequest req = (HttpWebRequest)WebRequest.Create(_textBoxURL.Text);
    byte[] data = Encoding.UTF8.GetBytes(msg);
    req.Method = "POST";
    req.ContentType = "text/xml; charset=UTF-8";
    req.ContentLength = data.Length;
    req.Headers = whCol;
    req.GetRequestStream().Write(data, 0, data.Length);
    string xml = "";
    try
    using (HttpWebResponse resp = (HttpWebResponse)req.GetResponse())
    using (System.IO.StreamReader sr = new System.IO.StreamReader(resp.GetResponseStream()))
    xml = sr.ReadToEnd().Trim();
    catch (WebException we)
    using (System.IO.StreamReader sr = new System.IO.StreamReader(we.Response.GetResponseStream()))
    xml = sr.ReadToEnd().Trim();
    _textBoxRes.Text = xml;
    Can anyone help?
    Thanks,
    MiRi

    Hi _MiRichter,
    Well Done!
    Thank you very much for sharing the solution to us.
    Best Regards,
    Amy Peng
    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.

  • HTTP/1.1 400 Bad Request error in receiver REST channel

    Hi Experts
    I am currently working on an interface in which we have created a REST communication channel on the receiver side.
    The below error comes up in the PI when we try to perform the GET operation on the URLs given below:
    Error Message: HTTP error occurred: HTTP/1.1 400 Bad Request
    URLs -
    i) https://<myHost>:<myPort>/businesses/search?Keyword=Viridor&ResultsPerPage=10
    ii) https://<myHost>:<myPort>/businesses/ec92a1e9-cef0-48aa-8800-a2e500ce8b1c/sites?Keyword=Viridor&ResultsPerPage=10
    When we use SOAP UI to perform the above test, it works perfectly fine and fetches the required response from the target REST server.
    Also, when we use the URL - https://<myHost>:<myPort>/businesses in the receiver communication channel in PI, it works fine and retrieves the
    values of all the businesses present on the target server, however on making URL more specific - like the two URLs above, it does not work
    and gives the bad request message.
    Please can you let me know what could be the issue.
    Thanks,
    Maheswarareddy

    Hi All,
    Issue resolved:) ...that due to When calling a URL in the REST Receiver Channel, all GET variables are ignored
    so we had to upgrade SP10 patch level 5 and all services are working as we expected.
    Also pls check Note :2114322
    Thanks,
    Maheswarareddy

  • URGENT - Error 400--Bad Request

    When I run weblogic 6.0 default console I get "Error 400--Bad Request> From RFC
    2068 Hypertext Transfer Protocol -- HTTP/1.1:"What does this mean ? Can u help
    me to fix it !! Other than reinstall the whole WebLogic!!!
    Another things is do you have and recommendation web site, eBook that teach "Using
    Weblogic EJB with JBuider 6". Thank You

    The solution was to switch to Apache's HttpClient. no more problems with SUN's HttpUrlConnection!

  • 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

  • Download Manager - failing with error 400 Bad Request

    Each time I try to download some patches from the download basket I get this error: The request failed: 400.  Download Manager says the files are Partially Downloaded but the downloads never complete (they just cycle round one after another attempting each download before failing).  The connection to SAP ssems to be made correctly (see trace file extract below)
    I'm running JRE version 1.4.2_12; download manager ver 2.1.130.  I've tried uninstalling & reinstalling JRE & download manager (numerous times).  Does anyone have any suggestions about what might be the cause?
    Thanks, Chris
    PS - This is the relevant part of the trace file:
    24-Aug-2007 09:29:06   Opening connection to 'https://smpdla.sap.com:443/00000084/217/KGPHA68.CAR?object_id=011000358700000405252007E&filepath=00000084\217\KGPHA68.CAR&uid=S0003245349'
    24-Aug-2007 09:29:06   Sending request to SAP Service Marketplace Server (no tunneling)
    24-Aug-2007 09:29:13   A response was received from the SAP Service Marketplace Server.
    24-Aug-2007 09:29:13   Response received: 400 Bad Request
    24-Aug-2007 09:29:13   Response Http Headers:
    24-Aug-2007 09:29:13      Server=AkamaiGHost
    24-Aug-2007 09:29:13      Mime-Version=1.0
    24-Aug-2007 09:29:13      Content-Type=text/html
    24-Aug-2007 09:29:13      Content-Length=340
    24-Aug-2007 09:29:13      Expires=Fri, 24 Aug 2007 08:28:49 GMT
    24-Aug-2007 09:29:13      Date=Fri, 24 Aug 2007 08:28:49 GMT
    24-Aug-2007 09:29:13      Connection=close
    24-Aug-2007 09:29:13   Response code: 400
    24-Aug-2007 09:29:18   Notifying subscribers of download state ...
    24-Aug-2007 09:29:18   The download has terminated ...
    24-Aug-2007 09:29:18   getUserProxy: true
    24-Aug-2007 09:29:18   getEffectiveProtocol: http
    24-Aug-2007 09:29:18   detected: http / https w/o proxy request
    24-Aug-2007 09:29:18   SMPResponse::sendRequestNormal
    24-Aug-2007 09:29:18   Opening connection to 'http://service.sap.com:80/~form/download_basket?_MODE=OBJECT_VERSION&OBJID=011000358700000485532007E&'
    24-Aug-2007 09:29:18   Sending request to SAP Service Marketplace Server (no tunneling)
    24-Aug-2007 09:29:25   A response was received from the SAP Service Marketplace Server.
    24-Aug-2007 09:29:25   Redirecting to 'https://WEBSMP108.SAP-AG.DE/~form/download_basket?_MODE=OBJECT_VERSION&OBJID=011000358700000485532007E&'...
    24-Aug-2007 09:29:25   getUserProxy: true
    24-Aug-2007 09:29:25   getEffectiveProtocol: https
    24-Aug-2007 09:29:25   detected: http / https w/o proxy request
    24-Aug-2007 09:29:25   SMPResponse::sendRequestNormal
    24-Aug-2007 09:29:25   Opening connection to 'https://WEBSMP108.SAP-AG.DE/~form/download_basket?_MODE=OBJECT_VERSION&OBJID=011000358700000485532007E&'
    24-Aug-2007 09:29:25   Sending request to SAP Service Marketplace Server (no tunneling)
    24-Aug-2007 09:29:25   A response was received from the SAP Service Marketplace Server.
    24-Aug-2007 09:29:25   Response received: 200 OK
    24-Aug-2007 09:29:25   Response Http Headers:
    24-Aug-2007 09:29:25      Date=Fri, 24 Aug 2007 08:29:02 GMT
    24-Aug-2007 09:29:25      Server=Microsoft-IIS/6.0
    24-Aug-2007 09:29:25      Content-Type=text/plain
    24-Aug-2007 09:29:25      Content-Length=44
    24-Aug-2007 09:29:25   getUserProxy: true
    24-Aug-2007 09:29:25   getEffectiveProtocol: http
    24-Aug-2007 09:29:25   detected: http / https w/o proxy request
    24-Aug-2007 09:29:25   SMPResponse::sendRequestNormal
    24-Aug-2007 09:29:25   Opening connection to 'http://service.sap.com:80/~form/download_basket?_MODE=DOWNLOAD_START2&OBJID=011000358700000485532007E&_VERSION=2.1.130&'
    24-Aug-2007 09:29:25   Sending request to SAP Service Marketplace Server (no tunneling)
    24-Aug-2007 09:29:25   A response was received from the SAP Service Marketplace Server.
    24-Aug-2007 09:29:25   Redirecting to 'https://WEBSMP209.SAP-AG.DE/~form/download_basket?_MODE=DOWNLOAD_START2&OBJID=011000358700000485532007E&_VERSION=2.1.130&'...
    24-Aug-2007 09:29:25   getUserProxy: true
    24-Aug-2007 09:29:25   getEffectiveProtocol: https
    24-Aug-2007 09:29:25   detected: http / https w/o proxy request
    24-Aug-2007 09:29:25   SMPResponse::sendRequestNormal
    24-Aug-2007 09:29:25   Opening connection to 'https://WEBSMP209.SAP-AG.DE/~form/download_basket?_MODE=DOWNLOAD_START2&OBJID=011000358700000485532007E&_VERSION=2.1.130&'
    24-Aug-2007 09:29:25   Sending request to SAP Service Marketplace Server (no tunneling)
    24-Aug-2007 09:29:26   A response was received from the SAP Service Marketplace Server.
    24-Aug-2007 09:29:26   Response received: 200 OK
    24-Aug-2007 09:29:26   Response Http Headers:
    24-Aug-2007 09:29:26      Date=Fri, 24 Aug 2007 08:29:03 GMT
    24-Aug-2007 09:29:26      Server=Microsoft-IIS/6.0
    24-Aug-2007 09:29:26      Content-Type=text/html
    24-Aug-2007 09:29:26      Content-Length=2416
    24-Aug-2007 09:29:26   Number of URLs: 1
    24-Aug-2007 09:29:26   Description lines: 56
    24-Aug-2007 09:29:26   Adding HTTP1/1 Header: Range: bytes=0-*
    24-Aug-2007 09:29:26   getUserProxy: true
    24-Aug-2007 09:29:26   getEffectiveProtocol: https
    24-Aug-2007 09:29:26   detected: http / https w/o proxy request
    24-Aug-2007 09:29:26   SMPResponse::sendRequestNormal
    24-Aug-2007 09:29:26   Opening connection to 'https://smpdla.sap.com:443/00000085/652/KGPHA69.CAR?object_id=011000358700000485532007E&filepath=00000085\652\KGPHA69.CAR&uid=S0003245349'
    24-Aug-2007 09:29:26   Sending request to SAP Service Marketplace Server (no tunneling)
    24-Aug-2007 09:29:33   A response was received from the SAP Service Marketplace Server.
    24-Aug-2007 09:29:33   Response received: 400 Bad Request
    24-Aug-2007 09:29:33   Response Http Headers:

    Yes - I've checked the address w're pointing to & have rechecked several times with our network people re: the proxy.
    The trace seems to show that we're certainly making the initial connections to SAP OK - it just gives up after a few redirections.
    Chris

Maybe you are looking for

  • Installing iTunes on a new Windows 7 64 bit machine

    I am trying to install iTunes for my mother in law's new iPod, on her new Windows 7 machine. When I click the "download" it immediately goes to a page that thanks me for installing iTunes, but nothing has been downloaded or installed. Please help! Sh

  • How do I get my money back for two charges that I did not get?

    I was playing super dynamite fishing on my iPad (on my iPhone now cause no more internet on my way to work) and I tried to purchase an money pack for $7.99. I got an error message saying that the app was from another iTunes account and I had to sign

  • Selecting with a special character

    Hi, I have a table in which an user can query via a sql prompt (accept) for a text he wants to search for. This search string can contain special characters like @,$,& etc but nog on a specific position. Sometimes they search for bbbb.hhhh_23, the ne

  • BLOB or CLOB

    Hi, My development team has to store MS exel files into the database, do we need to use BLOB data type for this or CLOB would be appropriate? Same question is for Ms Word documents. Thanks in advance for the help Salman

  • SQL Loader - Junk characters

    Hi ALl This may not be exactly a SQL Loader problem. I have a XCEL file which I convert to Tab delimited file before using SQL Loader to load the records. But the XCEL file has some junk characters. So when I save it as tab delimited format the junk