[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

The header property/field TestServicePort.MYBaseTypes is missing or not public

Posted on 2007-10-04
19
Medium Priority
?
2,815 Views
Last Modified: 2013-11-18
I am getting the following error:



The header property/field TestServicePort .MYBaseTypes is missing or not public.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[Exception: The header property/field TestServicePort.MYBaseTypes is missing or not public.]
   System.Web.Services.Protocols.SoapReflector.ReflectMethod(LogicalMethodInfo methodInfo, Boolean client, XmlReflectionImporter xmlImporter, SoapReflectionImporter soapImporter, String defaultNs) +4263

[InvalidOperationException: Method TestServicePort.MYBaseTypes can not be reflected.]
   System.Web.Services.Protocols.SoapReflector.ReflectMethod(LogicalMethodInfo methodInfo, Boolean client, XmlReflectionImporter xmlImporter, SoapReflectionImporter soapImporter, String defaultNs) +6630
   System.Web.Services.Description.SoapProtocolReflector.ReflectMethod() +134
   System.Web.Services.Description.ProtocolReflector.ReflectBinding(ReflectedBinding reflectedBinding) +2512
   System.Web.Services.Description.ProtocolReflector.Reflect() +626
   System.Web.Services.Description.ServiceDescriptionReflector.ReflectInternal(ProtocolReflector[] reflectors) +560
   System.Web.Services.Description.ServiceDescriptionReflector.Reflect(Type type, String url) +117
   System.Web.Services.Protocols.DocumentationServerType..ctor(Type type, String uri) +159
   System.Web.Services.Protocols.DocumentationServerProtocol.Initialize() +335
   System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing) +99

[InvalidOperationException: Unable to handle request.]
   System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing) +258
   System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +93

[InvalidOperationException: Failed to handle request.]
   System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +240
   System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) +106
   System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +328
   System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +139
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +146







And the code:

#region WSCF
//------------------------------------------------------------------------------
// <autogenerated code>
//     This code was generated by a tool.
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </autogenerated code>
//------------------------------------------------------------------------------
// File time 04-10-07 01:19
//
// This source code was auto-generated by WsContractFirst, Version=0.7.6319.1
#endregion


namespace TestService
{
    using System.Diagnostics;
    using System.Web.Services;
    using System.ComponentModel;
    using System.Web.Services.Protocols;
    using System;
    using System.Xml.Serialization;
    using System.Web;
   
   
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")]
    [System.Web.Services.WebServiceAttribute(Namespace="https://....")]
    [System.Web.Services.WebServiceBindingAttribute(Name="TestService", Namespace="https://....")]
    [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseMessageType))]
    [System.ComponentModel.TypeConverterAttribute(typeof(System.ComponentModel.ExpandableObjectConverter))]
    public partial class TestServicePort : System.Web.Services.WebService, ITestServicePort
    {
       
        public object myBaseTypes;
       
        public TestServicePort()
        {
        }
       
        public TestServicePort(object myBaseTypes)
        {
            this.myBaseTypes = myBaseTypes;
        }
       
        [System.Xml.Serialization.XmlElementAttribute(ElementName="MYBaseTypes")]
        public object MYBaseTypesObjects
        {
            get
            {
                return this.myBaseTypes;
            }
            set
            {
                if ((this.myBaseTypes != value))
                {
                    this.myBaseTypes = value;
                }
            }
        }
       
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("MYBaseTypes")]
        [System.Web.Services.WebMethodAttribute(MessageName="MYBaseTypes1")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("https://....", OneWay=true, Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare, Binding="TestService")]
        public virtual void MYBaseTypes([System.Xml.Serialization.XmlElementAttribute("MYBaseTypes", Namespace="https://....")] object myBaseTypes2)
        {
            throw new System.NotImplementedException();
        }
    }
}



Now I made : myBaseTypes public which I thought it would actually fix the issue.

Anyone have any ideas relating to this...
0
Comment
Question by:directxBOB
  • 10
  • 9
19 Comments
 
LVL 21

Expert Comment

by:surajguptha
ID: 20014404
Web services require that all the properties are strongly typed. If the property is declared as an object there is no way it would know to to serialize the object or deserialize it.

Please use a specific type instead of using a generic object
0
 

Author Comment

by:directxBOB
ID: 20014513
Just spotted that alot of people are switching to an arrayList, will give it a shot.
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20014532
An array list isnt strongly types either. My guess is that it wouldnt work. Please try anyways
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:directxBOB
ID: 20014636
Any idea what I could use?
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20014647
Did ArrayList not work??
0
 

Author Comment

by:directxBOB
ID: 20014700
Nope, nor did string or int... So I'm just wondering if there was anything else. Perhaps Dataset or something else.
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20014711
string and int SHOULD work. What error are you getting when you use int or string?
0
 

Author Comment

by:directxBOB
ID: 20014767
[Exception: The header property/field TestServicePort.MYBaseTypes is missing or not public.]
   System.Web.Services.Protocols.SoapReflector.ReflectMethod(LogicalMethodInfo methodInfo, Boolean client, XmlReflectionImporter xmlImporter, SoapReflectionImporter soapImporter, String defaultNs) +4263

