Franck6

I have au Web service in C# with a personalized SoapHeader like

private AuthenticationHeader _authentication;

public AuthenticationHeader Authentication

{

get { return _authentication; }

set { _authentication = value; }

}

[WebMethod]

[LNWebServiceExtension(Version = "1.0")]

[SoapHeader("LNExtensionHeader", Direction = SoapHeaderDirection.In)]

[SoapHeader("Authentication", Direction = SoapHeaderDirection.In)]

public CleDeVouteServiceResult AuthentifierUtil_1_00 ()

My class :

public class AuthenticationHeader : SoapHeader

{

private string _alias;

private string _password;

private string _profil_sec;

public AuthenticationHeader ()

{

}

public string Alias

{

get { return _alias; }

set { _alias = value; }

}

public string Password

{

get { return _password; }

set { _password = value; }

}

public string ProfilSecurite

{

get { return _profil_sec; }

set { _profil_sec = value; }

}

}

When I add the web reference to my C++ project with VS 2005. The header generated is empty :

struct AuthenticationHeader

{

};

Why

With VS 2003 the code generated is ok!



Re: Visual C++ General Probleme with code generated with a Web reference

Franck6

The code generated with VS 2003, may it have a bug in VS 2005

Code Snippet
struct AuthenticationHeader
{
BSTR Alias;
BSTR Password;
BSTR ProfilSecurite;
};






Re: Visual C++ General Probleme with code generated with a Web reference

Ramkrishna Pawar

I would recommand posting this question in C# forum.




Re: Visual C++ General Probleme with code generated with a Web reference

Franck6

Ok my web service is in C# but, the problem is not with the C# module it work great...

My C++ project is the problem when I add the web reference the code generated by C++ module is not ok.





Re: Visual C++ General Probleme with code generated with a Web reference

Bite Qiu - MSFT

Franck6 wrote:

Ok my web service is in C# but, the problem is not with the C# module it work great...

My C++ project is the problem when I add the web reference the code generated by C++ module is not ok.

Which kind of c++ project did you created I tried your code, consume it in c++ with a CLR Console Project, it works fine, below is part of generated code:

Code Snippet

public ref class AuthenticationHeader : public System::Web::Services::Protocols::SoapHeader {

private: System::String^ aliasField;

private: System::String^ passwordField;

private: System::String^ profilSecuriteField;

private: cli::array< System::Xml::XmlAttribute^ >^ anyAttrField;

/// <remarks/>

public: property System::String^ Alias {

System::String^ get();

System::Void set(System::String^ value);

}

/// <remarks/>

public: property System::String^ Password {

System::String^ get();

System::Void set(System::String^ value);

}

/// <remarks/>

public: property System::String^ ProfilSecurite {

System::String^ get();

System::Void set(System::String^ value);

}

/// <remarks/>

public: [System::Xml::Serialization::XmlAnyAttributeAttribute]

property cli::array< System::Xml::XmlAttribute^ >^ AnyAttr {

cli::array< System::Xml::XmlAttribute^ >^ get();

System::Void set(cli::array< System::Xml::XmlAttribute^ >^ value);

}

};

Here is a walkthough of Accessing an XML Web Service Using C++ and the CLR for your reference.

If this doesn't help please follow up with more information on the detail steps that makes it fail. As Ramkrishna Pawar has indicated, post in c# forum maybe also a good idea.

thanks

rico






Re: Visual C++ General Probleme with code generated with a Web reference

Franck6

I don't use WSE and no CODE MANAGE. I did my Proxy client with thoses solutions but is very complicated to deploy on my customers (very many stations). We removed the code manage to avoid the deploy of FrameWork because the *.manifest cause much problem with autorisations and permissions on the client computers. For the WSE client is the problem to deploy it over all workstation. We looking at this moment for anoter solution for the SOAP management WSE not responding to yours needs. We looking on solutions like GSOAP that not need any deploy on the clients computers.

My project is a C++ DLL all is common Win32 project. No manifest and no code manage.