Returning a custom class in a Web Service

I

Iain

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
 
I

Iain

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
 
I

Iain

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top