Dynamics CRM Unexpected Error when trying to view Prospects/Leads - microsoft-dynamics

We have a user who has been unable to view his Leads/Prospects when trying to view his default list. He can search for them and get them to display in search results but whenever he tries to view his default entry screen we get an 'Unexpected Error'.
I have pasted the system error report below.
Any suggestions? It looks like a data error to me, but I cannot work out where to look!
Thanks in advance!
Exception generated at: 29/10/2014 17:11:45
Error Type: System.IndexOutOfRangeException
Error Message: Index was outside the bounds of the array.
Error Stack Trace:
at CommunicationActivityServiceBase.AutoCreateContactOrLead(BusinessEntity entity, ExecutionContext context, String subject, AddressEntry[] fromAddressEntries, AddressEntry[][] allResolvedAddressEntries) ilOffset = 0x241
at EmailService.Deliver(Boolean userPromote, Guid emailId, String messageId, String subject, String from, String to, String cc, String bcc, DateTime receivedOn, String submittedBy, String importance, String body, BusinessEntityCollection attachments, Guid campaignResponseId, Entity emailDeltaEntity, ExecutionContext context, Boolean validateBeforeDeliver) ilOffset = 0x2C9
at EmailService.DeliverIncoming(String messageId, String subject, String from, String to, String cc, String bcc, DateTime receivedOn, String submittedBy, String importance, String body, BusinessEntityCollection attachments, Entity extraProperties, Boolean validateBeforeCreate, ExecutionContext context) ilOffset = 0xB8
Stack Frame:
at Pipeline.Execute(PipelineExecutionContext context) ilOffset = 0x65
at MessageProcessor.Execute(PipelineExecutionContext context) ilOffset = 0x1C5
at InternalMessageDispatcher.Execute(PipelineExecutionContext context) ilOffset = 0xE4
at ExternalMessageDispatcher.ExecuteInternal(IInProcessOrganizationServiceFactory serviceFactory, IPlatformMessageDispatcherFactory dispatcherFactory, String messageName, String requestName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, ParameterCollection fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId, Guid transactionContextId, Int32 invocationSource, Nullable`1 requestId, Version endpointVersion) ilOffset = 0x16E
at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, UserAuth userAuth, Guid targetUserId, OrganizationContext context, Boolean returnResponse, Boolean checkAdminMode) ilOffset = 0x1F1
at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode) ilOffset = 0x2D
at OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode) ilOffset = 0x26
at OrganizationSdkService.Execute(OrganizationRequest request) ilOffset = 0xD
at ilOffset = 0xFFFFFFFF
at SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) ilOffset = 0x241
at DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) ilOffset = 0x100
at ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) ilOffset = 0x48
at ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) ilOffset = 0xC6
at MessageRpc.Process(Boolean isOperationContextSet) ilOffset = 0x62
at ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext) ilOffset = 0x256
at ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext) ilOffset = 0xF1
at ChannelHandler.AsyncMessagePump(IAsyncResult result) ilOffset = 0x39
at AsyncThunk.UnhandledExceptionFrame(IAsyncResult result) ilOffset = 0x0
at AsyncResult.Complete(Boolean completedSynchronously) ilOffset = 0xC2
at ReceiveItemAndVerifySecurityAsyncResult`2.InnerTryReceiveCompletedCallback(IAsyncResult result) ilOffset = 0x55
at AsyncThunk.UnhandledExceptionFrame(IAsyncResult result) ilOffset = 0x0
at AsyncResult.Complete(Boolean completedSynchronously) ilOffset = 0xC2
at AsyncQueueReader.Set(Item item) ilOffset = 0x21
at InputQueue`1.Dispatch() ilOffset = 0x121
at ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped) ilOffset = 0x22
at IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped) ilOffset = 0x5
at _IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP) ilOffset = 0x3C
Exception Data:
1: Key type: System.String, value: PluginTrace
Custom Message: Web Service Plug-in failed in SdkMessageProcessingStepId: d0cabb1b-ea3e-db11-86a7-000a3a5473e8; EntityName: email; Stage: 30; MessageName: DeliverIncoming; AssemblyName: Microsoft.Crm.Extensibility.InternalOperationPlugin, Microsoft.Crm.ObjectModel, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35; ClassName: Microsoft.Crm.Extensibility.InternalOperationPlugin; Exception: Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object target, Object[] values)
at Microsoft.Crm.Extensibility.InternalOperationPlugin.Execute(IServiceProvider serviceProvider)
at Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
Inner Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Microsoft.Crm.Common.ObjectModel.CommunicationActivityServiceBase.AutoCreateContactOrLead(BusinessEntity entity, ExecutionContext context, String subject, AddressEntry[] fromAddressEntries, AddressEntry[][] allResolvedAddressEntries)
at Microsoft.Crm.Common.ObjectModel.EmailService.Deliver(Boolean userPromote, Guid emailId, String messageId, String subject, String from, String to, String cc, String bcc, DateTime receivedOn, String submittedBy, String importance, String body, BusinessEntityCollection attachments, Guid campaignResponseId, Entity emailDeltaEntity, ExecutionContext context, Boolean validateBeforeDeliver)
at Microsoft.Crm.Common.ObjectModel.EmailService.DeliverIncoming(String messageId, String subject, String from, String to, String cc, String bcc, DateTime receivedOn, String submittedBy, String importance, String body, BusinessEntityCollection attachments, Entity extraProperties, Boolean validateBeforeCreate, ExecutionContext context)
.
Not sure if this helps any? Error reported when user tries to do an advanced search within prospects/leads --
Unexpected exception from plug-in (Execute): RoleBasedViews.Plugins.SavedQueryPreRetrieveMultiple: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

Related

How do I create a new customer in a test codeunit through UI?

I would like to simulate the creation of something like a customer, item or invoice, although through the use of test pages. My first thought was to use the OpenNew()-function:
[Test]
[HandlerFunctions('ModalPageHandler,ExpectedConfirmHandler')]
procedure SampleTest()
// [FEATURE] Customer
// [SCENARIO] Create a new Customer
// [PREREQ] super rights not necessary
var
tpCustomerCard: TestPage "Customer Card";
cNewCustomerNo: Code[20];
rCustomer: Record Customer;
begin
Initialize();
// [GIVEN] Office 365 Business Full permissions
gAny.SetSeed(5);
gLibraryLowerPermissions.SetO365BusFull();
// [WHEN] Creating a new user
tpCustomerCard.OpenNew();
tpCustomerCard.Name.SetValue(gAny.AlphabeticText(gAny.IntegerInRange(20)));
cNewCustomerNo := tpCustomerCard."No.".Value;
gLibraryVariableStorage.Enqueue('');
gLibraryVariableStorage.Enqueue(true);
tpCustomerCard.Close();
// [THEN] create user
gAssert.IsFalse(cNewCustomerNo = '', 'New Customer No. created');
gAssert.IsTrue(rCustomer.Get(cNewCustomerNo), 'New Customer created');
end;
[ModalPageHandler]
procedure ModalPageHandler(var tpCustomerCard: TestPage "Customer Card");
begin
end;
[ConfirmHandler]
procedure ExpectedConfirmHandler(pQuestion: Text[1024]; VAR pvReply: Boolean)
// Call the following in the Test function
//gLibraryVariableStorage.Enqueue('ExpectedConfirmText');
//gLibraryVariableStorage.Enqueue(true); // or false, depending of the reply you want if below question is asked. Any other question will throw an error
begin
gAssert.ExpectedMessage(gLibraryVariableStorage.DequeueText(), pQuestion);
pvReply := gLibraryVariableStorage.DequeueBoolean();
end;
However, this would always return the following error:
Unexpected CLR exception thrown.: Microsoft.Dynamics.Framework.UI.FormAbortException: Page New - Customer Card has to close. ---> Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLMissingUIHandlerException: Unhandled UI: ModalPage 1340 ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLMissingUIHandlerException: Unhandled UI: ModalPage 1340\ at Microsoft.Dynamics.Nav.Runtime.NavTestExecution.FindHandler(NavHandlerType handlerType, NavApplicationObjectBase appObject, Boolean throwIfNotFound, String handlerDescription)\ at Microsoft.Dynamics.Nav.Runtime.NavTestExecution.TestHandleModalForm(NavForm form, FormResult& action, NavFormRuntimeParameters parameters)\ at Microsoft.Dynamics.Nav.Runtime.NavForm.RunModal(NavRecord record, Int32 fieldNo)\ at Microsoft.Dynamics.Nav.Runtime.NavFormHandle.RunModal(NavRecord record, Int32 fieldNo)\ at Microsoft.Dynamics.Nav.BusinessApplication.Record1300.NewCustomerFromTemplate_Scope__1848449490.OnRun()\ at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()\ at Microsoft.Dynamics.Nav.BusinessApplication.Record1300.NewCustomerFromTemplate(INavRecordHandle customer)\ at Microsoft.Dynamics.Nav.BusinessApplication.Record1300.OnInvoke(Int32 memberId, Object[] args)\ at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit1389.CreateCustomerFromConfigTemplate_Scope_587295807.OnRun()\ at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()\ at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit1389.CreateCustomerFromConfigTemplate(INavRecordHandle customer, ByRef`1 isHandled)\ at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit1389.OnInsertCustomerFromTemplateHandler_Scope.OnRun()\ at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()\ at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit1389.OnInsertCustomerFromTemplateHandler(INavRecordHandle customer, ByRef`1 result, ByRef`1 isHandled)\ at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit1389.OnInvoke(Int32 memberId, Object[] args)\ at Microsoft.Dynamics.Nav.EventSubscription.NavEventScope.CallEventSubscriberInternal(NavEventSubscription subscriber, NavApplicationObjectBase subscriberInstance, Object[] parameters)\ at Microsoft.Dynamics.Nav.EventSubscription.NavEventScope.CallEventSubscriber(NavApplicationObjectBase callingApplicationObject, NavEventSubscription subscriber, NavApplicationObjectBase subscriberInstance, Object[] parameters)\ at Microsoft.Dynamics.Nav.EventSubscription.NavEventScope.ProcessCallToTypeAndManualSubscriptions(NavApplicationObjectBase callerApplicationObject, NavEventSubscription[] subscriptions, PrepareParametersCallBack prepareParameters)\ at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.RunEvent()\ at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit1381.OnInsertCustomerFromTemplate(INavRecordHandle customer, ByRef`1 result, ByRef`1 isHandled)\ at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()\ at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit1381.InsertCustomerFromTemplate(INavRecordHandle customer)\ at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit1381.OnInvoke(Int32 memberId, Object[] args)\ at Microsoft.Dynamics.Nav.BusinessApplication.Page21.CreateCustomerFromTemplate_Scope_857168676.OnRun()\ at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()\ at Microsoft.Dynamics.Nav.BusinessApplication.Page21.CreateCustomerFromTemplate()\ at Microsoft.Dynamics.Nav.BusinessApplication.Page21.OnAfterGetCurrRecord_Scope.OnRun()\ at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()\ at Microsoft.Dynamics.Nav.BusinessApplication.Page21.OnAfterGetCurrRecord()\ at Microsoft.Dynamics.Nav.Runtime.NavForm.RaiseOnAfterGetCurrRecord()\ at Microsoft.Dynamics.Nav.Runtime.NavForm.AfterGetCurrRecord()\ --- End of inner exception stack trace ---\ at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)\ at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)\ at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\ at Microsoft.Dynamics.Nav.Runtime.NavApplicationMethod.InvokeMethod(ITreeObject obj, String methodName, Object[] args, Boolean resolveHandler, Boolean throwOnNotFound)\ --- End of inner exception stack trace ---\ at Microsoft.Dynamics.Nav.Runtime.NavApplicationMethod.InvokeMethod(ITreeObject obj, String methodName, Object[] args, Boolean resolveHandler, Boolean throwOnNotFound)\ at Microsoft.Dynamics.Nav.Service.NSFormApplicationCode.<>c__DisplayClass7_0.<Invoke>b__0(NsDataAccess dataAccess)\ at Microsoft.Dynamics.Nav.Service.NsFormDataAccess.RunWithFormDataAccess[T](ITreeObject parent, NavForm form, Func`2 func)\ at Microsoft.Dynamics.Nav.Service.NsDataAccess.RunWithDataAccess[T](ITreeObject parent, NavRecordState state, Boolean instantiateNewForm, Guid parentFormHandle, String parentControlName, Boolean& instantiatedForm, Func`2 func)\ at Microsoft.Dynamics.Nav.Service.NsDataAccess.RunWithDataAccess[T](ITreeObject parent, NavRecordState state, Func`2 func)\ at INavServiceWrapper.InvokeApplicationMethod(ApplicationMethodRequest , NavRecordState )\ at Microsoft.Dynamics.Nav.Types.AsyncNavServiceWrapper.<>c__DisplayClass119_0.<BeginInvokeApplicationMethod>b__0()\ at Microsoft.Dynamics.Nav.Types.AsyncNavServiceWrapper.Invoke(Func`1 action, AsyncCallback callback, Object asyncState, Object extraState)\ at Microsoft.Dynamics.Nav.Client.ServiceConnectionBase.<>c__DisplayClass21_0.<InvokeApplicationMethod>b__0(IAsyncNavService server)\ at Microsoft.Dynamics.Nav.Runtime.TestServiceConnection.CallServer[T](BeginCallServerMethod beginCallServerMethod, EndCallServerMethod`1 endCallServerMethod)\ at Microsoft.Dynamics.Nav.Client.ServiceConnectionBase.InvokeApplicationMethod(ApplicationCodeType objectType, Int32 objectId, String methodName, NavDataSet& dataSet, NavRecordState& state, Object[]& args)\ at Microsoft.Dynamics.Nav.Client.DataBinder.NstDataAccess.InvokeOnAfterGetCurrentRecord(NavDataSet& navDataSet, NavRecordState& navRecordState)\ at Microsoft.Dynamics.Nav.Client.DataBinder.NstDataAccess.InvokeOnNewRecord(NavRecord record, NavRecord xrec, NavRecordState state, Object[] args)\ at Microsoft.Dynamics.Nav.Client.DataBinder.NstDataAccess.OnNewRecord(Boolean clearFormState, NavRecord xrec, Object[] args)\ --- End of inner exception stack trace ---\ at Microsoft.Dynamics.Nav.Client.DataBinder.NstDataAccess.Abort(NavBaseException exception)\ at Microsoft.Dynamics.Nav.Client.DataBinder.NstDataAccess.OnNewRecord(Boolean clearFormState, NavRecord xrec, Object[] args)\ at Microsoft.Dynamics.Nav.Client.DataBinder.NavBindingManager.EnsureOnNewRecordIsUpToDate()\ at Microsoft.Dynamics.Nav.Client.DataBinder.NavBindingManager.OnCurrentRowChanged(CurrentRowChangeEventArgs e)\ at Microsoft.Dynamics.Framework.UI.BindingManager.set_CurrentCollectionIndex(Int32 value)\ at Microsoft.Dynamics.Framework.UI.VirtualRows.UpdateAfterInsert(Int32 index, Boolean needsUpdateCurrentRow)\ at Microsoft.Dynamics.Framework.UI.VirtualRows.AddWithoutValidation(RowEntry row, Boolean needsUpdateCall, Boolean needsUpdateCurrentRow, Boolean insertFirst, Boolean raiseEvents)\ at Microsoft.Dynamics.Framework.UI.VirtualRows.Insert()\ at Microsoft.Dynamics.Nav.Client.TestPageClient.TestPageClientSession.CreateLogicalForm(Int32 formId, FormState formState)\ at Microsoft.Dynamics.Nav.Client.TestPageClient.TestPageClientSession.CreatePage(Int32 id, ViewMode mode)\ at Microsoft.Dynamics.Nav.Runtime.NavTestPage.Open(ViewMode mode)\ at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit50100.SampleTest_Scope__1526614456.OnRun()\ at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()\ at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit50100.SampleTest()
When debugging, the code automatically breaks at this function in Mini Customer Template.dal, even without breakpoints:
[Obsolete('Will be removed with other functionality related to "old" templates. Replaced by new templates.', '18.0')]
procedure NewCustomerFromTemplate(var Customer: Record Customer): Boolean
var
ConfigTemplateHeader: Record "Config. Template Header";
ConfigTemplates: Page "Config Templates";
begin
ConfigTemplateHeader.SetRange("Table ID", DATABASE::Customer);
ConfigTemplateHeader.SetRange(Enabled, true);
if ConfigTemplateHeader.Count = 1 then begin
ConfigTemplateHeader.FindFirst;
InsertCustomerFromTemplate(ConfigTemplateHeader, Customer);
exit(true);
end;
if (ConfigTemplateHeader.Count > 1) and GuiAllowed then begin
ConfigTemplates.SetTableView(ConfigTemplateHeader);
ConfigTemplates.LookupMode(true);
ConfigTemplates.SetNewMode;
if ConfigTemplates.RunModal = ACTION::LookupOK then begin
ConfigTemplates.GetRecord(ConfigTemplateHeader);
InsertCustomerFromTemplate(ConfigTemplateHeader, Customer);
exit(true);
end;
end;
exit(false);
end;
To be specific, it always stops at the last if, most likely because ConfigTemplates is undefined. This probably is because when normally creating a new customer or item, the page Config Templates is opened first to let the user pick a template, and since my codeunit is skipping this step, one of the variables ends up being undefined. I then tried to open the Customer Card page by invoking the New Customer action from the Customer List page, but since that is not a custom action, I can't reach it.
To replicate user interaction as closely as possible I'd prefer to open windows through actions found in the UI, but if that's impossible with AL, I'd at least want the former method to work. How can I open a card page using templates without the test immediately failing?
If you look into the error message you will see that it complains about a missing ModalPageHandler for ModalPage 1340 which is the Config Templates page.
You need to define a ModalPageHandler for that specific page:
[ModalPageHandler]
procedure ConfigTemplatesHandler(var ConfigTemplates: TestPage "Config Templates")
begin
// This will select the first template available
ConfigTemplates.OK().Invoke();
end;
Then you need to add it as a HandlerFunction for your test procedure:
[Test]
[HandlerFunctions('ConfigTemplatesHandler,ExpectedConfirmHandler')]
procedure SampleTest()
begin
...
end;

AWS Signature Creation. Confused on how to covert the SigningKey and SingingString into Signature. AWS Example Seems To Not Yield Expected Result

I'm trying to write my own AWS4 signer, and I've gotten about 2/3 of the way there. Source code here :
public class Test
{
private static String region = "us-east-1";
static byte[] HmacSHA256(String data, byte[] key) throws Exception {
String algorithm="HmacSHA256";
Mac mac = Mac.getInstance(algorithm);
mac.init(new SecretKeySpec(key, algorithm));
return mac.doFinal(data.getBytes("UTF8"));
}
public static byte[] justSha256(String data) throws NoSuchAlgorithmException, UnsupportedEncodingException {
MessageDigest digest = MessageDigest.getInstance("SHA-256");
byte[] hash = digest.digest(data.getBytes("UTF8"));
return hash;
}
static byte[] getSigningKey(String key, String dateStamp, String regionName, String serviceName) throws Exception {
byte[] kSecret = ("AWS4" + key).getBytes("UTF8");
byte[] kDate = HmacSHA256(dateStamp, kSecret);
byte[] kRegion = HmacSHA256(regionName, kDate);
byte[] kService = HmacSHA256(serviceName, kRegion);
byte[] kSigning = HmacSHA256("aws4_request", kService);
return kSigning;
}
public static String getSimpleDate()
{
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("YYYYMMdd");
return LocalDate.now().format(formatter);
}
public static String getAMZDate()
{
/*DateTimeFormatter formatter = DateTimeFormatter.ofPattern("YYYYMMDDHHMMSS");
String timeStamp = new SimpleDateFormat("YYMMDD'T'HHMMSS'Z'").format(Calendar.getInstance().getTime());*/
TimeZone tz = TimeZone.getTimeZone("UTC");
DateFormat df = new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'"); // Quoted "Z" to indicate UTC, no timezone offset
df.setTimeZone(tz);
String timeStamp = df.format(new Date());
return timeStamp;
}
public static String createSigningString(String timeStamp, String simpleDate,String serviceName) throws UnsupportedEncodingException, NoSuchAlgorithmException {
/*AWS4-HMAC-SHA256
20150830T123600Z
20150830/us-east-1/iam/aws4_request
f536975d06c0309214f805bb90ccff089219ecd68b2577efef23edd43b7e1a59*/
String algorithm = "AWS4-HMAC-SHA256\n";
String amzDate = timeStamp+"\n";
String simpleDateRegionServiceRequest = simpleDate+"/"+region+"/"+serviceName+"/"+"aws4_request\n";
String canonicalHash = getCanonicalHash(getCanonicalString("GET","/","Action=ListUsers&Version=2010-05-08","20150830T123600Z",""));
String signingString = algorithm+amzDate+simpleDateRegionServiceRequest+canonicalHash;
return signingString;
}
public static String getCanonicalString(String method, String absolutePath, String queryString, String timeStamp, String payload) throws UnsupportedEncodingException, NoSuchAlgorithmException {
String contentType = "Content-Type:application/x-www-form-urlencoded; charset=utf-8\n".toLowerCase();
String hostUrl = "host:iam.amazonaws.com\n";
String date = "x-amz-date:"+timeStamp+"\n";
String signedHeader = "content-type;host;x-amz-date\n";
String hashedPayload = Hex.encodeHexString(justSha256(payload)).toLowerCase();
String canonicalString = method+"\n"+absolutePath+"\n"+queryString+"\n"+contentType+hostUrl+date+"\n"+signedHeader+hashedPayload;
return canonicalString;
}
public static String getCanonicalHash(String canonicalString) throws UnsupportedEncodingException, NoSuchAlgorithmException {
return Hex.encodeHexString(justSha256(canonicalString)).toLowerCase();
}
public static void main(String[] args) throws Exception {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("YYYYMMDDHHMMSS");
String timeStamp = new SimpleDateFormat("YYYYMMDD'T'HHMMSS'Z'").format(Calendar.getInstance().getTime());
String canonString;
System.out.println( canonString = getCanonicalHash(getCanonicalString("GET","/","Action=ListUsers&Version=2010-05-08","20150830T123600Z","")));
String signingString = createSigningString("20150830T123600Z","20150830","iam");
String key = "wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY";
String dateStamp = "20120215";
String regionName = "us-east-1";
String serviceName = "iam";
String signingKey = Hex.encodeHexString(getSigningKey(key,dateStamp,regionName,serviceName));
SoftAssertions softly = new SoftAssertions();
softly.assertThat(canonString).isEqualToIgnoringCase("f536975d06c0309214f805bb90ccff089219ecd68b2577efef23edd43b7e1a59");
String copiedSigningString = "AWS4-HMAC-SHA256\n" +
"20150830T123600Z\n" +
"20150830/us-east-1/iam/aws4_request\n" +
"f536975d06c0309214f805bb90ccff089219ecd68b2577efef23edd43b7e1a59";
softly.assertThat(signingString).isEqualTo(copiedSigningString);
softly.assertThat(signingKey).isEqualToIgnoringCase("f4780e2d9f65fa895f9c67b32ce1baf0b0d8a43505a000a1a9e090d414db404d");
dateStamp ="20150830";
signingKey = Hex.encodeHexString(getSigningKey(key,dateStamp,regionName,serviceName));
softly.assertThat(signingKey).isEqualToIgnoringCase("c4afb1cc5771d871763a393e44b703571b55cc28424d1a5e86da6ed3c154a4b9");
System.out.println("COPIED STRING : "+copiedSigningString);
System.out.println("SIGNING KEY : "+signingKey);
String signature = Hex.encodeHexString(HmacSHA256(signingKey.trim(),justSha256(copiedSigningString)));
System.out.println("Signature : "+signature);
softly.assertThat(signature).isEqualToIgnoringCase("5d672d79c15b13162d9279b0855cfba6789a8edb4c82c400e06b5924a6f2b5d7");
softly.assertAll();
}
}
For some reason I'm failing to create the correct Signature. Which is created by using the SigningKey and SingingString as input into an HMACSha256 function, specifically the function highlighted on this page https://docs.aws.amazon.com/general/latest/gr/signature-v4-examples.html#signature-v4-examples-java.
But for some reason, I cannot produce the signature that AWS says will be created here on this page.: https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html
(5d672d79c15b13162d9279b0855cfba6789a8edb4c82c400e06b5924a6f2b5d7)
Despite using their function, their Strings as input, and double checking my work. What am I missing?
Are you supposed to use a different function for these Strings or byte[]?
I feel like I'm missing something, and I don't know where to reconcle this confusion because from my code and what I see on these pages I seem to be doing the right thing.
I'm especially confused because when I pasted the String from their site into my code to see if it would convert properly it did not, despite using their same Hmac function (which did work for creating every other hash string posted on their site).
The hex representation of the date, region, service, and signing keys is shown for illustration, because the keys contain bytes that do not represent printable characters.
But you appear to be hex-encoding your signing key before using it to sign the request. Don't do that. You will want to hex-encode it only for viewing/debugging. The actual signing key should be retained and used in its original binary/byte form.
Use the digest (binary format) for the key derivation. Most languages have functions to compute either a binary format hash, commonly called a digest, or a hex-encoded hash, called a hexdigest. The key derivation requires that you use a binary-formatted digest.
https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html
The canonical request hash in the string-to-sign is used in hex-encoded form, as is the final signature. The key derivation is all binary.

"Index was outside the bounds of the array" error when importing data using Power BI

I'm using Power BI for the first time, and I'm trying to import a few tables from a SQL Server 2012 Express database into Power BI.
After I've selected the tables and click "Load" it fails at the "Creating connection in model..." stage with the following error:
Error Message:
Index was outside the bounds of the array.
Stack Trace:
at Microsoft.Mashup.Client.ClientShared.Relationships.RelationshipTableEntries.TryGetForeignKeyRelationship(HashSet`1 tablesToProcess, RelationshipTableEntry leftEntry, RelationshipTableEntry rightEntry, RelationshipInfo relationship, ForeignKeyRelationship& foreignKeyRelationship)
at Microsoft.Mashup.Client.ClientShared.Relationships.RelationshipTableEntries.GetForeignKeyRelationships(IEnumerable`1 tableEntries, IEnumerable`1 tableNames)
at Microsoft.PowerBI.Client.Windows.Modeling.RelationshipLoader.GetForeignKeyRelationships(ReportMetadata reportMetadata, IDataModel dataModel, List`1 relationshipTableEntries, List`1 queriesToProcess)
at Microsoft.PowerBI.Client.Windows.Modeling.RelationshipLoader.ImportRelationships(SynchronizationContext uiThreadContext, Report report, IDataModel dataModel, IAnalysisServicesLoadToken loadToken, IEnumerable`1 loadInputs, IAnalysisServicesDatabase database, IAnalysisServicesLoadContext loadContext, IRelationshipManager relationshipManager, HashSet`1 previouslyLoadedInputs)
at Microsoft.PowerBI.Client.Windows.Modeling.RelationshipLoader.DetectAndImportRelationships(SynchronizationContext uiThreadContext, IAnalysisServicesLoadToken loadToken, IEnumerable`1 loadInputs, IAnalysisServicesLoadContext loadContext, Report report, IExtendedModelChangeScope modelChangeScope, List`1 newTableColumnPairs, HashSet`1 previouslyLoadedInputs, Action relationshipAutodetectStartCallback)
at Microsoft.PowerBI.Client.Windows.Modeling.PowerQueryToModelLoader.CreateRelationships(IAnalysisServicesLoadContext loadContext, IExtendedModelChangeScope modelChangeScope, List`1 newTableColumnPairs, HashSet`1 previouslyLoadedInputs, Action relationshipAutodetectStartCallback)
at Microsoft.PowerBI.Client.Windows.Modeling.PowerQueryToModelLoader.ProcessLoadInputs(IExtendedModelChangeScope modelChangeScope, Action relationshipAutodetectStartCallback)
at Microsoft.PowerBI.Client.Windows.Modeling.PowerQueryToModelLoader.<>c__DisplayClassb.<PerformLoadInternal>b__7(IExtendedModelChangeScope modelChangeScope)
at Microsoft.PowerBI.Client.Windows.Modeling.AsyncModelAuthoringService.<>c__DisplayClassf.<RunExtendedModelChangeAsync>b__e()
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.PowerBI.Client.Windows.Utilities.TaskExtensions.WaitAndUnpackException(Task task)
at Microsoft.PowerBI.Client.Windows.Modeling.PowerQueryToModelLoader.PerformLoadInternal(Action relationshipAutodetectStartCallback)
at Microsoft.PowerBI.Client.Windows.Modeling.PowerQueryToModelLoader.PerformLoad(Action relationshipAutodetectStartCallback)
at Microsoft.PowerBI.Client.Windows.Modeling.PowerQueryToModelLoader.<>c__DisplayClass1.<LoadTablesAsync>b__0(Object state)
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
Stack Trace Message:
Index was outside the bounds of the array.
Invocation Stack Trace:
at Microsoft.Mashup.Host.Document.ExceptionExtensions.GetCurrentInvocationStackTrace()
at Microsoft.Mashup.Client.ClientShared.FeedbackErrorInfo..ctor(String message, Exception exception)
at Microsoft.PowerBI.Client.Windows.Telemetry.PowerBIUserFeedbackServices.ReportException(IWindowContainer activeWindow, WindowsHost windowsHost, FeedbackPackageInfo feedbackPackageInfo, Exception e, Boolean useGDICapture)
at Microsoft.Mashup.Client.ClientShared.UnexpectedExceptionHandler.<>c__DisplayClass1.<HandleException>b__0()
at Microsoft.Mashup.Host.Document.SynchronizationContextExtensions.<>c__DisplayClass3.<SendAndMarshalExceptions>b__0(Object null)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at Microsoft.Mashup.Client.ClientShared.WindowManager.ShowDialog[T](T form, IWindowContainer owner)
at Microsoft.Mashup.Client.ClientShared.Ux.FloatingDialog.FloatingDialog.ShowDialogWithTimeout(IWindowContainer owner, Nullable`1 showTimeout)
at Microsoft.Mashup.Client.ClientShared.Ux.WindowService.ShowDialogWithTimeout(FloatingDialog dialog, Nullable`1 showTimeout)
at Microsoft.PowerBI.Client.Windows.FloatingDialog.KoLoadToReportDialog.StartEvaluationAndShowDialog(IWindowService windowService, IEnumerable`1 queriesToLoad, Nullable`1 showTimeout, Boolean requireFullDataRefresh)
at Microsoft.PowerBI.Client.Windows.FloatingDialog.KoLoadToReportDialog.<>c__DisplayClass2.<TryShowDialogForQueries>b__0(IWindowContainer ownerWindow)
at Microsoft.PowerBI.Client.Windows.PowerBIDataImporter.LoadQueries(IEnumerable`1 queriesToLoad)
at Microsoft.PowerBI.Client.Windows.PowerBIDataImporter.OnImportSuccess(IEnumerable`1 addedQueries, DataImportDestination destination)
at Microsoft.Mashup.Client.ClientShared.DataImporter.ProcessImportedQueries(IEnumerable`1 importedQueries, DataImportDestination destination)
at Microsoft.Mashup.Client.ClientShared.DataImporter.ImportNavigationSource(Query query)
at Microsoft.Mashup.Client.ClientShared.DataImporter.OnGetPreviewResult(PreviewResult preview, Query query, String sourceID, String formulaTitle, Nullable`1 explicitImportDestination, Boolean isNewQuery, Boolean isFromEditor)
at Microsoft.Mashup.Client.ClientShared.DataImporter.GetPreviewResult(Query query, String sourceID, String formulaTitle, Boolean isNewQuery, Boolean isFromEditor, Nullable`1 explicitImportDestination)
at Microsoft.Mashup.Client.ClientShared.DataImporter.<>c__DisplayClass1b.<OnQuerySettingsResolved>b__18()
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at Microsoft.Mashup.Client.ClientShared.WindowManager.ShowDialog[T](T form, IWindowContainer owner)
at Microsoft.PowerBI.Client.Program.<>c__DisplayClassa.<Main>b__0()
at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.<>c__DisplayClass7.<HandleExceptionsWithNestedTasks>b__6()
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
at Microsoft.PowerBI.Client.Program.Main(String[] args)
Model Default Mode:
DirectQuery
Snapshot Trace Logs:
C:\Users\User\AppData\Local\Microsoft\Power BI Desktop\FrownSnapShot996727657.zip
Performance Trace Logs:
C:\Users\User\AppData\Local\Microsoft\Power BI Desktop\PerformanceTraces.zip
Disabled Preview Features:
PBI_shapeMapVisualEnabled
PBI_EnableReportTheme
PBI_numericSlicerEnabled
PBI_SpanishLinguisticsEnabled
CustomConnectors
PBI_AdobeAnalytics
PBI_qnaExplore
PBI_variationUIChange
PBI_customVisualsGallery
PBI_canvasTooltips
Disabled DirectQuery Options:
PBI_DirectQuery_Unrestricted
TreatHanaAsRelationalSource
Cloud:
GlobalCloud
ModelChangeStartingStackTrace:
at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
at System.Environment.get_StackTrace()
at Microsoft.PowerBI.Client.Windows.Modeling.AsyncModelAuthoringService.RunExtendedModelChangeAsync(Action`1 extendedModelChange, CancellationToken cancellationToken, Boolean blockUI)
at Microsoft.PowerBI.Client.Windows.Modeling.PowerQueryToModelLoader.RunExtendedModelChangeAsync(Action`1 action)
at Microsoft.PowerBI.Client.Windows.Modeling.PowerQueryToModelLoader.PerformLoadInternal(Action relationshipAutodetectStartCallback)
at Microsoft.PowerBI.Client.Windows.Modeling.PowerQueryToModelLoader.PerformLoad(Action relationshipAutodetectStartCallback)
at Microsoft.PowerBI.Client.Windows.Modeling.PowerQueryToModelLoader.<>c__DisplayClass1.<LoadTablesAsync>b__0(Object state)
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
I try to import no more than eight tables containing very little data (just a few thousand entries). I can add the first seven tables just fine, and then when adding table number eight the error pops up.
But if I try to add this table first it works, so there is not a specific table that is the problem. The error only appear after having added sufficient number of tables. Like it surpasses some treshold and then just fails, which I find puzzling as this is a relatively small database with around 100 table.
I get the same result using both Direct Query and Import options.
I run Windows 7 and Power BI Version 2.56.5023.861 64-bit.
The problem here turned out to be the rowversion column in the tables I wanted to import. If the rowversion column was before the ForeignKey column, the import to Power BI would fail:
create table [dbo].[TableOne]
(
[Id] int not null identity(1,1)
, [Rowversion] rowversion not null
constraint [PK_TC] primary key nonclustered ([Id])
)
go
create table [dbo].[TableTwo]
(
[Id] int not null identity(1, 1)
, [Rowversion] rowversion not null -- This will fail
, [TableOneId] int null
, constraint [PK_TCO] primary key nonclustered ([Id])
, constraint [FK_TableOneId] foreign key ([TableOneId]) references [dbo].[TableOne]([Id])
)
go
But if I put the rowversion column last, it would import without a problem:
create table [dbo].[TableOne]
(
[Id] int not null identity(1,1)
, [Rowversion] rowversion not null
constraint [PK_TC] primary key nonclustered ([Id])
)
go
create table [dbo].[TableTwo]
(
[Id] int not null identity(1, 1)
, [TableOneId] int null
, [Rowversion] rowversion not null -- This will import successfully
, constraint [PK_TCO] primary key nonclustered ([Id])
, constraint [FK_TableOneId] foreign key ([TableOneId]) references [dbo].[TableOne]([Id])
)
go

