Up vote 0 down vote favorite share g+ share fb share tw.
I'm trying to communicate to a Java web service using SOAP, and I'm having problems parsing the response (response = null). I've looked though many questions/answers on this site regarding SOAP responses = null, and most of them seem to be related to the response namespace not matching what is configured in code. The problem I'm facing is that the response I'm getting from the server does not contain a namespace at all.
Here's the request: administrator administrator And here's the response: OK Note that there isn't a namespace entry in the response (i.e. Xmlns="urn:SOAPService" or even xmlns=""). I have no control over the server and I don't have a WSDL to parse, so I'm configuring the proxy class by hand: System.Diagnostics.
DebuggerStepThroughAttribute() System.ComponentModel. DesignerCategoryAttribute("code") System.Web.Services. WebServiceBindingAttribute(Name = "AdminService", Namespace = "urn:SOAPService") public partial class AdminService : System.Web.Services.Protocols.
SoapHttpClientProtocol { public AdminService() { } System.Web.Services.Protocols. SoapDocumentMethodAttribute("", Use = System.Web.Services.Description.SoapBindingUse. Literal, ParameterStyle = System.Web.Services.Protocols.
SoapParameterStyle. Bare) public AuthenticatePasswordResponse AuthenticatePassword(AuthenticatePassword AuthenticatePassword) { object results = this. Invoke("AuthenticatePassword", new object { AuthenticatePassword}); return ((AuthenticatePasswordResponse)(results0)); } } I've tried setting the SoapDocumentMethodAttribute ResponseNamespace = "", but that throws an Exception.
I also tried ResponseNamespace = null, but that doesn't help. Any thoughts or suggestions? UPDATE: I tried to use WCF, and I am getting a SerializationException when processing the response: OperationFormatter encountered an invalid Message body.
Expected to find node type 'Element' with name 'AuthenticatePasswordResponse' and namespace 'urn:SOAPService'. Found node type 'Element' with name 'AuthenticatePasswordResponse' and namespace '' Here is how I have defined AuthenticatePasswordReponse (I have tried DataContract(NameSpace = "") as well): DataContract public class AuthenticatePasswordResponse { private string statusField; private string sessionField; DataMember public string Status { get { return this. StatusField; } set { this.
StatusField = value; } } DataMember public string session { get { return this. SessionField; } set { this. SessionField = value; } } } c# soap null response link|improve this question edited 2 days ago asked Apr 6 at 13:40Matt11.
One suggestion: you're using the legacy ASMX technology for your client. It should not be used for new development. WCF should be used instead.
– John Saunders Apr 6 at 14:13 So I tried WCF and now I get a SerializationException: OperationFormatter encountered an invalid Message body. Expected to find node type 'Element' with name 'AuthenticatePasswordResponse' and namespace 'urn:SOAPService'. Found node type 'Element' with name 'AuthenticatePasswordResponse' and namespace '' – Matt 2 days ago Please show us how you defined AuthenticatePasswordResponse.
It looks like you have the urn:SOAPService namespace set on that class. – John Saunders 2 days ago DataContract public class AuthenticatePasswordResponse { private string statusField; private string sessionField; DataMember public string Status { get { return this. StatusField; } set { this.
StatusField = value; } } DataMember public string session { get { return this. SessionField; } set { this. SessionField = value; } } } – Matt 2 days ago Put that in your question, please.
– John Saunders 2 days ago.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.