Web Service Strange Error "Service Description altering attributes cannot be specified on service implementation. "

G'day folks;

I built a web service based on a given XLM request message and XML response message following the guidelines provided by Yasser Shohoud in his article "Place XML Message Design Ahead of Schema Planning to Improve Web Service Interoperability"  I used given response and request documents provided by a user manual for an Air Force web service that returns weather imagery.  The web service built correctly.  There was some confusion at first because Yasser used C# and I used vbNet.  The wsdl.exe created a stub file with an interface called IWeatherServiceTest instead of an abstract class by that name and the web service had to implement the interface rather than inherit the base class.  But everything built alright.  I then built the tools to consume the service, and rant them.  The error statement listed below came back. When I ran the web service from debug I got the same error.  

System.InvalidOperationException: Method ReturnWeatherImageData on type wsWeatherXML.WeatherService is an implementation of the service contract interface wsWeatherXML.IWeatherServiceTest. Service Description altering attributes cannot be specified on service implementation.  Please place custom attribute on the interface declaration: interface: wsWeatherXML.IWeatherServiceTest, method: wsWeatherXML.ResponseList ReturnWeatherImageData(wsWeatherXML.RequestList), attribute: System.Xml.Serialization.XmlElementAttribute.

 

I have no idea what this statement means.  I googled this part of the error message "Service Description altering attributes cannot be specified on service implementation." and got not hits.  I am not clear where they want me to place this custom attribute.  Does VS want me to add it to the <System.CodeDom etc attribute list on the Public interface?  Here is my Interface as declared in my stub

 

 
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42"),  _
 System.Web.Services.WebServiceBindingAttribute(Name:="WeatherServiceTest", [Namespace]:="http://localhost/wsWeatherXML/")>  _
