Click here to Skip to main content
16,016,022 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

XML
<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
XML
<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]
Posted
Updated 19-Jun-12 19:46pm
v3
Comments
Sergey Alexandrovich Kryukov 20-Jun-12 1:32am    
I'm afraid this information is not enough as you did not show your code. Try to create a complete but possibly minimal project sample to reproduce the problem and show it using "Improve question" above. There are different incompatibilities between Mono and .NET even in some standardized libraries, I know only a small fractions of them; a detailed investigation may be required. Can you debug all your code with Mono? Detect exact line of code throwing the exception?
--SA
P-SivaSankar 20-Jun-12 1:47am    
Hi Sergey, I've just updated the mono debug output and the reference cs file, but i'm afraid it doesn't give much info.
Member 9156416 28-Feb-13 9:40am    
Hello,
I'm struggling with same issue. Did you somehow solved your problem?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900