I keep getting problems with Proxy Authentication and ContentType when trying to access a webservice (using WSSE) from vb.Net client.
??What is the right way to create my own soap- and proxy-settings (Framework 2.0)??
The current structure I implemented looks like this:
1) VB.Net (WinApp) references a CSharp-Dll (Framework 2.0)
a)Within that WinClient, an object (business-document)) >> its type is being provided by the referenced webservice (published by that csharp-dll) is being created and populated.
b) The winClient calls a public method RunWebService in that CSharpDll and provides the doc as param.
2) That CSharp DLL (Framework 2.0) uses a webreference to access that service.
a) Within that resulting ProxyClass (reference.cs) I added an additional SoapDocumentAttribut to the specific method which I would like to call. That attribute refers to my personal TraceExtension class (derived from soapExtension).
b) When method RunWebService is being called, the webserviceObjVar gets configured, e.g.:
NetworkCredential netCredential = new
NetworkCredential(strLogin, strPassword);
Uri uri = new Uri(myWebServObjVar.Url);
ICredentials credentials =
netCredential.GetCredential(uri, "Basic");
myWebServObjVar.Url = URL;
myWebServObjVar.Credentials = credentials;
myWebServObjVar.SoapVersion =
SoapProtocolVersion.Soap11;
myWebServObjVar.MethodToCall(myBusinessObject);
Because of that method-call my TraceExtension-class gets used.
Mainly the override method "ProcessMessage" creates the soap envelope and header elements (stage AfterSerialze)
On top of that, the soap-message gets serialized for better control.
THE PROBLEM:
I keep getting exceptions like "Client found response content type of 'text/html' but expected 'text/xml'
>> although I tried setting message.contentType accordingly)in BeforeSerialize stage.
WHAT AM I MISSING?
?? Would I need my own derived classes (explicitly of SoapHeader and SoapMessage)?If so, how would I implement them and what kind of attributes wouöd have to be added?
?? Would I have to distinguish between Response and Request?
If so, how would that have to happen???
I would really need some help here... some piece of working code, or...
Thanks a lot for any assistance!!