Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Thu, 17 Apr 2008 13:24:00 -0700 (PDT),    group: microsoft.public.dotnet.framework.aspnet.webservices        back       


Centralize SOAPHeader Processing?   
Hi all,

In an ASP.NET web service, is there a way I can centralize processing of 
SOAP Headers?

Currently I need to nput my header logic into each webmethod - is there an 
event, mechanism, extension, etc I can hook into to do all my processing 
before the webmethod is executed?

Thanks!

-- 
spamhoneypot@rogers.com (Do not e-mail)
date: Thu, 17 Apr 2008 05:41:12 GMT   author:   Spam Catcher

DateTimes and MinOccurs   
I'm writing a webservice where all of the data elements should have a
minOccurs = 0.  I'm using VS2005.

This is fine for most of my elements, but all of my datetime elements
automatically receive a minOccurs = 1 in the auto generated WSDL
file.

For example , if these were some fields in my Web Service code:
    public string category;

    public string condition;

    public datetime dateOfPurchase;

My WSDL file turns out like this:
<s:element minOccurs="0" maxOccurs="1" name="category"
type="s:string" />
 <s:element minOccurs="0" maxOccurs="1" name="condition"
type="s:string" />
 <s:element minOccurs="1" maxOccurs="1" name="dateOfPurchase"
type="s:dateTime" />

Any thoughts? I'm working on another project where I've been given a
WSDL file generated from VS2008 - and this WSDL does have dateTimes
with minOccurs = 0.  Is this a VS2005 limitation? Or am I doing
something wrong?

Any thoughts?
Thanks so much!

ami
date: Thu, 17 Apr 2008 13:24:00 -0700 (PDT)   author:   ads

Re: DateTimes and MinOccurs   
"ads"  wrote in message 
news:9089ef24-76be-477a-b56a-1dd202a0ebb3@k13g2000hse.googlegroups.com...
> I'm writing a webservice where all of the data elements should have a
> minOccurs = 0.  I'm using VS2005.
>
> This is fine for most of my elements, but all of my datetime elements
> automatically receive a minOccurs = 1 in the auto generated WSDL
> file.

What value would you want assigned to your DateTime parameter if it isn't 
supplied in the SOAP? There is no really good answer to that, as 
DateTime.MinValue is a valid DateTime.

Instead, try using DateTime? (System.Nullable<DateTime>) for the parameter 
type and see if that changes the WSDL that is generated.

Finally, if you ever get into a situation where the generated WSDL doesn't 
match what you want, remember that you don't have to allow .NET to generate 
the WSDL. You can create your own WSDL instead.

-- 
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer
date: Mon, 21 Apr 2008 14:38:30 -0400   author:   John Saunders

RE: DateTimes and MinOccurs   
Try using the "Specified" attribute:
If you have a public property called

dateOfPurchase

"ads" wrote:

> I'm writing a webservice where all of the data elements should have a
> minOccurs = 0.  I'm using VS2005.
> 
> This is fine for most of my elements, but all of my datetime elements
> automatically receive a minOccurs = 1 in the auto generated WSDL
> file.
> 
> For example , if these were some fields in my Web Service code:
>     public string category;
> 
>     public string condition;
> 
>     public datetime dateOfPurchase;
> 
> My WSDL file turns out like this:
> <s:element minOccurs="0" maxOccurs="1" name="category"
> type="s:string" />
>  <s:element minOccurs="0" maxOccurs="1" name="condition"
> type="s:string" />
>  <s:element minOccurs="1" maxOccurs="1" name="dateOfPurchase"
> type="s:dateTime" />
> 
> Any thoughts? I'm working on another project where I've been given a
> WSDL file generated from VS2008 - and this WSDL does have dateTimes
> with minOccurs = 0.  Is this a VS2005 limitation? Or am I doing
> something wrong?
> 
> Any thoughts?
> Thanks so much!
> 
> ami
>
date: Thu, 22 May 2008 22:39:00 -0700   author:   Priya

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us