Object reference not set to an instance of an object.
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server Orchestration > Object reference not set to an instance of an object.




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Object reference not set to an instance of an object.  
Mangi


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-16-04 02:09 AM

I have an incoming message from a web service of type xml.xmldocument.
I receive the message alright, then I have an assignment shape with the
following.

msgOrderDocument = msgIbisOrderResponse.GetOrderByTrackingNumberResult;


msgOrderDocument type is a schema.
I do this because I have to use the incoming message in a map, and there is
no way of using xml.xmldocument in a map.

How can I get the xmldocument and use it in a map?

The error I get is...

Object reference not set to an instance of an object.

Exception type: NullReferenceException
Source: ClientInterface
Target Site: Microsoft.XLANGs.Core.StopConditions
segment1(Microsoft.XLANGs.Core.StopConditions)


Thanks

Mangi.







[ Post a follow-up to this message ]



    RE: Object reference not set to an instance of an object.  
Stephen W. Thomas


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-16-04 02:09 AM

Are you creating a new instance of your schema before this step?
If not, you need to do something like this first:

// Create a new Xml Document
xDoc = new System.Xml.XmlDocument();

// Load a blank schema into your Document
// This line might not be needed, I think I have got it to work without it
xDoc.LoadXml(“<root>…blank schema here”);

// Set that Xml document to your message
msgOrderDocument = xDoc;

// Your line of code here

The help guide talks about a few different ways to create an new instance of
a schema.

On a side note, I think it is possible to map a message that is an
XmlDocument to another message that is XmlDocument.  Both the inbound and
outbound have to be defined as messages so I do not think it would solve thi
s
problem.  To do this mapping, just look in the help guide for “Assigning t
o
Transforms Dynamically”.  The code looks something like this:

Inside an Expressions Shape (not Message Assignment even though you use a
Construct)

construct outXmlMessage
{
transform (outMmlMessage) = Project.Mapname(inXmlMessage);
}

This can be risky though, I have seen my messages just pass right through
without being mapped and gives no error.  I think it was because the message
types didn’t match what the maps were expecting… i.e. user error.

Stephen W. Thomas
http://www.geekswithblogs.net/sthomas


"Mangi" wrote:

> I have an incoming message from a web service of type xml.xmldocument.
> I receive the message alright, then I have an assignment shape with the
> following.
>
> msgOrderDocument = msgIbisOrderResponse.GetOrderByTrackingNumberResult;
>
>
> msgOrderDocument type is a schema.
> I do this because I have to use the incoming message in a map, and there i
s
> no way of using xml.xmldocument in a map.
>
> How can I get the xmldocument and use it in a map?
>
> The error I get is...
>
> Object reference not set to an instance of an object.
>
> Exception type: NullReferenceException
> Source: ClientInterface
> Target Site: Microsoft.XLANGs.Core.StopConditions
> segment1(Microsoft.XLANGs.Core.StopConditions)
>
>
> Thanks
>
> Mangi.
>
>





[ Post a follow-up to this message ]



    RE: Object reference not set to an instance of an object.  
Mangi


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-16-04 02:09 AM

Thanks for that,
Actually the error occurs when i try to use the message in a map.
after creating the message in the assign shape, i wrote it to file and it
writes out ok as a valid xml document.

This is even more puzzling, if i can write out the message to file using a
send shape, why can't i use the message in a map? The map is the very next
step after the send shape.


"Stephen W. Thomas" wrote:
[vbcol=seagreen]
> Are you creating a new instance of your schema before this step?
> If not, you need to do something like this first:
>
> // Create a new Xml Document
> xDoc = new System.Xml.XmlDocument();
>
> // Load a blank schema into your Document
> // This line might not be needed, I think I have got it to work without it
> xDoc.LoadXml(“<root>…blank schema here”);
>
> // Set that Xml document to your message
> msgOrderDocument = xDoc;
>
> // Your line of code here
>
> The help guide talks about a few different ways to create an new instance 
of
> a schema.
>
> On a side note, I think it is possible to map a message that is an
> XmlDocument to another message that is XmlDocument.  Both the inbound and
> outbound have to be defined as messages so I do not think it would solve t
his
> problem.  To do this mapping, just look in the help guide for “Assigning
 to
