.NET Client / Java Web Service Problem

  • Thread starter Jasmeet Sangari via .NET 247
  • Start date
J

Jasmeet Sangari via .NET 247

Hi,
I am writting a .NET Client for a Java Web Service.I have createda .cs file from the WSDL and the XSD's Given.
I am trying to query a Web Service which has the description:::

// Service Description:::::::

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("urn:#solicitar",Use=System.Web.Services.Description.SoapBindingUse.Literal,ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]

[return: System.Xml.Serialization.XmlElementAttribute("Response",Namespace="http://example")]
public stringsolicitar([System.Xml.Serialization.XmlElementAttribute(Namespace="http://example")] idMesage Mesage) {
object[] results = this.Invoke("Function", new object[]{Mesage});
return ((string)(results[0]));


But when I query the Web Service from my Client I get an ErrorLike:::


Error in the Client:::::

"System.InvalidOperationException: There is an error in XMLdocument (8, 5). ---> System.Xml.XmlException: 'Element' is aninvalid node type. Line 8, position 5.\r\n atSystem.Xml.XmlReader.ReadElementString()\r\n atMicrosoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read117_Response()\r\n --- End of inner exception stacktrace ---\r\n atSystem.Xml.Serialization.XmlSerializer.Deserialize(XmlReaderxmlReader, String encodingStyle, XmlDeserializationEventsevents)\r\n atSystem.Xml.Serialization.XmlSerializer.Deserialize(XmlReaderxmlReader, XmlDeserializationEvents events)\r\n atSystem.Xml.Serialization.XmlSerializer.Deserialize(XmlReaderxmlReader)\r\n atSystem.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, StreamresponseStream, Boolean asyncCall)\r\n atSystem.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

System.InvalidOperationException: There is an error in XMLdocument (8, 5) ---> System.Xml.XmlException: 'Element' is aninvalid node type. Line 8, position 5.\r\n atSystem.Xml.XmlReader.ReadElementString()\r\n atMicrosoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read117_Response()


Please help,

Regards,

Jasmeet
 
D

Dino Chiesa [Microsoft]

you need to examine the XML (response) that is being returned by the
service.
Try something like proxytrace, or the TCPMonitor tool in the Apache AXIS
toolkit.
etc

-D


Hi,
I am writting a .NET Client for a Java Web Service.I have created a .cs file
from the WSDL and the XSD's Given.
I am trying to query a Web Service which has the description:::

// Service Description:::::::

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("urn:#solicitar",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]

[return: System.Xml.Serialization.XmlElementAttribute("Response",
Namespace="http://example")]
public string
solicitar([System.Xml.Serialization.XmlElementAttribute(Namespace="http://example")]
idMesage Mesage) {
object[] results = this.Invoke("Function", new object[] {Mesage});
return ((string)(results[0]));


But when I query the Web Service from my Client I get an Error Like:::


Error in the Client:::::

"System.InvalidOperationException: There is an error in XML document (8,
5). ---> System.Xml.XmlException: 'Element' is an invalid node type. Line 8,
position 5.\r\n at System.Xml.XmlReader.ReadElementString()\r\n at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read117_Response()\r\n
--- End of inner exception stack trace ---\r\n at
System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader,
String encodingStyle, XmlDeserializationEvents events)\r\n at
System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader,
XmlDeserializationEvents events)\r\n at
System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader)\r\n
at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean asyncCall)\r\n
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)

System.InvalidOperationException: There is an error in XML document (8,
5) ---> System.Xml.XmlException: 'Element' is an invalid node type. Line 8,
position 5.\r\n at System.Xml.XmlReader.ReadElementString()\r\n at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read117_Response()


Please help,

Regards,

Jasmeet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top