I have a .Net application which makes a webservice call to a service running on JBoss7.1. The SOAP request for one of the methods 'login' from Linux(using Mono 2.10.2) and Windows(below) are different. Though they look equivalent(I think), executing from Linux causes a server fault with exception
'Unmarshalling Error: unexpected element (uri:"http://ws.array.mod.abc.com/", local:"username"). Expected elements are <{}username>,<{}password>'
Linux(Mono 2.10.2)
==================
POST /array_ws/ArrayService?WSDL HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Content-Length: 335
Expect: 100-continue
Connection: keep-alive
Host: 10.10.5.61:8080
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<login xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://ws.array.mod.abc.com/">
<username>admin</username>
<password>admin</password>
</login>
</s:Body>
</s:Envelope>
Windows
=======
POST /array_ws/ArrayService?WSDL HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Host: 10.10.5.61:8080
Content-Length: 312
Expect: 100-continue
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<login xmlns="http://ws.array.mod.abc.com/">
<username xmlns="">admin</username>
<password xmlns="">admin</password>
</login>
</s:Body>
</s:Envelope>
When i add xmlns="" to username and password fields and make a direct SOAP call to the server from Linux, it works fine. Is there any mono library i must change / JBoss web service configuration i must do to get it working?
==========================================================================================
-----------------
Mono debug output
-----------------
Unmarshalling Error: unexpected element (uri:"http://ws.array.mod.abc.com/", local:"username"). Expected elements are <{}username>,<{}password>
at abc.prod.module.State.BaseResourceState.ExecuteState (abc.prod.module.RequestModel.CaalRequest calRequest) [0x00000] in <filename unknown="">:0
at abc.prod.module.Program.Main (System.String[] args) [0x00000] in <filename unknown="">:0
-----------------
VS reference cs
-----------------
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
[System.ServiceModel.MessageContractAttribute(WrapperName="login", WrapperNamespace="http://ws.array.mod.abc.com/", IsWrapped=true)]
public partial class login {
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://ws.array.mod.abc.com/", Order=0)]
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string username;
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://ws.array.mod.abc.com/", Order=1)]
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string password;
public login() {
}
public login(string username, string password) {
this.username = username;
this.password = password;
}
}
[edit]Code blocks sorted - OriginalGriff[/edit]