Winterdom BizTalk Pipeline Test

I'm using the great Winterdom BizTalk test library to try to test the debatching of a flat file into 15 records.
The receive pipeline is working great when deployed to BizTalk.
Here's my unit test:
[DeploymentItem(#"TestData\Maps\FromCarrier\UPSSampleUpdate.csv")]
[TestMethod]
public void UPSTrackTrace_DebatchAndConvertUPSUpdateFFToXml()
{
FFDisassembler ff = Disassembler.FlatFile().WithHeaderSpec<Vasanta.Int.Carrier.Schemas.Carriers.UPS.TrackAndTrace.TandTHeader>();
ff.WithDocumentSpec<Vasanta.Int.Carrier.Schemas.Carriers.UPS.TrackAndTrace.TandTBody>();
ReceivePipelineWrapper pipeline = Pipelines.Receive().WithDisassembler(ff);
// Create the input message to pass through the pipeline
MemoryStream stream = new MemoryStream();
using (FileStream file = new FileStream("UPSSampleUpdate.csv", FileMode.Open, FileAccess.Read))
{
byte[] bytes = new byte[file.Length];
file.Read(bytes, 0, (int)file.Length);
stream.Write(bytes, 0, (int)file.Length);
}
IBaseMessage inputMessage = MessageHelper.CreateFromStream(stream);
MessageCollection output = pipeline.Execute(inputMessage);
Assert.AreEqual(15, output.Count);
}
Running the test raises the following error:
Test method
Vasanta.Int.Carrier.UnitTests.Pipelines.FromCarrier.UPSUpdateFFDisassemble.UPSTrackTrace_DebatchAndConvertUPSUpdateFFToXml threw exception:
System.Xml.XmlException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object.
And this stack trace:
Microsoft.BizTalk.ParsingEngine.UngetBuffer.Push(String str, Int32 index, Int32 howMany)
Microsoft.BizTalk.ParsingEngine.DataReader.Unget(String str, Int32 index, Int32 count)
Microsoft.BizTalk.ParsingEngine.FFScanner.MatchDelimited()
Microsoft.BizTalk.ParsingEngine.FFScanner.Match()
Microsoft.BizTalk.ParsingEngine.FFScanner.InternalRead()
Microsoft.BizTalk.ParsingEngine.BufferedTokenReader.Read()
Microsoft.BizTalk.ParsingEngine.FFScanner.Read()
Microsoft.BizTalk.ParsingEngine.Parser.Scan()
Microsoft.BizTalk.ParsingEngine.Parser.Resume()
Microsoft.BizTalk.ParsingEngine.Parser.Parse()
Microsoft.BizTalk.ParsingEngine.FFReader.State.InitialState.Read(FFReader reader)
Microsoft.BizTalk.ParsingEngine.FFReader.State.InitialState.Read(FFReader reader)
Microsoft.BizTalk.ParsingEngine.FFReader.Read()
Microsoft.BizTalk.Streaming.XmlTranslatorStream.ProcessXmlNodes(Int32 count)
Microsoft.BizTalk.Streaming.XmlBufferedReaderStream.ReadInternal(Byte[] buffer, Int32 offset, Int32 count)
Microsoft.BizTalk.Streaming.EventingReadStream.Read(Byte[] buffer, Int32 offset, Int32 count)
Microsoft.BizTalk.Streaming.MarkableForwardOnlyEventingReadStream.ReadInternal(Byte[] buffer, Int32 offset, Int32 count)
Microsoft.BizTalk.Streaming.EventingReadStream.Read(Byte[] buffer, Int32 offset, Int32 count)
System.IO.StreamReader.ReadBuffer(Char[] userBuffer, Int32 userOffset, Int32 desiredChars, Boolean& readToUserBuffer)
System.IO.StreamReader.Read(Char[] buffer, Int32 index, Int32 count)
System.Xml.XmlTextReaderImpl.ReadData()
System.Xml.XmlTextReaderImpl.InitTextReaderInput(String baseUriStr, Uri baseUri, TextReader input)
System.Xml.XmlTextReaderImpl..ctor(String url, TextReader input, XmlNameTable nt)
System.Xml.XmlTextReader..ctor(TextReader input)
Microsoft.BizTalk.Component.XmlDasmReader.GetReader(Boolean bValidate, Stream data, Encoding encoding, SchemaList envelopeSpecNames, SchemaList documentSpecNames)
Microsoft.BizTalk.Component.XmlDasmReader..ctor(IPipelineContext pipelineContext, IBaseMessageContext msgctx, Stream data, Encoding encoding, Boolean saveEnvelopes, XPathAnnotationCollection xac, NodeProcessor defaultProcessor, Boolean allowUnrecognizedMessage, Boolean validateDocument, SchemaList envelopeSpecNames, SchemaList documentSpecNames, MsgTypeSchema schemaList, Boolean promoteProperties, Boolean bamTracking, SuspendCurrentMessageFunction documentScanner)
Microsoft.BizTalk.Component.XmlDasmReader.CreateReader(IPipelineContext pipelineContext, IBaseMessageContext messageContext, MarkableForwardOnlyEventingReadStream data, Encoding encoding, Boolean saveEnvelopes, Boolean allowUnrecognizedMessage, Boolean validateDocument, SchemaList envelopeSpecNames, SchemaList documentSpecNames, IFFDocumentSpec docSpecType, SuspendCurrentMessageFunction documentScanner)
Microsoft.BizTalk.Component.FFDasmComp.Disassemble2(IPipelineContext pc, IBaseMessage inMsg)
Microsoft.BizTalk.Component.FFDasmComp.Disassemble(IPipelineContext pc, IBaseMessage inMsg)
Microsoft.Test.BizTalk.PipelineObjects.Stage.Execute(IPipelineContext pipelineContext, IBaseMessage inputMessage)
Microsoft.Test.BizTalk.PipelineObjects.GenericPipeline.ExecuteSubPipeline(IPipelineContext pipelineContext, IBaseMessage inputMessage, Int32 startStageIndex, Int32 endStageIndex)
Microsoft.Test.BizTalk.PipelineObjects.ReceivePipeline.Execute(IPipelineContext pipelineContext)
Winterdom.BizTalk.PipelineTesting.ReceivePipelineWrapper.Execute(IBaseMessage inputMessage)
x.Int.Carrier.UnitTests.Pipelines.FromCarrier.UPSUpdateFFDisassemble.UPSTrackTrace_DebatchAndConvertUPSUpdateFFToXml() in C:\Development\x.Int.Carrier\Dev\V1.0\Src\Solutions\Carrier\x.Int.Carrier.UnitTests\Pipelines\FromCarrier\UPSUpdateFFDisassemble.cs: line 59
Can anyone see where I went wrong?
It's probably not you. There are a number of 'things' that exist in the BizTalk runtime that are not recreated by any of the Pipeline Test tools.
You best option is to download the source code and run it within Visual Studio to see where it breaks.
Side comment: I run all my tests within BizTalk.

Web Service call results in an System.Xml.XmlException: '.', hexadecimal value 0x00

I get the following unhandled exception thrown from my web service - this isn't anything to do with my code and it only happens intermittently when calling the server asynchronously many times. I've included the code response object I get returned as well as this is the only thing that comes back (in this cause the generic response is a List of String).
Has anyone come across this before of know why a web service might throw this?
Entire Stack Trace:
System.Xml.XmlException: '.', hexadecimal value 0x00, is an invalid character. Line 4, position -88.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.Throw(Int32 pos, String res, String[] args)
at System.Xml.XmlTextReaderImpl.ThrowInvalidChar(Int32 pos, Char invChar)
at System.Xml.XmlTextReaderImpl.ParseNumericCharRefInline(Int32 startPos, Boolean expand, BufferBuilder internalSubsetBuilder, Int32& charCount, EntityType& entityType)
at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int32& outOrChars)
at System.Xml.XmlTextReaderImpl.ParseText()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextReader.Read()
at System.Xml.XmlReader.ReadElementString()
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderPartsLibraryService.Read29_GenericResponseOfListOfString(Boolean isNullable, Boolean checkType)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderPartsLibraryService.Read34_UploadPartsResponse()
at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer5.Deserialize(XmlSerializationReader reader)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
Simple Response object (pseudocode):
Public Class GenericResponse(Of T)
Public Enum StateOptions
Private _result As T
Private _state As StateOptions
Private _msg As String
Public Property Result() As T
Public Property State() As StateOptions
Public Property Message() As String
End Class
I ran fiddler, but this was the only out of ordinary result I haven't seen, but I don't think it would cause the problem I'm experiencing?
<?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><UploadPartsResponse xmlns="http://autovhc.co.uk/"><UploadPartsResult><Result><string>--------------------------------------------------
01/06/2011 14:38:33
Upsert Exception
Backend sent unrecognized response type: 
at Npgsql.NpgsqlState.<ProcessBackendResponses_Ver_3>d__a.MoveNext() in C:\projects\Npgsql2\src\Npgsql\NpgsqlState.cs:line 966
at Npgsql.ForwardsOnlyDataReader.GetNextResponseObject() in C:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1163
at Npgsql.ForwardsOnlyDataReader.GetNextRowDescription() in C:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1181
at Npgsql.ForwardsOnlyDataReader.NextResult() in C:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1367
at Npgsql.NpgsqlCommand.ExecuteNonQuery() in C:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:line 523
at VHC.Connections.DataAccess2.DataAccess.sqlNonQuery(NpgsqlCommand sqlCmd, Boolean closeConnection) in E:\svn_repository\vhc.server.solution\vhc.connections\Tags\v_3_0_0_5\New\ConnectionProxys\DataAccess.vb:line 119
at VHC.Connections.DataAccess2.DataAccess.sqlNonQuery(NpgsqlCommand sqlCmd) in E:\svn_repository\vhc.server.solution\vhc.connections\Tags\v_3_0_0_5\New\ConnectionProxys\DataAccess.vb:line 97
at PartsLibServerSideClasses.DAO.PLM_PsaFormat_DAO.Update(PartLibraryPartTO part, Int32 entityref, NpgsqlConnection conn) in C:\Applications\PartsImporter\Import_Library-Stable\PartsLibServerSideClasses\DAO\PSA\PLM_PsaFormat_DAO.vb:line 61
at PartsLibServerSideClasses.DAO.PLM_PsaFormat_DAO.Upsert(PartLibraryPartTO part, Int32 entityref) in C:\Applications\PartsImporter\Import_Library-Stable\PartsLibServerSideClasses\DAO\PSA\PLM_PsaFormat_DAO.vb:line 21
at PartsLibServerSideClasses.Parsing.PartsLibraryManager.SubmitPartToLibrary(PartLibraryPartWorkSegmentContainer partContainer) in C:\Applications\PartsImporter\Import_Library-Stable\PartsLibServerSideClasses\BOL\PartsLibraryManager.vb:line 70
</string></Result><State>Fail</State></UploadPartsResult></UploadPartsResponse></soap:Body></soap:Envelope>
I have seen this before in bug code that did not encode or remove 0 when users were copying/pasting values into a database field from another application and the zero was then coming out for those records all the way to the xml parser.