directxBOB
asked on
The header property/field TestServicePort.MYBaseTypes is missing or not public
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.MYBaseType s is missing or not public.]
System.Web.Services.Protoc ols.SoapRe flector.Re flectMetho d(LogicalM ethodInfo methodInfo, Boolean client, XmlReflectionImporter xmlImporter, SoapReflectionImporter soapImporter, String defaultNs) +4263
[InvalidOperationException : Method TestServicePort.MYBaseType s can not be reflected.]
System.Web.Services.Protoc ols.SoapRe flector.Re flectMetho d(LogicalM ethodInfo methodInfo, Boolean client, XmlReflectionImporter xmlImporter, SoapReflectionImporter soapImporter, String defaultNs) +6630
System.Web.Services.Descri ption.Soap ProtocolRe flector.Re flectMetho d() +134
System.Web.Services.Descri ption.Prot ocolReflec tor.Reflec tBinding(R eflectedBi nding reflectedBinding) +2512
System.Web.Services.Descri ption.Prot ocolReflec tor.Reflec t() +626
System.Web.Services.Descri ption.Serv iceDescrip tionReflec tor.Reflec tInternal( ProtocolRe flector[] reflectors) +560
System.Web.Services.Descri ption.Serv iceDescrip tionReflec tor.Reflec t(Type type, String url) +117
System.Web.Services.Protoc ols.Docume ntationSer verType..c tor(Type type, String uri) +159
System.Web.Services.Protoc ols.Docume ntationSer verProtoco l.Initiali ze() +335
System.Web.Services.Protoc ols.Server ProtocolFa ctory.Crea te(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing) +99
[InvalidOperationException : Unable to handle request.]
System.Web.Services.Protoc ols.Server ProtocolFa ctory.Crea te(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing) +258
System.Web.Services.Protoc ols.WebSer viceHandle rFactory.C oreGetHand ler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +93
[InvalidOperationException : Failed to handle request.]
System.Web.Services.Protoc ols.WebSer viceHandle rFactory.C oreGetHand ler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +240
System.Web.Services.Protoc ols.WebSer viceHandle rFactory.G etHandler( HttpContex t context, String verb, String url, String filePath) +106
System.Web.HttpApplication .MapHttpHa ndler(Http Context context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +328
System.Web.MapHandlerExecu tionStep.S ystem.Web. HttpApplic ation.IExe cutionStep .Execute() +139
System.Web.HttpApplication .ExecuteSt ep(IExecut ionStep 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.Protoc ols;
using System;
using System.Xml.Serialization;
using System.Web;
/// <remarks/>
[System.CodeDom.Compiler.G eneratedCo deAttribut e("System. Web.Servic es", "2.0.50727.42")]
[System.Web.Services.WebSe rviceAttri bute(Names pace="https://.... ")]
[System.Web.Services.WebSe rviceBindi ngAttribut e(Name="Te stService" , Namespace="https://....")]
[System.Xml.Serialization. XmlInclude Attribute( typeof(Bas eMessageTy pe))]
[System.ComponentModel.Typ eConverter Attribute( typeof(Sys tem.Compon entModel.E xpandableO bjectConve rter))]
public partial class TestServicePort : System.Web.Services.WebSer vice, ITestServicePort
{
public object myBaseTypes;
public TestServicePort()
{
}
public TestServicePort(object myBaseTypes)
{
this.myBaseTypes = myBaseTypes;
}
[System.Xml.Serialization. XmlElement Attribute( ElementNam e="MYBaseT ypes")]
public object MYBaseTypesObjects
{
get
{
return this.myBaseTypes;
}
set
{
if ((this.myBaseTypes != value))
{
this.myBaseTypes = value;
}
}
}
/// <remarks/>
[System.Web.Services.Proto cols.SoapH eaderAttri bute("MYBa seTypes")]
[System.Web.Services.WebMe thodAttrib ute(Messag eName="MYB aseTypes1" )]
[System.Web.Services.Proto cols.SoapD ocumentMet hodAttribu te("https://....", OneWay=true, Use=System.Web.Services.De scription. SoapBindin gUse.Liter al, ParameterStyle=System.Web. Services.P rotocols.S oapParamet erStyle.Ba re, Binding="TestService")]
public virtual void MYBaseTypes([System.Xml.Se rializatio n.XmlEleme ntAttribut e("MYBaseT ypes", Namespace="https://....")] object myBaseTypes2)
{
throw new System.NotImplementedExcep tion();
}
}
}
Now I made : myBaseTypes public which I thought it would actually fix the issue.
Anyone have any ideas relating to this...
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.MYBaseType
System.Web.Services.Protoc
[InvalidOperationException
System.Web.Services.Protoc
System.Web.Services.Descri
System.Web.Services.Descri
System.Web.Services.Descri
System.Web.Services.Descri
System.Web.Services.Descri
System.Web.Services.Protoc
System.Web.Services.Protoc
System.Web.Services.Protoc
[InvalidOperationException
System.Web.Services.Protoc
System.Web.Services.Protoc
[InvalidOperationException
System.Web.Services.Protoc
System.Web.Services.Protoc
System.Web.HttpApplication
System.Web.MapHandlerExecu
System.Web.HttpApplication
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.Protoc
using System;
using System.Xml.Serialization;
using System.Web;
/// <remarks/>
[System.CodeDom.Compiler.G
[System.Web.Services.WebSe
[System.Web.Services.WebSe
[System.Xml.Serialization.
[System.ComponentModel.Typ
public partial class TestServicePort : System.Web.Services.WebSer
{
public object myBaseTypes;
public TestServicePort()
{
}
public TestServicePort(object myBaseTypes)
{
this.myBaseTypes = myBaseTypes;
}
[System.Xml.Serialization.
public object MYBaseTypesObjects
{
get
{
return this.myBaseTypes;
}
set
{
if ((this.myBaseTypes != value))
{
this.myBaseTypes = value;
}
}
}
/// <remarks/>
[System.Web.Services.Proto
[System.Web.Services.WebMe
[System.Web.Services.Proto
public virtual void MYBaseTypes([System.Xml.Se
{
throw new System.NotImplementedExcep
}
}
}
Now I made : myBaseTypes public which I thought it would actually fix the issue.
Anyone have any ideas relating to this...
ASKER
Just spotted that alot of people are switching to an arrayList, will give it a shot.
An array list isnt strongly types either. My guess is that it wouldnt work. Please try anyways
ASKER
Any idea what I could use?
Did ArrayList not work??
ASKER
Nope, nor did string or int... So I'm just wondering if there was anything else. Perhaps Dataset or something else.
string and int SHOULD work. What error are you getting when you use int or string?
ASKER
[Exception: The header property/field TestServicePort.MYBaseType s is missing or not public.]
System.Web.Services.Protoc ols.SoapRe flector.Re flectMetho d(LogicalM ethodInfo methodInfo, Boolean client, XmlReflectionImporter xmlImporter, SoapReflectionImporter soapImporter, String defaultNs) +4263
[InvalidOperationException : Method TestServicePort.MYBaseType s can not be reflected.]
System.Web.Services.Protoc ols.SoapRe flector.Re flectMetho d(LogicalM ethodInfo methodInfo, Boolean client, XmlReflectionImporter xmlImporter, SoapReflectionImporter soapImporter, String defaultNs) +6630
System.Web.Services.Descri ption.Soap ProtocolRe flector.Re flectMetho d() +134
System.Web.Services.Descri ption.Prot ocolReflec tor.Reflec tBinding(R eflectedBi nding reflectedBinding) +2512
System.Web.Services.Descri ption.Prot ocolReflec tor.Reflec t() +626
System.Web.Services.Descri ption.Serv iceDescrip tionReflec tor.Reflec tInternal( ProtocolRe flector[] reflectors) +560
System.Web.Services.Descri ption.Serv iceDescrip tionReflec tor.Reflec t(Type type, String url) +117
System.Web.Services.Protoc ols.Docume ntationSer verType..c tor(Type type, String uri) +159
System.Web.Services.Protoc ols.Docume ntationSer verProtoco l.Initiali ze() +335
System.Web.Services.Protoc ols.Server ProtocolFa ctory.Crea te(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing) +99
[InvalidOperationException : Unable to handle request.]
System.Web.Services.Protoc ols.Server ProtocolFa ctory.Crea te(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing) +258
System.Web.Services.Protoc ols.WebSer viceHandle rFactory.C oreGetHand ler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +93
[InvalidOperationException : Failed to handle request.]
System.Web.Services.Protoc ols.WebSer viceHandle rFactory.C oreGetHand ler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +240
System.Web.Services.Protoc ols.WebSer viceHandle rFactory.G etHandler( HttpContex t context, String verb, String url, String filePath) +106
System.Web.HttpApplication .MapHttpHa ndler(Http Context context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +328
System.Web.MapHandlerExecu tionStep.S ystem.Web. HttpApplic ation.IExe cutionStep .Execute() +139
System.Web.HttpApplication .ExecuteSt ep(IExecut ionStep step, Boolean& completedSynchronously) +146
System.Web.Services.Protoc
[InvalidOperationException
System.Web.Services.Protoc
System.Web.Services.Descri
System.Web.Services.Descri
System.Web.Services.Descri
System.Web.Services.Descri
System.Web.Services.Descri
System.Web.Services.Protoc
System.Web.Services.Protoc
System.Web.Services.Protoc
[InvalidOperationException
System.Web.Services.Protoc
System.Web.Services.Protoc
[InvalidOperationException
System.Web.Services.Protoc
System.Web.Services.Protoc
System.Web.HttpApplication
System.Web.MapHandlerExecu
System.Web.HttpApplication
Can you paste the code you are using?
ASKER
#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.Protoc ols;
using System;
using System.Xml.Serialization;
using System.Web;
/// <remarks/>
[System.CodeDom.Compiler.G eneratedCo deAttribut e("System. Web.Servic es", "2.0.50727.42")]
[System.Web.Services.WebSe rviceAttri bute(Names pace="https://.... ")]
[System.Web.Services.WebSe rviceBindi ngAttribut e(Name="Te stService" , Namespace="https://....")]
[System.Xml.Serialization. XmlInclude Attribute( typeof(Bas eMessageTy pe))]
[System.ComponentModel.Typ eConverter Attribute( typeof(Sys tem.Compon entModel.E xpandableO bjectConve rter))]
public partial class TestServicePort : System.Web.Services.WebSer vice, ITestServicePort
{
public string myBaseTypes = "";
public TestServicePort()
{
}
public TestServicePort(string myBaseTypes)
{
this.myBaseTypes = myBaseTypes;
}
[System.Xml.Serialization. XmlElement Attribute( ElementNam e="MYBaseT ypes")]
public string MYBaseTypesObjects
{
get
{
return this.myBaseTypes;
}
set
{
if ((this.myBaseTypes != value.ToString()))
{
this.myBaseTypes = value.ToString();
}
}
}
/// <remarks/>
[System.Web.Services.Proto cols.SoapH eaderAttri bute("MYBa seTypes")]
[System.Web.Services.WebMe thodAttrib ute(Messag eName="MYB aseTypes1" )]
[System.Web.Services.Proto cols.SoapD ocumentMet hodAttribu te("https://....", OneWay=true, Use=System.Web.Services.De scription. SoapBindin gUse.Liter al, ParameterStyle=System.Web. Services.P rotocols.S oapParamet erStyle.Ba re, Binding="TestService")]
public virtual void MYBaseTypes([System.Xml.Se rializatio n.XmlEleme ntAttribut e("MYBaseT ypes", Namespace="https://....")] object myBaseTypes2)
{
throw new System.NotImplementedExcep tion();
}
}
}
//------------------------
// <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.Protoc
using System;
using System.Xml.Serialization;
using System.Web;
/// <remarks/>
[System.CodeDom.Compiler.G
[System.Web.Services.WebSe
[System.Web.Services.WebSe
[System.Xml.Serialization.
[System.ComponentModel.Typ
public partial class TestServicePort : System.Web.Services.WebSer
{
public string myBaseTypes = "";
public TestServicePort()
{
}
public TestServicePort(string myBaseTypes)
{
this.myBaseTypes = myBaseTypes;
}
[System.Xml.Serialization.
public string MYBaseTypesObjects
{
get
{
return this.myBaseTypes;
}
set
{
if ((this.myBaseTypes != value.ToString()))
{
this.myBaseTypes = value.ToString();
}
}
}
/// <remarks/>
[System.Web.Services.Proto
[System.Web.Services.WebMe
[System.Web.Services.Proto
public virtual void MYBaseTypes([System.Xml.Se
{
throw new System.NotImplementedExcep
}
}
}
public virtual void MYBaseTypes([System.Xml.Se rializatio n.XmlEleme ntAttribut e("MYBaseT ypes", Namespace="https://....")] object myBaseTypes2)
object myBaseTypes2 ????
object myBaseTypes2 ????
ASKER
sorry that was a typo it's actually a string as well as in the interface class.
Please make sure you dont use any datatype of type object any where in your web service.
ASKER
Well it's directly related to this one line:
[System.Web.Services.Proto cols.SoapH eaderAttri bute("M50B aseTypes") ]
Perhaps this is the one that does not like the type... I'll keep digging
[System.Web.Services.Proto
Perhaps this is the one that does not like the type... I'll keep digging
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
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
ASKER
Sorry never touched SOAP before and all this code is generated, what do you mean by Decorator?
System.Web.Services.Protoc ols.SoapHe aderAttrib ute("MYBas eTypes")]
[System.Web.Services.WebMe thodAttrib ute(Messag eName="MYB aseTypes1" )]
[System.Web.Services.Proto cols.SoapD ocumentMet hodAttribu te("https://....", OneWay=true, Use=System.Web.Services.De scription. SoapBindin gUse.Liter al, ParameterStyle=System.Web. Services.P rotocols.S oapParamet erStyle.Ba re, Binding="TestService")]
These are the decorators
>> All this code is generated
Generated by?
[System.Web.Services.WebMe
[System.Web.Services.Proto
These are the decorators
>> All this code is generated
Generated by?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The wizard is :
This source code was auto-generated by WsContractFirst, Version=0.7.6319.1
I'll try and start again so.
This source code was auto-generated by WsContractFirst, Version=0.7.6319.1
I'll try and start again so.
Please use a specific type instead of using a generic object