DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Wed, 1 Aug 2007 20:33:01 +0100,    posted on: microsoft.public.dotnet.framework.aspnet.webservices        back       

Thread Index
  1    Robbo
          2    John Saunders [MVP] john.saunders at trizetto.com
                 3    Robbo
                        4    John Saunders [MVP] john.saunders at trizetto.com
                               5    Robbo
                               6    John Saunders [MVP] john.saunders at trizetto.com


Returning custom type   
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
Date:Wed, 1 Aug 2007 20:33:01 +0100   Author:  

Re: Returning custom type   
"Robbo"  wrote in message 
news:eC61DLH1HHA.1168@TK2MSFTNGP02.phx.gbl...

> 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?


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.
-- 
John Saunders [MVP]
Date:Wed, 1 Aug 2007 18:36:34 -0400   Author:  

Re: Returning custom type   
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


"John Saunders [MVP]" <john.saunders at trizetto.com> wrote in message 
news:OmIYrxI1HHA.4652@TK2MSFTNGP05.phx.gbl...

> "Robbo"  wrote in message 
> news:eC61DLH1HHA.1168@TK2MSFTNGP02.phx.gbl...
>> 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?
>
> 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.
> -- 
> John Saunders [MVP]
> 
Date:Tue, 21 Aug 2007 18:27:16 +0100   Author:  

Re: Returning custom type   
"Robbo"  wrote in message 
news:uA$FPiB5HHA.5212@TK2MSFTNGP04.phx.gbl...

> 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.
-- 
John Saunders [MVP]
Date:Tue, 21 Aug 2007 19:46:08 -0400   Author:  

Re: Returning custom type   
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

"John Saunders [MVP]" <john.saunders at trizetto.com> wrote in message 
news:uH9ss1E5HHA.3716@TK2MSFTNGP03.phx.gbl...

> "Robbo"  wrote in message 
> news:uA$FPiB5HHA.5212@TK2MSFTNGP04.phx.gbl...
>> 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.
> -- 
> John Saunders [MVP]
> 
Date:Wed, 22 Aug 2007 19:36:16 +0100   Author:  

Re: Returning custom type   
Yes.
-- 
John Saunders [MVP]


"Robbo"  wrote in message 
news:OYW%23btO5HHA.2752@TK2MSFTNGP06.phx.gbl...

> 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
>
> "John Saunders [MVP]" <john.saunders at trizetto.com> wrote in message 
> news:uH9ss1E5HHA.3716@TK2MSFTNGP03.phx.gbl...
>> "Robbo"  wrote in message 
>> news:uA$FPiB5HHA.5212@TK2MSFTNGP04.phx.gbl...
>>> 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.
>> -- 
>> John Saunders [MVP]
>>
>
> 
Date:Wed, 22 Aug 2007 14:48:44 -0400   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us