BizTalk Server Orchestration - Web Service XSD problem

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server Orchestration > March 2005 > Web Service XSD problem





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Web Service XSD problem
Competitve Dad

2005-03-09, 5:50 pm

I've got a web service that writes to the Event Log on an application server
for a distributed app so that every message is in one place.

The web method signature has an argument of type
System.Diagnostics.EventLogEntryType.

Problem I've got is when I build my request message in BTS I set the
parameter to use this type, but it then complains that the namespaces do not
match for the XSD types since the type reported by the orchestration is
different to the base type. If I change it to the type reported it bombs
because the type is the web service reference.

It only throws warnings on build rather than errors, but I'm old fashioned
and want it to be completely clean.

Any ideas?
Competitve Dad

2005-03-10, 5:54 pm

Well, I've now deployed the thing, and it bombs, so the warning is actually
chucking an XML error.

This is killing me now, anybody got any ideas? I can't rewrite the web
service to accept an integer because it's used all over the place, so...

Cheers,

Martin

"Competitve Dad" wrote:

> I've got a web service that writes to the Event Log on an application server
> for a distributed app so that every message is in one place.
>
> The web method signature has an argument of type
> System.Diagnostics.EventLogEntryType.
>
> Problem I've got is when I build my request message in BTS I set the
> parameter to use this type, but it then complains that the namespaces do not
> match for the XSD types since the type reported by the orchestration is
> different to the base type. If I change it to the type reported it bombs
> because the type is the web service reference.
>
> It only throws warnings on build rather than errors, but I'm old fashioned
> and want it to be completely clean.
>
> Any ideas?

Matt Milner

2005-03-10, 5:54 pm

When the web service proxy is created, you are going to get a class
definition for the logentry that is different from the .net one. This is
expected as it is a proxy. You should use this class to call the web
service. I believe you said you were getting errors on this, correct? What
erros do you get when you try to use this class, and how are you trying to
use it?

Matt


"Competitve Dad" <CompetitveDad@discussions.microsoft.com> wrote in message
news:A6E282E9-6D0B-4E63-B56E-45F6A94E1701@microsoft.com...[vbcol=seagreen]
> Well, I've now deployed the thing, and it bombs, so the warning is
> actually
> chucking an XML error.
>
> This is killing me now, anybody got any ideas? I can't rewrite the web
> service to accept an integer because it's used all over the place, so...
>
> Cheers,
>
> Martin
>
> "Competitve Dad" wrote:
>


Competitve Dad

2005-03-11, 7:47 am

Matt,

Thanks for the reply. Essentially I've got a message of type web service
request, called EventHandlerMessage, and I'm just doing the usual type of
assignment in a message contructor:

EventHandlerMessage.eventType = System.Diagnostics.EventLogEntryType.Error;

This generates an error:

The "SOAP" adapter is suspending an outbound message going to destination
URL:"http://10.100.129.78/PRISMEventHandlerService.asmx". Details:"There is
an error in XML document (2, 2).".

I've changed the thing to use an integer instead of EventLogEntryType and it
works fine, but like I say, I cannot do this in live because the service is
used everywhere. I could just add another web method, but I don't really see
why I should have to, EventLogEntryType is serializable, so...

Any help would be gratefully appreciated.

Cheers,

Martin

"Matt Milner" wrote:

> When the web service proxy is created, you are going to get a class
> definition for the logentry that is different from the .net one. This is
> expected as it is a proxy. You should use this class to call the web
> service. I believe you said you were getting errors on this, correct? What
> erros do you get when you try to use this class, and how are you trying to
> use it?
>
> Matt
>
>
> "Competitve Dad" <CompetitveDad@discussions.microsoft.com> wrote in message
> news:A6E282E9-6D0B-4E63-B56E-45F6A94E1701@microsoft.com...
>
>
>

Matt Milner

2005-03-11, 5:53 pm

I'm guessing here, but your are setting hte property on your proxy to a .net
type that is not the same as your type in the proxy. I'm guessing that the
type of the schema node is wrong because you are using an enum to set it.
Take a look at the schema for your web service and see what types, and
possible restrictions, are defined for eventType in there. Make sure to use
that type when setting this property, not the normal .Net type.

Matt


"Competitve Dad" <CompetitveDad@discussions.microsoft.com> wrote in message
news:24A9DC49-BA22-48F1-993A-8E9EA425D125@microsoft.com...[vbcol=seagreen]
> Matt,
>
> Thanks for the reply. Essentially I've got a message of type web service
> request, called EventHandlerMessage, and I'm just doing the usual type of
> assignment in a message contructor:
>
> EventHandlerMessage.eventType =
> System.Diagnostics.EventLogEntryType.Error;
>
> This generates an error:
>
> The "SOAP" adapter is suspending an outbound message going to destination
> URL:"http://10.100.129.78/PRISMEventHandlerService.asmx". Details:"There
> is
> an error in XML document (2, 2).".
>
> I've changed the thing to use an integer instead of EventLogEntryType and
> it
> works fine, but like I say, I cannot do this in live because the service
> is
> used everywhere. I could just add another web method, but I don't really
> see
> why I should have to, EventLogEntryType is serializable, so...
>
> Any help would be gratefully appreciated.
>
> Cheers,
>
> Martin
>
> "Matt Milner" wrote:
>


Competitve Dad

2005-03-11, 5:53 pm

Matt,

Basically, web I add the web reference it creates the XSD, so I have a
message part of type

PRISMEventHandlerService.Reference

