Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Returning a custom class in a Web Service

Reply
Thread Tools

Returning a custom class in a Web Service

 
 
Iain
Guest
Posts: n/a
 
      07-03-2004
I am writing a Web Service in c# which returns a object structure as an out
parameter.

The object (an Order specification) is produced by xsd schema and features
the usuual combination of public properties and arrays of things.

The WEb Service builds fine.

When I try and import it with VS 2003 I get the message below.

I've looked at the wsdl and the class type is defined in xsd form pretty
much as I would have expected.

This issue appears to have hit other people, but the only vaguely useful
responses have related to Namespaces, which I've checked.

What does this message *mean*?

D:\Code\ProburnWeb\OrderMaker\Web References\OrderBatches\Reference.map(1):
Custom tool error: Unable to import WebService/Schema. Unable to import
binding 'PBWebAdminSoap' from namespace 'http://idcl.co.uk/PBWEbAdmin'.
Unable to import operation 'GetBatch'. The datatype
'http://schemas.xmlsoap.org/wsdl/:Order' is missing.


Thanks!

Iain


 
Reply With Quote
 
 
 
 
Iain
Guest
Posts: n/a
 
      07-05-2004
Lenin. Thanks for your response.

The schema (xsd file) I'm using has no other schema dependencies. All the
types are standard xml types.

And at least superficially, the contents of the class definition in the
schema for the returned object in the wsdl file seems well formed and
coherent.

However, your comments does suggest that I can try some decomposition on
this (start with a new xsd file containing one element -> new class ->
export it) to see where the problem occurs.

My interim solution was to return the Xml from the database as a string and
parse it on the client. this more or less is happening anyway (at least I
think it is ) so it should be no great issue.

AH!!! could this be something to do with the object definition on the
client side?
(the class IS imported into the client app...)

Iain


"John Jenkins" <(E-Mail Removed)> wrote in message
news:nkWFc.746$(E-Mail Removed)...
> Hi Iain,
> does the schema you are defining your class against import other
> schemas with the schemaLocation attribute set?
>
>
> I came across a similar issue in a project I am working on. My problem
> however resulted from the creation of classes from the xsd files using the
> xsd.exe tool.
>
> The issue was related to the fact that the schemaLocation attribute is
> apprently a "hint" in the appropriate specification. What it means that if
> you import any schemas into your schema you must add them to the command
> line of the XSD.exe commandline.
>
> e.g. xsd.exe /c MainSchema.xsd importedSchema.xsd
>
> HTH
>
> Lenin
>
>
> "Iain" <(E-Mail Removed)> wrote in message
> news:Oh13%(E-Mail Removed)...
> > I am writing a Web Service in c# which returns a object structure as an

> out
> > parameter.
> >
> > The object (an Order specification) is produced by xsd schema and

features
> > the usuual combination of public properties and arrays of things.
> >
> > The WEb Service builds fine.
> >
> > When I try and import it with VS 2003 I get the message below.
> >
> > I've looked at the wsdl and the class type is defined in xsd form pretty
> > much as I would have expected.
> >
> > This issue appears to have hit other people, but the only vaguely useful
> > responses have related to Namespaces, which I've checked.
> >
> > What does this message *mean*?
> >
> > D:\Code\ProburnWeb\OrderMaker\Web

> References\OrderBatches\Reference.map(1):
> > Custom tool error: Unable to import WebService/Schema. Unable to import
> > binding 'PBWebAdminSoap' from namespace 'http://idcl.co.uk/PBWEbAdmin'.
> > Unable to import operation 'GetBatch'. The datatype
> > 'http://schemas.xmlsoap.org/wsdl/:Order' is missing.
> >
> >
> > Thanks!
> >
> > Iain
> >
> >

>
>



 
Reply With Quote
 
 
 
 
Iain
Guest
Posts: n/a
 
      07-05-2004
The resolution to this problem was as follows: -

The XSD file from which the schema was generated must have a
targetNamespace.

The WebRequest must have the same targetNamespace.

I ended up getting hopelessly confused about namespace qualifications in the
schema (which did NOT seem to work as I expected) so I simply set no
qualifications for the target namespace

targetNamespace = "http://fred.com" xmlns="http://fred.com" with the two
formDefaults as unqualified...

Iain

"Iain" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Lenin. Thanks for your response.
>
> The schema (xsd file) I'm using has no other schema dependencies. All the
> types are standard xml types.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Consuming Web Service from WIndows application when WebService is using Custom Service Account ( Create an Application Pool with a Custom Identity) DNB ASP .Net Security 1 01-22-2008 09:08 PM
Error Consuming Web Service from WIndows application when WebService is using Custom Service Account ( Create an Application Pool with a Custom Identity) DNB ASP .Net Web Services 1 01-20-2008 01:47 PM
Problem returning Custom Collection from Web Service. dazmathome@hotmail.com ASP .Net Web Services 0 03-13-2006 03:56 PM
InvocationTargetException when calling "new Service()" in Axis web service to call another web service Michael Averstegge Java 0 01-10-2006 11:05 PM
returning custom class from web service suresh_C# ASP .Net Web Services 0 09-21-2004 03:11 PM



Advertisments