By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,011 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

Problems using SOAP/WSE from VB .Net ! To be exactly I keep getting problems with P

P: 1
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 woud 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!!
Mar 14 '14 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.