[InvalidOperationException: Method TestServicePort.MYBaseTypes can not be reflected.]
   System.Web.Services.Protocols.SoapReflector.ReflectMethod(LogicalMethodInfo methodInfo, Boolean client, XmlReflectionImporter xmlImporter, SoapReflectionImporter soapImporter, String defaultNs) +6630
   System.Web.Services.Description.SoapProtocolReflector.ReflectMethod() +134
   System.Web.Services.Description.ProtocolReflector.ReflectBinding(ReflectedBinding reflectedBinding) +2512
   System.Web.Services.Description.ProtocolReflector.Reflect() +626
   System.Web.Services.Description.ServiceDescriptionReflector.ReflectInternal(ProtocolReflector[] reflectors) +560
   System.Web.Services.Description.ServiceDescriptionReflector.Reflect(Type type, String url) +117
   System.Web.Services.Protocols.DocumentationServerType..ctor(Type type, String uri) +159
   System.Web.Services.Protocols.DocumentationServerProtocol.Initialize() +335
   System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing) +99

[InvalidOperationException: Unable to handle request.]
   System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing) +258
   System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +93

[InvalidOperationException: Failed to handle request.]
   System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +240
   System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) +106
   System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +328
   System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +139
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +146

0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20014775
Can you paste the code you are using?
0
 

Author Comment

by:directxBOB
ID: 20014831
#region WSCF
//------------------------------------------------------------------------------
// <autogenerated code>
//     This code was generated by a tool.
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </autogenerated code>
//------------------------------------------------------------------------------
// File time 04-10-07 01:19
//
// This source code was auto-generated by WsContractFirst, Version=0.7.6319.1
#endregion


namespace TestService
{
    using System.Diagnostics;
    using System.Web.Services;
    using System.ComponentModel;
    using System.Web.Services.Protocols;
    using System;
    using System.Xml.Serialization;
    using System.Web;
   
   
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")]
    [System.Web.Services.WebServiceAttribute(Namespace="https://....")]
    [System.Web.Services.WebServiceBindingAttribute(Name="TestService", Namespace="https://....")]
    [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseMessageType))]
    [System.ComponentModel.TypeConverterAttribute(typeof(System.ComponentModel.ExpandableObjectConverter))]
    public partial class TestServicePort : System.Web.Services.WebService, ITestServicePort
    {
       
        public string myBaseTypes = "";
       
        public TestServicePort()
        {
        }
       
        public TestServicePort(string myBaseTypes)
        {
            this.myBaseTypes = myBaseTypes;
        }
       
        [System.Xml.Serialization.XmlElementAttribute(ElementName="MYBaseTypes")]
        public string MYBaseTypesObjects
        {
            get
            {
                return this.myBaseTypes;
            }
            set
            {
                if ((this.myBaseTypes != value.ToString()))
                {
                    this.myBaseTypes = value.ToString();
                }
            }
        }
       
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("MYBaseTypes")]
        [System.Web.Services.WebMethodAttribute(MessageName="MYBaseTypes1")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("https://....", OneWay=true, Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare, Binding="TestService")]
        public virtual void MYBaseTypes([System.Xml.Serialization.XmlElementAttribute("MYBaseTypes", Namespace="https://....")] object myBaseTypes2)
        {
            throw new System.NotImplementedException();
        }
    }
}
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20014852
public virtual void MYBaseTypes([System.Xml.Serialization.XmlElementAttribute("MYBaseTypes", Namespace="https://....")] object myBaseTypes2)

 object myBaseTypes2 ????
0
 

Author Comment

by:directxBOB
ID: 20014897
sorry that was a typo it's actually a string as well as in the interface class.
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20014908
Please make sure you dont use any datatype of type object any where in your web service.
0
 

Author Comment

by:directxBOB
ID: 20015070
Well it's directly related to this one line:

[System.Web.Services.Protocols.SoapHeaderAttribute("M50BaseTypes")]

Perhaps this is the one that does not like the type... I'll keep digging
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20015096
What are you trying to implement in the soap header??

try removing all the decorators to the webmethod and see if the web service works in the first place. If it does we can then try to add each decorator and see what causes the problem
0
 

Author Comment

by:directxBOB
ID: 20015211
Sorry never touched SOAP before and all this code is generated, what do you mean by Decorator?
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20015229
System.Web.Services.Protocols.SoapHeaderAttribute("MYBaseTypes")]
        [System.Web.Services.WebMethodAttribute(MessageName="MYBaseTypes1")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("https://....", OneWay=true, Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare, Binding="TestService")]

These are the decorators

>> All this code is generated
Generated by?
0
 
LVL 21

Accepted Solution

by:
surajguptha earned 2000 total points
ID: 20015233
Start afresh, Use the same wizard to generate a web service and make sure you use string/ int only
0
 

Author Comment

by:directxBOB
ID: 20020240
The wizard is :

This source code was auto-generated by WsContractFirst, Version=0.7.6319.1

I'll try and start again so.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question