Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Reusing Parameters across web methods

Reply
Thread Tools

Reusing Parameters across web methods

 
 
Brian
Guest
Posts: n/a
 
      02-27-2004
I have a WSDL interface written by our customer. I want to create our own web service instance that we can test our software against. So I used wsdl.exe to generate a base WebService class that has the methods described in the WSDL

I then created the web service and provided an override of each method and copied the WebAttributes from the abstract class to the instance class (Why don't I inherit the attributes???).

When I try to look at the ASMX page I get an error stating that my element "<SampleElementName>" cannot be resolved because it is both a method message as well as a type.

What really is happening is that "<SampleElementName>" is the message parameter type in the WSDL and it is used in two web methods. If I make the name unique by changing the 'RequestElementName' attribute of the SoapDocumentMethodAttribute, then it works.

When I look at the WSDL generated, there are two element definitions that are exactly the same except for the element name (which only differs by the character '1')

Why can't I use the same element across two methods? Why doesn't wsdl.exe throw an error and complain like aps.net does

Thank

Brian
 
Reply With Quote
 
 
 
 
Dan Rogers
Guest
Posts: n/a
 
      11-11-2004
Hi Brian,

In general, it is straightforward to do what you want, assuming I
understand your problem as I read it here.

Without seeing a reproducible example, however, I'm hard pressed to
pinpoint the specifics.

Having a message name and a complex type being the same can be problematic,
and may be part of the issue. I'd have to see the original WSDL to suggest
a work around or perhaps a fix. There are several attributes you can use
to avoid different kinds of problems.

If you can send me a cut-down example that illustrates the issue, that
would be helpful.

Thanks

Dan Rogers (danro)
Microsoft Corporation
--------------------
>Thread-Topic: Reusing Parameters across web methods
>thread-index: AcP9e80B6scBIiNeSYe4NXmzIscUIw==
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
>From: "=?Utf-8?B?QnJpYW4=?=" <>
>Subject: Reusing Parameters across web methods
>Date: Fri, 27 Feb 2004 13:51:05 -0800
>Lines: 15
>Message-ID: <F4CC05C6-54A9-47C1-B0E7->
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="Utf-8"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
>Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
>Path: cpmsftngxa06.phx.gbl
>Xref: cpmsftngxa06.phx.gbl

microsoft.public.dotnet.framework.aspnet.webservic es:22039
>NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
>
>I have a WSDL interface written by our customer. I want to create our own

web service instance that we can test our software against. So I used
wsdl.exe to generate a base WebService class that has the methods described
in the WSDL.

I then created the web service and provided an override of each method and
copied the WebAttributes from the abstract class to the instance class (Why
don't I inherit the attributes???).

When I try to look at the ASMX page I get an error stating that my element
"<SampleElementName>" cannot be resolved because it is both a method
message as well as a type.

What really is happening is that "<SampleElementName>" is the message
parameter type in the WSDL and it is used in two web methods. If I make
the name unique by changing the 'RequestElementName' attribute of the
SoapDocumentMethodAttribute, then it works.

When I look at the WSDL generated, there are two element definitions that
are exactly the same except for the element name (which only differs by the
character '1').

Why can't I use the same element across two methods? Why doesn't wsdl.exe
throw an error and complain like aps.net does?

Thanks

Brian
>


 
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
Is there a way to find the class methods of a class, just like'methods' finds the instance methods? Kenneth McDonald Ruby 5 09-26-2008 03:09 PM
What methods can export excel file from stored procedure with parameters which input from web form? ABC ASP .Net 3 03-29-2006 12:36 AM
Reusing object methods? Ivan Voras Python 6 05-01-2005 04:43 PM
Reusing web user controls across application Niranjan ASP .Net Building Controls 5 08-18-2003 05:46 AM
Dynamically reusing XSLT templates across XSL files Vince C. XML 1 07-02-2003 07:55 PM



Advertisments