C
chandra kantha via .NET 247
Hi ,
I have a java web services (message style web service whichreturns document object) on axis and im trying to access it fromvb.net client. It is returning nothing/null. Please help me tofix this problem. We monitored the SOAP request and responsethey look ok.
Web service code
========================================================
public class MessageServiceDoc {
* Service method, which simply echoes back any XML itreceives.
public Document echoDocument(Document doc)
{
// Printing an element from the recieved XML document
System.out.println("PriMod = " +doc.getElementsByTagName("PriMod").getLength());
return doc;
}
}
==================================
WSDD file looks like this
==========================
<deployment name="test" xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"
xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance">
<service name=" MessageServiceDoc " style="message">
<parameter name="className" value="samples.message.MessageServiceDoc " />
<parameter name="allowedMethods" value="echoDocument" />
</service>
</deployment>
WSDL file looks like this
=======================================
<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitionstargetNamespace="http://gdcwf215:8080/axis/services/MessageServiceDoc" xmlns="http://schemas.xmlsoap.org/wsdl/"xmlns:apachesoap="http://xml.apache.org/xml-soap"xmlns:impl="http://gdcwf215:8080/axis/services/MessageServiceDoc"xmlns:intf="http://gdcwf215:8080/axis/services/MessageServiceDoc" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"xmlns:tns1="http://message.samples"xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <wsdl:types>
- <schema targetNamespace="http://message.samples"xmlns="http://www.w3.org/2001/XMLSchema">
<element name="echoDocument" type="xsd:anyType" />
</schema>
- <schematargetNamespace="http://gdcwf215:8080/axis/services/MessageServiceDoc" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="echoDocumentReturn" type="xsd:anyType" />
</schema>
</wsdl:types>
- <wsdl:message name="echoDocumentRequest">
<wsdlart element="tns1:echoDocument" name="part" />
</wsdl:message>
- <wsdl:message name="echoDocumentResponse">
<wsdlart element="impl:echoDocumentReturn"name="echoDocumentReturn" />
</wsdl:message>
- <wsdlortType name="MessageServiceDoc">
- <wsdlperation name="echoDocument">
<wsdl:input message="impl:echoDocumentRequest"name="echoDocumentRequest" />
<wsdlutput message="impl:echoDocumentResponse"name="echoDocumentResponse" />
</wsdlperation>
</wsdlortType>
- <wsdl:binding name="MessageServiceDocSoapBinding"type="impl:MessageServiceDoc">
<wsdlsoap:binding style="document"transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdlperation name="echoDocument">
<wsdlsoapperation soapAction="" />
- <wsdl:input name="echoDocumentRequest">
<wsdlsoap:body namespace="http://message.samples" use="literal"/>
</wsdl:input>
- <wsdlutput name="echoDocumentResponse">
<wsdlsoap:bodynamespace="http://gdcwf215:8080/axis/services/MessageServiceDoc"use="literal" />
</wsdlutput>
</wsdlperation>
</wsdl:binding>
- <wsdl:service name="MessageServiceDocService">
- <wsdlort binding="impl:MessageServiceDocSoapBinding"name="MessageServiceDoc">
<wsdlsoap:addresslocation="http://gdcwf215:8080/axis/services/MessageServiceDoc"/>
</wsdlort>
</wsdl:service>
</wsdl:definitions>
==================================
VB.net proxy code is
=============================
Imports System
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Xml.Serialization
'
'This source code was auto-generated by Microsoft.VSDesigner,Version 1.1.4322.2032.
'
Namespace gdcwf215
'<remarks/>
<System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.Web.Services.WebServiceBindingAttribute(Name:="MessageServiceDocSoapBinding",[Namespace]:="http://localhost:8082/axis/services/MessageServiceDoc")> _
Public Class MessageServiceDocService
InheritsSystem.Web.Services.Protocols.SoapHttpClientProtocol
'<remarks/>
Public Sub New()
MyBase.New
Me.Url ="http://localhost:8082/axis/services/MessageServiceDoc"
End Sub
'<remarks/>
<System.Web.Services.Protocols.SoapDocumentMethodAttribute("",Use:=System.Web.Services.Description.SoapBindingUse.Literal,ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Bare)> _
Public FunctionechoDocument(<System.Xml.Serialization.XmlElement_u116?tribute("echoDocument", [Namespace]:="http://message.samples")>ByVal echoDocument1 As System.Xml.XmlDocument) As<System.Xml.Serialization.XmlElementAttribute("echoDocumentReturn",[Namespace]:="http://localhost:8082/axis/services/MessageServiceDoc")> Object
Dim results() As Object = Me.Invoke("echoDocument",New Object() {echoDocument1})
Return CType(results(0), Object)
End Function
'<remarks/>
Public Function BeginechoDocument(ByVal echoDocument1 AsObject, ByVal callback As System.AsyncCallback, ByVal asyncStateAs Object) As System.IAsyncResult
Return Me.BeginInvoke("echoDocument", New Object(){echoDocument1}, callback, asyncState)
End Function
'<remarks/>
Public Function EndechoDocument(ByVal asyncResult AsSystem.IAsyncResult) As Object
Dim results() As Object = Me.EndInvoke(asyncResult)
Return CType(results(0), Object)
End Function
End Class
End Namespace
===========================================
Vb.net client code
Dim proxy As New gdcwf215.MessageServiceDocService
Dim xmldoc As New Xml.XmlDocument
Dim xmldoc1 As New Xml.XmlDocument
Try
xmldoc.LoadXml("<ParameterRequest><PriMod><Name>NAROE</Name><ModelUser>500700656</ModelUser></PriMod></ParameterRequest>")
xmldoc1 = proxy.echoDocument(xmldoc)
TextBox2.Text = xmldoc1.InnerXml
Catch ex As Exception
TextBox2.Text = ex.Message
End Try
Thanks in advance
I have a java web services (message style web service whichreturns document object) on axis and im trying to access it fromvb.net client. It is returning nothing/null. Please help me tofix this problem. We monitored the SOAP request and responsethey look ok.
Web service code
========================================================
public class MessageServiceDoc {
* Service method, which simply echoes back any XML itreceives.
public Document echoDocument(Document doc)
{
// Printing an element from the recieved XML document
System.out.println("PriMod = " +doc.getElementsByTagName("PriMod").getLength());
return doc;
}
}
==================================
WSDD file looks like this
==========================
<deployment name="test" xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"
xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance">
<service name=" MessageServiceDoc " style="message">
<parameter name="className" value="samples.message.MessageServiceDoc " />
<parameter name="allowedMethods" value="echoDocument" />
</service>
</deployment>
WSDL file looks like this
=======================================
<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitionstargetNamespace="http://gdcwf215:8080/axis/services/MessageServiceDoc" xmlns="http://schemas.xmlsoap.org/wsdl/"xmlns:apachesoap="http://xml.apache.org/xml-soap"xmlns:impl="http://gdcwf215:8080/axis/services/MessageServiceDoc"xmlns:intf="http://gdcwf215:8080/axis/services/MessageServiceDoc" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"xmlns:tns1="http://message.samples"xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <wsdl:types>
- <schema targetNamespace="http://message.samples"xmlns="http://www.w3.org/2001/XMLSchema">
<element name="echoDocument" type="xsd:anyType" />
</schema>
- <schematargetNamespace="http://gdcwf215:8080/axis/services/MessageServiceDoc" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="echoDocumentReturn" type="xsd:anyType" />
</schema>
</wsdl:types>
- <wsdl:message name="echoDocumentRequest">
<wsdlart element="tns1:echoDocument" name="part" />
</wsdl:message>
- <wsdl:message name="echoDocumentResponse">
<wsdlart element="impl:echoDocumentReturn"name="echoDocumentReturn" />
</wsdl:message>
- <wsdlortType name="MessageServiceDoc">
- <wsdlperation name="echoDocument">
<wsdl:input message="impl:echoDocumentRequest"name="echoDocumentRequest" />
<wsdlutput message="impl:echoDocumentResponse"name="echoDocumentResponse" />
</wsdlperation>
</wsdlortType>
- <wsdl:binding name="MessageServiceDocSoapBinding"type="impl:MessageServiceDoc">
<wsdlsoap:binding style="document"transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdlperation name="echoDocument">
<wsdlsoapperation soapAction="" />
- <wsdl:input name="echoDocumentRequest">
<wsdlsoap:body namespace="http://message.samples" use="literal"/>
</wsdl:input>
- <wsdlutput name="echoDocumentResponse">
<wsdlsoap:bodynamespace="http://gdcwf215:8080/axis/services/MessageServiceDoc"use="literal" />
</wsdlutput>
</wsdlperation>
</wsdl:binding>
- <wsdl:service name="MessageServiceDocService">
- <wsdlort binding="impl:MessageServiceDocSoapBinding"name="MessageServiceDoc">
<wsdlsoap:addresslocation="http://gdcwf215:8080/axis/services/MessageServiceDoc"/>
</wsdlort>
</wsdl:service>
</wsdl:definitions>
==================================
VB.net proxy code is
=============================
Imports System
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Xml.Serialization
'
'This source code was auto-generated by Microsoft.VSDesigner,Version 1.1.4322.2032.
'
Namespace gdcwf215
'<remarks/>
<System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.Web.Services.WebServiceBindingAttribute(Name:="MessageServiceDocSoapBinding",[Namespace]:="http://localhost:8082/axis/services/MessageServiceDoc")> _
Public Class MessageServiceDocService
InheritsSystem.Web.Services.Protocols.SoapHttpClientProtocol
'<remarks/>
Public Sub New()
MyBase.New
Me.Url ="http://localhost:8082/axis/services/MessageServiceDoc"
End Sub
'<remarks/>
<System.Web.Services.Protocols.SoapDocumentMethodAttribute("",Use:=System.Web.Services.Description.SoapBindingUse.Literal,ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Bare)> _
Public FunctionechoDocument(<System.Xml.Serialization.XmlElement_u116?tribute("echoDocument", [Namespace]:="http://message.samples")>ByVal echoDocument1 As System.Xml.XmlDocument) As<System.Xml.Serialization.XmlElementAttribute("echoDocumentReturn",[Namespace]:="http://localhost:8082/axis/services/MessageServiceDoc")> Object
Dim results() As Object = Me.Invoke("echoDocument",New Object() {echoDocument1})
Return CType(results(0), Object)
End Function
'<remarks/>
Public Function BeginechoDocument(ByVal echoDocument1 AsObject, ByVal callback As System.AsyncCallback, ByVal asyncStateAs Object) As System.IAsyncResult
Return Me.BeginInvoke("echoDocument", New Object(){echoDocument1}, callback, asyncState)
End Function
'<remarks/>
Public Function EndechoDocument(ByVal asyncResult AsSystem.IAsyncResult) As Object
Dim results() As Object = Me.EndInvoke(asyncResult)
Return CType(results(0), Object)
End Function
End Class
End Namespace
===========================================
Vb.net client code
Dim proxy As New gdcwf215.MessageServiceDocService
Dim xmldoc As New Xml.XmlDocument
Dim xmldoc1 As New Xml.XmlDocument
Try
xmldoc.LoadXml("<ParameterRequest><PriMod><Name>NAROE</Name><ModelUser>500700656</ModelUser></PriMod></ParameterRequest>")
xmldoc1 = proxy.echoDocument(xmldoc)
TextBox2.Text = xmldoc1.InnerXml
Catch ex As Exception
TextBox2.Text = ex.Message
End Try
Thanks in advance