Winterdom BizTalk Pipeline Test - unit-testing

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.

Related

Using C++ protobuf formatted structure in leveldb. set/get operations

I'd like to make a POC of using leveldb in order to store key-value table of different data types in protobuf format.
So far I was able to open the database file, and I also saw the get function with the following signature :
virtual Status Get(const ReadOptions& options, const Slice& key, std::string* value)=0
I understand that the value is actually refers to a binary string like vector and not regular alphanumeric string, so I guess it can fit for multi type primitives like string, uint, enum) but how can it support struct/class that represent protobuf layout in c++ ?
So this is my proto file that I'd like to store in the leveldb:
message agentStatus {
string ip = 1;
uint32 port = 2;
string url = 3;
google.protobuf.Timestamp last_seen = 4;
google.protobuf.Timestamp last_keepalive = 5;
bool status = 6;
}
and this is my current POC code. How can I use the get method to access any of the variables from the table above ?
#include <leveldb/db.h>
void main () {
std::string db_file_path = "/tmp/data.db";
leveldb::DB* db;
leveldb::Status status;
leveldb::Options options;
options.create_if_missing = false;
status_ = leveldb::DB::Open(options, db_file_path, &db);
if (!status_.ok()) {
throw std::logic_error("unable to open db");
}
Thanks !
You need to serialize the protobuf message into a binary string, i.e. SerilaizeToString, and use the Put method to write the binary string to LevelDB with a key.
Then you can use the Get method to retrieve the binary value with the given key, and parse the binary string to a protobuf message, i.e. ParseFromString.
Finally, you can get fields of the message.

aws s3 - browser upload using post - gwt & java

I am working on a wgt webapp and would like to upload files to s3 from the browser.
Since my credentials are on the server, I need to create the signature on the server and send it to the client to be able to ulpoad.
here is the code I am using:
-dateStamp is in the right format - yyyyMMdd
-policy is base64 encoded - I double checked that
public static String getSignatureForS3Upload(final String dateStamp, final String policy) {
byte[] signingKey = null;
byte[] signature = null;
String strSignature = null;
try {
signingKey = AwsUtill.getSignatureKey(AppConfig.getS3SecretKey(), dateStamp,
AppConfigShared.getMyAwsS3RegionName(), "s3");
signature = HmacSHA256(policy, signingKey);
strSignature = bytesToHex(signature);
}
catch (Exception e) {
// log
}
ServerDBLogger.log(Level.INFO, byteArrayToHex(signature));
ServerDBLogger.log(Level.INFO, bytesToHex(signature));
return strSignature;
private static byte[] HmacSHA256(final String data, final byte[] key) throws Exception {
String algorithm = "HmacSHA256";
Mac mac = Mac.getInstance(algorithm);
mac.init(new SecretKeySpec(key, algorithm));
return mac.doFinal(data.getBytes("UTF-8"));
}
private static byte[] getSignatureKey(final String key, final String dateStamp, final String regionName,
final String serviceName) throws Exception {
byte[] kSecret = ("AWS4" + key).getBytes("UTF-8");
byte[] kDate = HmacSHA256(dateStamp, kSecret);
byte[] kRegion = HmacSHA256(regionName, kDate);
byte[] kService = HmacSHA256(serviceName, kRegion);
byte[] kSigning = HmacSHA256("aws4_request", kService);
return kSigning;
}
final protected static char[] hexArray = "0123456789ABCDEF".toCharArray();
public static String bytesToHex(final byte[] bytes) {
char[] hexChars = new char[bytes.length * 2];
for (int j = 0; j < bytes.length; j++) {
int v = bytes[j] & 0xFF;
hexChars[j * 2] = hexArray[v >>> 4];
hexChars[j * 2 + 1] = hexArray[v & 0x0F];
}
return new String(hexChars);
}
With the genarated signature I get an error message:
The request signature we calculated does not match the signature you provided. Check your key and signing method.
What am I doing wrong?
Is there any good tutorial or sample code to do this?
Thank you!
There have been changes to the AWS signature process - the version at this time (May 2016) is AWS Signature version 4 (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). You need to be careful when looking at examples and Stackoverflow etc that the information relates to the same signature version you are using as they don't mix well.
I started using the AWS SDK for an angular/node file upload but eventually found it easier to generate the policy on the server (node.js) side without the SDK. There is a good example (albeit node based which may not be what you are looking for) here: https://github.com/danialfarid/ng-file-upload/wiki/Direct-S3-upload-and-Node-signing-example (but note the issue with the S3 bucket name here: AngularJs Image upload to S3 ).
One key thing to watch is that you correctly include the file content type in the policy generation and that this content type properly matches the content type of the file you are actually uploading.

Dynamics CRM Unexpected Error when trying to view Prospects/Leads

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.

SharePoint 2013 Workflows List does not exist error- Lookup column

Get error when refer to lookup column in SPD 2013
SharePoint 2013 Workflows List does not exist error.RequestorId: 29235e5e-b907-f47c-0000-000000000000. Details: RequestorId: 29235e5e-b907-f47c-0000-000000000000. Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.ApplicationException: HTTP 404 {"error":{"code":"-2130575322, Microsoft.SharePoint.SPException","message":{"lang":"en-US","value":"List does not exist.\u000a\u000aThe page you selected contains a list that does not exist. It may have been deleted by another user."},"innererror":{"message":"List does not exist.\u000a\u000aThe page you selected contains a list that does not exist. It may have been deleted by another user.","type":"Microsoft.SharePoint.SPException","stacktrace":" at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)\u000d\u000a at Microsoft.SharePoint.Library.SPRequest.GetListsWithCallback(String bstrUrl, Guid foreignWebId, String bstrListInternalName, Int32 dwBaseType, Int32 dwBaseTypeAlt, Int32 dwServerTemplate, UInt32 dwGetListFlags, UInt32 dwListFilterFlags, Boolean bPrefetchMetaData, Boolean bSecurityTrimmed, Boolean bGetSecurityData, Boolean bPrefetchRelatedFields, ISP2DSafeArrayWriter p2DWriter, Int32& plRecycleBinCount)\u000d\u000a at Microsoft.SharePoint.SPListCollection.EnsureListsData(Guid webId, String strListName)\u000d\u000a at Microsoft.SharePoint.SPListCollection.ItemByInternalName(String strInternalName, Boolean bThrowException)\u000d\u000a at Microsoft.SharePoint.SPListCollection.GetList(Guid uniqueId, Boolean fetchMetadata)\u000d\u000a at Microsoft.SharePoint.SPListCollection.GetById(Guid uniqueId)\u000d\u000a at Microsoft.SharePoint.ServerStub.SPListCollectionServerStub.InvokeMethod(Object target, String methodName, ClientValueCollection xmlargs, ProxyContext proxyContext, Boolean& isVoid)\u000d\u000a at Microsoft.SharePoint.Client.ServerStub.InvokeMethodWithMonitoredScope(Object target, String methodName, ClientValueCollection args, ProxyContext proxyContext, Boolean& isVoid)\u000d\u000a at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.InvokeMethod(Boolean mainRequestPath, Object value, ServerStub serverProxy, EdmParserNode node, Boolean resourceEndpoint, MethodInformation methodInfo, Boolean isExtensionMethod, Boolean isIndexerMethod)\u000d\u000a at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.GetObjectFromPathMember(Boolean mainRequestPath, String path, Object value, EdmParserNode node, Boolean resourceEndpoint, MethodInformation& methodInfo)\u000d\u000a at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.GetObjectFromPath(Boolean mainRequestPath, String path, String pathForErrorMessage)\u000d\u000a at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.Process()\u000d\u000a at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.ProcessRequest()\u000d\u000a at Microsoft.SharePoint.Client.Rest.RestService.ProcessQuery(Stream inputStream, IList`1 pendingDisposableContainer)","internalexception":{"message":"List does not exist.\u000a\u000aThe page you selected contains a list that does not exist. It may have been deleted by another user.0x81020026","type":"System.Runtime.InteropServices.COMException","stacktrace":" at Microsoft.SharePoint.Library.SPRequestInternalClass.GetListsWithCallback(String bstrUrl, Guid foreignWebId, String bstrListInternalName, Int32 dwBaseType, Int32 dwBaseTypeAlt, Int32 dwServerTemplate, UInt32 dwGetListFlags, UInt32 dwListFilterFlags, Boolean bPrefetchMetaData, Boolean bSecurityTrimmed, Boolean bGetSecurityData, Boolean bPrefetchRelatedFields, ISP2DSafeArrayWriter p2DWriter, Int32& plRecycleBinCount)\u000d\u000a at Microsoft.SharePoint.Library.SPRequest.GetListsWithCallback(String bstrUrl, Guid foreignWebId, String bstrListInternalName, Int32 dwBaseType, Int32 dwBaseTypeAlt, Int32 dwServerTemplate, UInt32 dwGetListFlags, UInt32 dwListFilterFlags, Boolean bPrefetchMetaData, Boolean bSecurityTrimmed, Boolean bGetSecurityData, Boolean bPrefetchRelatedFields, ISP2DSafeArrayWriter p2DWriter, Int32& plRecycleBinCount)"}}}} {"Transfer-Encoding":["chunked"],"X-SharePointHealthScore":["1"],"SPClientServiceRequestDuration":["82"],"SPRequestGuid":["29235e5e-b907-f47c-b422-c13bd7e6d2ae"],"request-id":["29235e5e-b907-f47c-b422-c13bd7e6d2ae"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"MicrosoftSharePointTeamServices":["15.0.0.4517"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1; RequireReadOnly"],"Cache-Control":["max-age=0, private"],"Date":["Mon, 11 Aug 2014 07:08:01 GMT"],"Server":["Microsoft-IIS/8.0"],"X-AspNet-Version":["4.0.30319"],"X-Powered-By":["ASP.NET"]} at Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
You can't retrieve Lookup Fields (Except Id field) directly in sharepoint 2013 workflow.
Suppose you have 2 list: Products list & Orders list
In Orders list you have a lookup field from Products list.
In workflow you can retrieve ProductId field from order list. And then use REST API call to get other product fields ( like title )

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.