Public Interface IWeatherServiceTest
    
    '''<remarks/>
    <System.Web.Services.WebMethodAttribute(),  _
     System.Web.Services.Protocols.SoapDocumentMethodAttribute("", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Bare)>  _
    Function ReturnWeatherImageData(<System.Xml.Serialization.XmlElementAttribute([Namespace]:="http://localhost/wsWeatherXML/")> ByVal RequestList As RequestList) As <System.Xml.Serialization.XmlElementAttribute("ResponseList", [Namespace]:="http://localhost/wsWeatherXML/")> ResponseList
End Interface
 

 Here is the derived Web Service (with the FOUO areas removed)

 

<System.Web.Services.WebService(Namespace:="http://localhost/wsWeatherXML/")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class WeatherService
    Inherits System.Web.Services.WebService
    Implements IWeatherServiceTest

    <WebMethod()> _
        <SoapDocumentMethodAttribute("", Binding:="IWeatherServiceTest", ParameterStyle:=SoapParameterStyle.Bare)> _
    Public Function ReturnWeatherImageData(<System.Xml.Serialization.XmlElementAttribute([Namespace]:="http://localhost/wsWeatherXML/")> ByVal RequestList As RequestList) As <System.Xml.Serialization.XmlElementAttribute("ResponseList", [Namespace]:="http://localhost/wsWeatherXML/")> ResponseList Implements IWeatherServiceTest.ReturnWeatherImageData
        Dim result As New ResponseList
        Dim response1 As New ResponseListResponse
        
        result.Response = response1

        Return result
    End Function

End Class
 I am really baffled by this.
 
  

 


E.R. Joell
0
joeller
1/8/2009 8:21:07 PM
asp.net.xml-web-services 7071 articles. 0 followers. Follow

6 Replies
2114 Views

Similar Articles

[PageSpeed] 1

Leave these off of the class:\

<System.Web.Services.WebService(Namespace:="http://localhost/wsWeatherXML/")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)>

Since they're already on the interface, you don't need them on the class.

 


John Saunders | MVP – Connected System Developer
0
johnwsaunders3
1/9/2009 1:27:07 AM

Great Thanks for your prompt assistance.


E.R. Joell
0
joeller
1/13/2009 2:41:12 PM

If that reply solved your problem, then please mark it as being the answer so others can find it later.


John Saunders | MVP – Connected System Developer
0
johnwsaunders3
1/13/2009 7:51:58 PM

Made suggested change.  Same error message.  What now?

 

InvalidOperationException: Method ReturnWeatherImageData on type wsWeatherXML.WeatherService is an implementation of the service contract interface wsWeatherXML.IWeatherServiceTest. Service Description altering attributes cannot be specified on service implementation.  Please place custom attribute on the interface declaration: interface: wsWeatherXML.IWeatherServiceTest, method: wsWeatherXML.ResponseList ReturnWeatherImageData(wsWeatherXML.RequestList), attribute: System.Xml.Serialization.XmlElementAttribute.


E.R. Joell
0
joeller
1/14/2009 5:17:43 PM

Please carefully compare this exception to the previous exception. It's complaining about the XmlElementAttribute this time. Do the same thing. Keep that attribute on the interface, not on the implementation. Do the same for all attributes that are on the interface.

In fact, it looks like the issue isn't so much the interface, as the methods in the interface. This exception is talking specifically about the ReturnWeatherImageData method. It looks like you have XmlElementAttribute both on the definition in the interface, and on the actual method implementing that method from the interface. Do not duplicate attributes from the interface on the implementation.


John Saunders | MVP – Connected System Developer
0
johnwsaunders3
1/14/2009 5:30:47 PM

The exception is letter for letter the exact same exception received above with the difference that the one above starts with "System."  Now to which "XmlElementAttribute" are refering?  The one on the parameter being passed into the function or the one on the function return type?  I removed the one from the parameter and got the following exception.

[InvalidOperationException: Method ReturnWeatherImageData on type wsWeatherXML.WeatherService is an implementation of the service contract interface wsWeatherXML.IWeatherServiceTest. Service Description altering attributes cannot be specified on service implementation.  Please place custom attribute on the interface declaration: interface: wsWeatherXML.IWeatherServiceTest, method: wsWeatherXML.ResponseList ReturnWeatherImageData(wsWeatherXML.RequestList), attribute: System.Web.Services.Protocols.SoapDocumentMethodAttribute.] 

When I pulled off the Attribute from the return type of the function as well same exact error.  When this didn't work I pulled SoapDocumentMethodAttribute off of the Web method.  This worked

Now Yasser Shohoud specifically stated in his article to add a SoapDocumentMethodAttribute to the Web method in the Web service.   

"To make GetWeather a true implementation of the GetWeather operation defined earlier in WeatherInterface.wsdl, you'll also need to add an XmlElement to the return value and add a SoapDocumentMethod attribute, setting its ParameterStyle property to SoapParameterStyle.Bare"

Well its working now.  (Like pulling teeth. whew!)  I think I prefer to make the web service generate the wsdl rather than vice versa.

 


E.R. Joell
0
joeller
1/15/2009 8:06:20 PM
Reply:

Similar Artilces:

Please compare "web service" and "remote services"
Somebody, please tell me the different beetween "web services" and "remote services". So, "web services" and "remote services" which one is better? Please tell me This might provide some insight. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/dotnetremotearch.asp The really question at hand is what kind of project? Frank ...

adding web reference, remote web service. "unable to download service.asmx?wsdl"
Hello having a problem with this web service. VS [2005]  The message we get when we try and add the web reference is "unable download following files http://10.0.1.7/codered/service.asmx?wsdl". Which is using the internal ip address of the web server. We have check the IIS where the web service has been published to. But could not see why it is using the internal ip and not the external ip address. The actual url is http://83.100.199.125/codered/service.asmx Here is the service description sample, maybe someone can check this, as this has the internal ip address at the bottom. ...

"no service in WSDL file " in Web Service Proxy Wizard
I'm trying to follow the "EAServer Web Service Using PowerBuilder Component and Client" tutorial but when I get to the Select Service window(after just having entered the WSDL file name in the previous window) I get "There is no service in the WSDL file." and the Services list is empty. I found an earlier post where this problem seemed to be resolved by combining the 2 WSDL files(pb_hello.wsdl and pb_helloImpl.wsdl) into one file, but this has not worked for me. Has anyone else had this problem? ...

Web service in .NET from Java Web Service
Hi there,I'm pretty new to .net (although i have years of experience with the old vb 6, access 2k, as well as java)... and need some with perhaps either some syntax or something.Here is the wsdl.<wsdl:definitions targetNamespace="http://www.dynix.com/schema/book">−<wsdl:types>−<schema targetNamespace="GetBookInfoByISBN">−<complexType name="BookInfoType">−<sequence><element maxOccurs="1" minOccurs="0" name="Title" nillable="true" type="xsd:string"/><element maxOccurs=&quo...

xml web service --uploading the file to the xml web service
how can we upload the file in the xml web service 1.i mean what will be the return value in the proxy class 2.and how am i going to send the file to the xml web service----regards Bipul Kumar Here are some links to articles that helped us get this done: http://msdn.microsoft.com/webservices http://www.microsoft.com/downloads/details.aspx?familyid=06255a94-2635-4d29-a90c-28b282993a41&displaylang=en https://www.sys-con.com/dotnet/article.cfm?id=458 Hope this helps....

How to call a .net web service from another .net web service?
Hi all,I have developed two asp .net web services using visual studio .net 2003.I wish to call one web service from another web service.I tried adding a web reference of the web service in another web service and was able to do so.but i m not able to access the web methods provided by the web servicecould you please suggest a way to go about itExpecting quick replyThanxCharmy try to make sure that you reference it in the web reference and call it properly this is sample  [WebMethod()] public double CalcDistance(int x1, int y1, int x2, int y2) { Calculator.Service1 calc = new...

simple web service query
Hi all, Im following the 'Using the WebService Behaviour' document from the msdn Library and am getting the message 'service unavailable' when running my page. Is there something I'm missing? thanks, Pete mWeb Design Nottingham, UK...

"Visual Web Developer Web Server" and Web Services
I like the new "Visual Web Developer Web Server" (Do you want suggestions for a longer name!) but I have an issue with using it to host a Web Service. Whenever the Web Service is recompiled and run it ends up with a different port number. Therefore, it seems that any references to that WS in other applications are invalidated and need to be re-established when it's run again. Is there a way of pinning the port number, or am I missing something? CheersNick Grattan, MSDN Regional Director, Ireland. Software Paths Limited. Hi Nick, the internal server is used for local...

When creatign a web service how do you specify the Web Service Name?
Well when I create a web service it always defaults to the name WebReference, which I think is the default if no Web Service Name is provided. But when I use other people's web services there is another name there, so there has to be a way to provide a name so no default WebReference will be used. How do you do that? Actually I think there is no way, because it takes it after the URL. So if you have a web service from a place like so http://www.webservices.com then the WebRefrence chosen by Visual Studio will be com.webservices.www I'm not sure what you are asking, but you can rena...

.NET web services Vs Java Web Services
Hello, does anyone know of a book or good source of information that compares .NET and Java Web Services? (I would like soemthing neutral if possible). I am thinking of approaching this subject for my dissertation? Many Thanks Rob Hi Rob, Last year I had to give a powepoint presentation on Web Services. I noticed some good books at barnes and noble that discussed the subject. These books were specific to Java and discussed Web Services in a very clear fashion. They gave some elementary examples that were easy to understand. I have not yet had the pleasure of creatin .NET Web Servi...

New to web services, why does PB10 web service proxy wizard say there are no services?
here... http://webservices.amazon.com/AWSECommerceService/205-10-05/AWSECommerceService.wsdl oops typo... still doesn't show any services though... http://webservices.amazon.com/AWSECommerceService/2005-10-05/AWSECommerceService.wsdl "Chance" <chance@booklog.com> wrote in message news:43b44cb3$1@forums-1-dub... > here... > > http://webservices.amazon.com/AWSECommerceService/205-10-05/AWSECommerceService.wsdl > Upgraded to 10.2x and now seems to be working...at least it created the proxy. "Chance" <chance@booklog.co...

Calling a Web Service from a Web Service
Hello,I was looking for some feedback on calling a web service from within a web service. I've heard that it's not good practice (or not possible). I have a scenario where I think it might make some sense.Within our infrastructure, we've created a web service that handles incoming updates on the statuses of all processes. This has proven to be a good thing since it allows applications to communicate across server to make status updates. It's also used by third party developers and applications to communicate with our infrastructure.Along these lines ... we are planning to create a new compon...

what are web services and what are the advantages of web services?
 Hello  i am new to this .net stuff and i was ask on the job interview what a web services is?and if i did not know given that i had a project ( as a project manager,  or a web developer)   what  is it? how do i start a >NET project on it? what are the main advantages is?  HOW DO I START THIS IN THE INTERVIEW>  and what basic books do i buy?   Hi There, There plenty of source on the net about webservice Definiton: http://en.wikipedia.org/wiki/Web_service http://www.codeproject.com/Purgatory/Defining_Web_Services.asp...

Is web services a part of web Service?
  I have a question: Is web services a part of web server?? And when the client calls web service, it means that client calls web server?? Or is it a different entity in itself which communicates separately both with client and server and acts as middleware application.. I am very confused.. Can someone explain me the architecture...??? Thanks..Dont forget to click "Mark as Answer" on the post that helped you.This credits the member,earns you a point & marks your thread as Resolved so that new users will know where to search for their queries. When you build and dep...

Web resources about - Web Service Strange Error "Service Description altering attributes cannot be specified on service implementation. " - asp.net.xml-web-services

Ministry of Statistics and Programme Implementation - Wikipedia, the free encyclopedia
The Ministry of Statistics and Programme Implementation came into existence as an Independent Ministry on 15.10.1999 after the merger of the ...

Facebook Re-Examining Its Privacy Changes; Delays Their Implementation
... of the changes to its data use policy and statement of rights and responsibilities , announced last week, Facebook said it will delay the implementation ...

Will Virgin America President/CEO David Cush lose his job over the Sabre implementation disaster?
com/vx/... According to their website, Virgin initial planned to complete the migration in a single weekend and thinned out their flight schedule ...

5.15.13 Patent Reform Implementation and New Challenges for Small Businesses - YouTube
On Wednesday, May 15, 2013, at 1:00 P.M., the Committee on Small Business held a hearing titled, "Patent Reform Implementation and New Challenges ...

Project Manager - Salesforce Implementation
Information Technology strategy insight for senior IT management - resources to understand and leverage information technology.

Project Manager - Salesforce Implementation
Computerworld Australia is the leading source of technology news, analysis and tools for IT decision makers, managers and professionals.

A fair VCE: its design and implementation
The VCAA manages the system in which VCE students' work is assessed and the key focus is ensuring the process and system is fair.

IOC demands Russia explain implementation of its anti-gay law
Olympic president Jacques Rogge has called on Russia to explain how it will implement its controversial anti-gay propaganda law and detail its ...

Iran seeks nuclear deal implementation, but enrichment issues block progress
Nearly seven weeks after signing a landmark nuclear deal, Iran and six world powers hope to reach an agreement this week on its implementation. ...

Budget Implementation Bill To Be Studied By 9 Committees
The Canadian government is backing down slightly on its mammoth budget implementation bill and has agreed to send it to 10 different committees ...

Resources last updated: 1/16/2016 10:51:13 AM