Having a problem with an Xlang Null Exception

Home Page Forums BizTalk 2004 – BizTalk 2010 Having a problem with an Xlang Null Exception

Viewing 0 reply threads
  • Author
    Posts
    • #22982

      I’ve
      created a BizTalk Server 2009 application set with a two way Receive
      port.  The orchestration goes like this:

       

      1:
      The incoming Message is Received via an HTTP Pipeline

      2:
      When the message comes in, I have a “Decide” shape, where the two
      promoted fields “Username/Password” in the message are checked
      against a SQL Server data store.  If the user’s credentials succeed or
      fail, a Message is created (using an Message Assignment I explain in step 3)
      saying “Success” or “Failed” and sent back to the sender.

       

      3: 
      For both the SQL Query for the user’s credentials and the means to instantiate
      a Message Assignment, I use a custom C# class library.  (I’ll eventually
      learn the  BizTalk data adapter for SQL Queries, but for now it seems to
      work great.).  As my current tests are using invalid user credentials, I
      just want a “Failed” message created, and sent back.  And while
      I know I’m getting the SQL Check just fine, I know it’s the Message Assignment
      for the “Failed” message where I’m falling into this error:

       

      Shape
      name: CreateFailureMessage (The message that I send if a User doesn’t
      authenticate in

      ShapeId:
      6c9071f5-bcde-489a-90e7-f142310e5c0a

      Exception
      thrown from: segment 1, progress 17

      Inner
      exception: Object reference not set to an instance of an object.

       

      The
      method that I’m using in particular as to how I’m doing Message Assignment came
      from this blog:

      http://geekswithblogs.net/michaelstephenson/archive/2006/09/26/92363.aspx  
      I used his tutorial practically “as is”. I turned my .xsd into a C#
      class via xsd.exe and then created the Adapter class as in his blog. Here’s the
      code for that.

       

      namespace
      Blaxo.Objects

      {

        
       

         
      [Serializable]

         
      [XmlRoot(“Response”, Namespace = “http://BTPing.PingReply“)]

         
      public class PingReplyAdapter : Response

         
      {

             
      public XmlDocument ToXmlDocument()

             
      {

                 
      XmlSerializer serializer = new XmlSerializer(typeof(PingReplyAdapter));

                 
      StringBuilder sb = new StringBuilder();

                 
      serializer.Serialize(new StringWriter(sb, CultureInfo.InvariantCulture),this);

       

                 
      XmlDocument doc = new XmlDocument();

                 
      doc.LoadXml(sb.ToString());

                 
      return doc;

             
      }

         
      }

      }

       

      The
      only thing that I’m wondering after done even more looking into this:

       

      A:
      The name space is the name of the .xsd message file.  (PingReply.xsd)

      B:
      The name of the actual class is the Root node (Reply.cs, as the Root node of
      PingReply.xsd is Reply)

       

      So,
      perhaps XmlRoot(“Repose”… May need something different?

Viewing 0 reply threads
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.