> Transforms Dynamically”.  The code looks something like this:
>
> Inside an Expressions Shape (not Message Assignment even though you use a
> Construct)
>
> construct outXmlMessage
> {
>        transform (outMmlMessage) = Project.Mapname(inXmlMessage);
> }
>
> This can be risky though, I have seen my messages just pass right through
> without being mapped and gives no error.  I think it was because the messa
ge
> types didn’t match what the maps were expecting… i.e. user error.
>
> Stephen W. Thomas
> http://www.geekswithblogs.net/sthomas
>
>
> "Mangi" wrote:
> 





[ Post a follow-up to this message ]



    RE: Object reference not set to an instance of an object.  
Mangi


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-16-04 02:09 AM

Thanks for that,
Actually the error occurs when i try to use the message in a map.
after creating the message in the assign shape, i wrote it to file and it
writes out ok as a valid xml document.

This is even more puzzling, if i can write out the message to file using a
send shape, why can't i use the message in a map? The map is the very next
step after the send shape.


"Stephen W. Thomas" wrote:
[vbcol=seagreen]
> Are you creating a new instance of your schema before this step?
> If not, you need to do something like this first:
>
> // Create a new Xml Document
> xDoc = new System.Xml.XmlDocument();
>
> // Load a blank schema into your Document
> // This line might not be needed, I think I have got it to work without it
> xDoc.LoadXml(“<root>…blank schema here”);
>
> // Set that Xml document to your message
> msgOrderDocument = xDoc;
>
> // Your line of code here
>
> The help guide talks about a few different ways to create an new instance 
of
> a schema.
>
> On a side note, I think it is possible to map a message that is an
> XmlDocument to another message that is XmlDocument.  Both the inbound and
> outbound have to be defined as messages so I do not think it would solve t
his
> problem.  To do this mapping, just look in the help guide for “Assigning
 to
> Transforms Dynamically”.  The code looks something like this:
>
> Inside an Expressions Shape (not Message Assignment even though you use a
> Construct)
>
> construct outXmlMessage
> {
>        transform (outMmlMessage) = Project.Mapname(inXmlMessage);
> }
>
> This can be risky though, I have seen my messages just pass right through
> without being mapped and gives no error.  I think it was because the messa
ge
> types didn’t match what the maps were expecting… i.e. user error.
>
> Stephen W. Thomas
> http://www.geekswithblogs.net/sthomas
>
>
> "Mangi" wrote:
> 





[ Post a follow-up to this message ]



    RE: Object reference not set to an instance of an object.  
Stephen W. Thomas


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-16-04 02:09 AM

Interesting.  I got an error kind of like that that other day when I was
trying to pass back two XML Documents for a VB method.  The data wrote out
find but wouldn’t send.  I found it was failing on the Send Shape as well.

I solved it by making the whole call including the send in an Atomic Scope
shape, even though it did not need to be.

A quick test would be to set the Orchestration as Atomic and see what happen
s.

Stephen W. Thomas
http://www.geekswithblogs.net/sthomas


"Mangi" wrote:
[vbcol=seagreen]
> Thanks for that,
> Actually the error occurs when i try to use the message in a map.
> after creating the message in the assign shape, i wrote it to file and it
> writes out ok as a valid xml document.
>
> This is even more puzzling, if i can write out the message to file using a
> send shape, why can't i use the message in a map? The map is the very next
> step after the send shape.
>
>
> "Stephen W. Thomas" wrote:
> 





[ Post a follow-up to this message ]



    RE: Object reference not set to an instance of an object.  
Mangi


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-16-04 02:09 AM

100% correct.
I put it into an atomic scope and it works like a charm.

Thank you.

Mangi.

"Stephen W. Thomas" wrote:
[vbcol=seagreen]
> Interesting.  I got an error kind of like that that other day when I was
> trying to pass back two XML Documents for a VB method.  The data wrote out
> find but wouldn’t send.  I found it was failing on the Send Shape as wel
l.
>
> I solved it by making the whole call including the send in an Atomic Scope
> shape, even though it did not need to be.
>
> A quick test would be to set the Orchestration as Atomic and see what happ
ens.
>
> Stephen W. Thomas
> http://www.geekswithblogs.net/sthomas
>
>
> "Mangi" wrote:
> 





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:13 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register