Reusing Parameters across web methods

B

Brian

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
 
D

Dan Rogers

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.webservices
From: "=?Utf-8?B?QnJpYW4=?=" <[email protected]>
Subject: Reusing Parameters across web methods
Date: Fri, 27 Feb 2004 13:51:05 -0800
Lines: 15
Message-ID: <[email protected]>
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.webservices
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet.webservices:22039
NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices

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
 

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

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top