Hi,
I am creating a webservice which will be consumed by a 3rd party, non dotnet
client.
I want to return a custom datatype from my webservice. It's a relatively
simple Customer object which just contains strings.
eg:
[WebMethod]
public Customer GetCustomer(int custId)
{
return new Customer();
}
now, my Customer class is defined as follows:
[Serializable]
public class Customer
{
// properties are forename, surname, title, address etc (all strings)
}
My question is this...when I expose this webmethod the clients do not see
any of the Customer type definition in the WDSL, so they don't actually know
what data they are getting back.
Am I missing something here? I was expecting the Customer object structure
to be present in the WDSL?
Thanks,
Rob
John Saunders [MVP] - 01 Aug 2007 23:36 GMT
> Hi,
>
[quoted text clipped - 26 lines]
> Am I missing something here? I was expecting the Customer object
> structure to be present in the WDSL?
Have you looked at the generated WSDL? It will contain a definition of a
complex type which is equivalent to the Customer type that you are
returning.

Signature
John Saunders [MVP]
Robbo - 21 Aug 2007 18:27 GMT
Thanks John, it was indeed!
I wonder if you can help regarding webservices and exceptions? I have given
the WSDL to my integration team and they are saying it needs a "fault"
element.
I.e: something like:
<wsdl:operation name="MI_OUT_customerData">
<soap:operation
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
soapAction=http://blah.com/get />
<wsdl:input>
<soap:body
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal" />
</wsdl:output>
<wsdl:fault name="CustomError">
<soap:fault
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"
name="CustomError" />
</wsdl:fault>
</wsdl:operation>
However, I only have the input & output elements under my operation.
Can I get the fault in there somehow?
Actually I think I'll post this as a new thread!
Thanks,
Paul
>> Hi,
>>
[quoted text clipped - 30 lines]
> complex type which is equivalent to the Customer type that you are
> returning.
John Saunders [MVP] - 22 Aug 2007 00:46 GMT
> Thanks John, it was indeed!
>
> I wonder if you can help regarding webservices and exceptions? I have
> given the WSDL to my integration team and they are saying it needs a
> "fault" element.
Already answered.

Signature
John Saunders [MVP]
Robbo - 22 Aug 2007 19:36 GMT
Hi there John I couldn't see an answer to the "fault" query, apart from a
reply from Nathan Anderson on the webforum saying it is not supported by
ASPX.
Is this the answer you are referring to?
Thanks,
Paul
>> Thanks John, it was indeed!
>>
[quoted text clipped - 3 lines]
>
> Already answered.
John Saunders [MVP] - 22 Aug 2007 19:48 GMT
Yes.

Signature
John Saunders [MVP]
> Hi there John I couldn't see an answer to the "fault" query, apart from a
> reply from Nathan Anderson on the webforum saying it is not supported by
[quoted text clipped - 13 lines]
>>
>> Already answered.
Robbo - 23 Aug 2007 19:06 GMT
Ah.
Ok thanks for getting back to me!
> Yes.
>> Hi there John I couldn't see an answer to the "fault" query, apart from a
[quoted text clipped - 14 lines]
>>>
>>> Already answered.