| Author |
SOAP header type mismatch
|
|
| kplkumar@gmail.com 2005-09-26, 5:59 pm |
| I have a schema published as SOAP header. Some of the fields are
promoted. I have to extract those fields and populate another object
before calling an external dll. The problem happens when I assign these
fields to the fields in the object.
For example, "sessionMemento" is the object,
sessionMemento = new EReferrals.ERUI.UIServices.SessionMemento();
sessionMemento.UserId = myNamespace.PropertySchema.UserId;
when I do this, the XLang compiler complains that
cannot implicitly convert type 'myNamespace.PropertySchema.UserId' to
'System.Int64'
when the UserId in the exposed schema is actually a Int64. How could
this be resolved. Or is there another way of doing this? Thanks in
advance.
| |
|
| Have you tried
sessionMemento.UserId =
System.Convert.ToInt64(myNamespace.PropertySchema.UserId);
which I think should explicity convert it.
"kplkumar@gmail.com" wrote:
> I have a schema published as SOAP header. Some of the fields are
> promoted. I have to extract those fields and populate another object
> before calling an external dll. The problem happens when I assign these
> fields to the fields in the object.
>
> For example, "sessionMemento" is the object,
>
> sessionMemento = new EReferrals.ERUI.UIServices.SessionMemento();
> sessionMemento.UserId = myNamespace.PropertySchema.UserId;
>
> when I do this, the XLang compiler complains that
>
> cannot implicitly convert type 'myNamespace.PropertySchema.UserId' to
> 'System.Int64'
>
> when the UserId in the exposed schema is actually a Int64. How could
> this be resolved. Or is there another way of doing this? Thanks in
> advance.
>
>
| |
| kplkumar@gmail.com 2005-09-27, 5:53 pm |
| I know it should. I tried that, but it says
"illegal use of identifier 'myNamespace.PropertySchema.UserId' in an
expression"
during compile time.
| |
| Krishnan 2005-09-28, 5:59 pm |
| you should always use promoted properties using the message context.
Like this for getting value
struserid = message1(myNamespace.PropertySchema.UserId)
for setting value
message1(myNamespace.PropertySchema.UserId) = struserid
Hope this is useful
Thanks
Krishnan
"kplkumar@gmail.com" wrote:
> I know it should. I tried that, but it says
>
> "illegal use of identifier 'myNamespace.PropertySchema.UserId' in an
> expression"
>
> during compile time.
>
>
| |
| kplkumar@gmail.com 2005-09-29, 5:58 pm |
| I am new to BizTalk. I do know that we can promote fields in a schema.
However, is it different to promote properties "using the message
context"??
Also, when I do "message1(" the intellisense does not show the
myNamespace.PropertySchema.UserId. I am sure why.
Can you throw some light on this? Please.
| |
| kplkumar@gmail.com 2005-09-29, 5:58 pm |
| To add to my previous post, the "message1" is actually a .NET object.
It's not a regular schema message type. Would that make a difference??
The myNamespace.PropertySchema is a property schema for a schema that I
am using as SOAP header. I want to access some variable from this SOAP
header. Saying that, should it in someway be associated to every
message that comes in? If so how? Do I have to change the target name
space in this schema? The help says,
"The defined SOAP header context properties in orchestrations require a
property schema. The property schema must have the target namespace
http://schemas.microsoft.com/BizTalk/2003/SOAPHeader. Each root element
name in the property schema must match the root element name of the
defined SOAP header. You can then access the values of the context
properties using the namespace of the property schema and the property
name. The namespace of the property schema is different from the target
namespace listed above. Although the namespace of the property schema
can be any string, it usually defaults to the name of the project. "
Help!!
| |
| kplkumar@gmail.com 2005-09-29, 5:58 pm |
| One other question is that, would it help if I change my incoming port
type to SOAP instead of HTTP??
|
|
|
|