(web service = PRISMEventHandlerService, schema name = Reference)

Doing something like

EventHandlerMessage.eventType = PRISMEventHandlerService.Reference;

works fine until compilation. Everything I read suggests that I need to get
the root node to set it, and I thought I would be doing something like:

EventHandlerMessage.eventType =
PRISMEventHandlerService.Reference.EventLogEntryType.Information;

but this doesn't work.

So to be clear, I've added the service reference, it's created the schema
Reference.xsd for the message part that is not a primitive type (the others
are Int32 and string), and the XSD contains the restriction and the enum
values. My question is then really how to set the message part based on the
schema reference.

Really stuck on this, I've tried every dot and parenthetical approach I can
think of, and I reckon it must be simple, and that's the way I want to go.

HELP!

"Matt Milner" wrote:

> I'm guessing here, but your are setting hte property on your proxy to a .net
> type that is not the same as your type in the proxy. I'm guessing that the
> type of the schema node is wrong because you are using an enum to set it.
> Take a look at the schema for your web service and see what types, and
> possible restrictions, are defined for eventType in there. Make sure to use
> that type when setting this property, not the normal .Net type.
>
> Matt
>
>
> "Competitve Dad" <CompetitveDad@discussions.microsoft.com> wrote in message
> news:24A9DC49-BA22-48F1-993A-8E9EA425D125@microsoft.com...
>
>
>

Matt Milner

2005-03-11, 8:50 pm

Ahh, if you are getting a complex type, then you'll likely need to do some
mapping as well to get that part of your web message created. Web services
are a little quirky in that with simple types you do one thing, but complext
types take another approach.

If you want, you can send me your project or a prototype and I can look at
it and try and send you back a more specific solution.

Matt


"Competitve Dad" <CompetitveDad@discussions.microsoft.com> wrote in message
news:59CE5B20-31CA-4BA2-90FB-612B0FEB0705@microsoft.com...[vbcol=seagreen]
> Matt,
>
> Basically, web I add the web reference it creates the XSD, so I have a
> message part of type
>
> PRISMEventHandlerService.Reference
>
> (web service = PRISMEventHandlerService, schema name = Reference)
>
> Doing something like
>
> EventHandlerMessage.eventType = PRISMEventHandlerService.Reference;
>
> works fine until compilation. Everything I read suggests that I need to
> get
> the root node to set it, and I thought I would be doing something like:
>
> EventHandlerMessage.eventType =
> PRISMEventHandlerService.Reference.EventLogEntryType.Information;
>
> but this doesn't work.
>
> So to be clear, I've added the service reference, it's created the schema
> Reference.xsd for the message part that is not a primitive type (the
> others
> are Int32 and string), and the XSD contains the restriction and the enum
> values. My question is then really how to set the message part based on
> the
> schema reference.
>
> Really stuck on this, I've tried every dot and parenthetical approach I
> can
> think of, and I reckon it must be simple, and that's the way I want to go.
>
> HELP!
>
> "Matt Milner" wrote:
>


Competitve Dad

2005-03-14, 7:51 am

I think I've made some headway on this now, but am stuck on the last part.

I have created a schema with the same structure as my web service reference
schema. I have assigned a message type to this schema and the web service
reference.

Everytime I need to create the web service message, I have a transform which
goes from my orchestration message type to my web service message type, and I
assign my web service message type then to the web service message part.

All fine, except now it is complaining about the fact that my orchestration
level message type is not initialised, so I've created an orchestration
variable of type XmlDocument, set up the node, assigned a value, and used a
message assignment to copy this to the orchestration message type.

However, I'm still getting the message not initialised error. How else can I
initialise this message type?

Thanks,

Martin

"Competitve Dad" wrote:

> I've got a web service that writes to the Event Log on an application server
> for a distributed app so that every message is in one place.
>
> The web method signature has an argument of type
> System.Diagnostics.EventLogEntryType.
>
> Problem I've got is when I build my request message in BTS I set the
> parameter to use this type, but it then complains that the namespaces do not
> match for the XSD types since the type reported by the orchestration is
> different to the base type. If I change it to the type reported it bombs
> because the type is the web service reference.
>
> It only throws warnings on build rather than errors, but I'm old fashioned
> and want it to be completely clean.
>
> Any ideas?

Competitve Dad

2005-03-14, 5:54 pm

Pretty much solved this now.

Finally got it working by creating an XmlDocument, creating the node and
setting a value for the InnerText.

Then in each message constructor throughout where I needed to use it, I
assigned this document to the orchestration message type, do the transform,
and then assign the transformed message type to my message part.

Job done!

Now just got to figure out how to set the actual InnerText dynamically to
different things, then I'm done.

Cheers,

Martin

"Competitve Dad" wrote:
[vbcol=seagreen]
> I think I've made some headway on this now, but am stuck on the last part.
>
> I have created a schema with the same structure as my web service reference
> schema. I have assigned a message type to this schema and the web service
> reference.
>
> Everytime I need to create the web service message, I have a transform which
> goes from my orchestration message type to my web service message type, and I
> assign my web service message type then to the web service message part.
>
> All fine, except now it is complaining about the fact that my orchestration
> level message type is not initialised, so I've created an orchestration
> variable of type XmlDocument, set up the node, assigned a value, and used a
> message assignment to copy this to the orchestration message type.
>
> However, I'm still getting the message not initialised error. How else can I
> initialise this message type?
>
> Thanks,
>
> Martin
>
> "Competitve Dad" wrote:
>
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com