Hi,
I am working on my first Web Services client project. I have a relatively simple web service running on an Apache/Tomcat server. I have used the Web Services Explorer of Eclipse to test and verify the behavior of the web service. I have used the “Add Web Reference” option of Visual Studio to generate the proxy class and add it to the project. The request message is pasted below:
<System.Web.Services.Protocols.SoapDocumentMethodAttribute("urn:LOOKUP_DATE_DESC", _
Use:=System.Web.Services.Description.SoapBindingUse.Literal, _
ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Bare)> _
Public Function LOOKUP_DATE_DESC(<System.Xml.Serialization.XmlElementAttribute( _ [Namespace]:="http://appdev.cincom.com/MantisServer")> _
ByVal REQ_DATE_DESC As REQ_DATE_DESC) As _ System.Xml.Serialization.XmlElementAttribute("RESP_DATE_DESC_OUT", _
[Namespace]:="http://appdev.cincom.com/MantisServer")> RESP_DATE_DESC_OUT
Dim results() As Object = Me.Invoke("LOOKUP_DATE_DESC", New Object() {REQ_DATE_DESC})
Return CType(results(0),RESP_DATE_DESC_OUT)
End Function
The classes for request objects are defined as:
<System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://appdev.cincom.com/MantisServer")> _
Public Class REQ_DATE_DESC
Public CONTROL As CONTROL
Public REQ_DATE_DESC_FORM As REQ_DATE_DESC_FORM
End Class
<System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://appdev.cincom.com/MantisServer")> _
Public Class CONTROL
Public NAME As String
Public CLEARANCE As String
Public PARAMETER As String
Public OPERATION As String
End Class
<System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://appdev.cincom.com/MantisServer")> _
Public Class REQ_DATE_DESC_FORM
Public year As Decimal
Public month As Decimal
End Class
In a button_onClick event I instantiate an instance of the service (not described here), an instance of REQ_DATE_DESC, an instance of CONTROL and an instance of REQ_DATE_DESC_FORM. I initialize the request value for the input fields, and then assign the CONTROL and REQ_DATE_DESC_FORM instances into their reference variables in REQ_DATE_DESC.
Then I call service.LOOKUP_DATE_DESC with the following statement:
aRspRec = aService.LOOKUP_DATE_DESC(aReqRec)
aRspRec is defined with: Dim aRspRec As localhost.RESP_DATE_DESC_OUT
The definitions for the response classes are:
<System.Xml.Serialization.XmlTypeAttribute([Namespace]:= _
http://appdev.cincom.com/MantisServer")> _
Public Class RESP_DATE_DESC_OUT
Public RESP_DATE_DESC As RESP_DATE_DESC
<System.Xml.Serialization.XmlElementAttribute("CONTROL-RESERVED_INFO")> _
Public CONTROLRESERVED_INFO As CONTROLRESERVED_INFO
<System.Xml.Serialization.XmlAttributeAttribute()> _
Public NAME As String
End Class
<System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://appdev.cincom.com/MantisServer")> _
Public Class RESP_DATE_DESC
Public resultCode As String
Public resultMessage As String
Public year As Decimal
Public month As Decimal
Public description As String
End Class
<System.Xml.Serialization.XmlTypeAttribute(TypeName:="CONTROL-RESERVED_INFO", -
[Namespace]:="http://appdev.cincom.com/MantisServer")> _
Public Class CONTROLRESERVED_INFO
Public MSG As String
Public INPUT_LINE As String
Public KEYSIM As String
End Class
The LOOKUP_DATE_DESC(aReqRec) returns and instance of aRspRec, but both of the reference variables (RESP_DATE_DESC, CONTOLRESEREVED_INFO,) are “Nothing”; i.e., nil.
The input SOAP message into the LOOKUP_DATE_DESC service looks like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:q0="http://appdev.cincom.com/MantisServer"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<q0:REQ_DATE_DESC>
<q0:CONTROL>
<q0:NAME>EXAMPLES</q0:NAME>
<q0:CLEARANCE>CASINO</q0:CLEARANCE>
<q0ARAMETER>LOOKUP_DATE_DESC</q0ARAMETER>
</q0:CONTROL>
<q0:REQ_DATE_DESC_FORM>
<q0:year>2010</q0:year>
<q0:month>7</q0:month>
</q0:REQ_DATE_DESC_FORM>
</q0:REQ_DATE_DESC>
</soapenv:Body>
</soapenv:Envelope>
The response SOAP message from the LOOKUP_DATE_DESC service looks like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<man:RESP_DATE_DESC_OUT xmlns:man="http://appdev.cincom.com/MantisServer"
NAME="RESP_DATE_DESC">
<RESP_DATE_DESC xmlns:ns1="http://appdev.cincom.com/MantisServer">
<resultCode HID="N" LEN="8" PRO="N" TYP="T">Found</resultCode>
<resultMessage HID="N" LEN="100" PRO="N" TYP="T">Description found for
year(2010) month( 7)</resultMessage>
<year HID="N" LEN="4" PRO="N" TYP="B">2010</year>
<month HID="N" LEN="2" PRO="N" TYP="B">7</month>
<description HID="N" LEN="16" PRO="N" TYP="T">July, 2010</description>
</RESP_DATE_DESC>
<CONTROL-RESERVED_INFO xmlns:ns1="http://appdev.cincom.com/MantisServer">
<MSG PRO="Y" />
<INPUT_LINE PRO="N" />
<KEYSIM PRO="N" />
</CONTROL-RESERVED_INFO>
</man:RESP_DATE_DESC_OUT>
</soapenv:Body>
</soapenv:Envelope>
Can anyone tell me what I am doing wrong. If requested to do so, I will post the entire button_onClick method source; I can also post the Web Service WSDL.
Any insight will be greatly apprecieated.
Rodney
I am working on my first Web Services client project. I have a relatively simple web service running on an Apache/Tomcat server. I have used the Web Services Explorer of Eclipse to test and verify the behavior of the web service. I have used the “Add Web Reference” option of Visual Studio to generate the proxy class and add it to the project. The request message is pasted below:
<System.Web.Services.Protocols.SoapDocumentMethodAttribute("urn:LOOKUP_DATE_DESC", _
Use:=System.Web.Services.Description.SoapBindingUse.Literal, _
ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Bare)> _
Public Function LOOKUP_DATE_DESC(<System.Xml.Serialization.XmlElementAttribute( _ [Namespace]:="http://appdev.cincom.com/MantisServer")> _
ByVal REQ_DATE_DESC As REQ_DATE_DESC) As _ System.Xml.Serialization.XmlElementAttribute("RESP_DATE_DESC_OUT", _
[Namespace]:="http://appdev.cincom.com/MantisServer")> RESP_DATE_DESC_OUT
Dim results() As Object = Me.Invoke("LOOKUP_DATE_DESC", New Object() {REQ_DATE_DESC})
Return CType(results(0),RESP_DATE_DESC_OUT)
End Function
The classes for request objects are defined as:
<System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://appdev.cincom.com/MantisServer")> _
Public Class REQ_DATE_DESC
Public CONTROL As CONTROL
Public REQ_DATE_DESC_FORM As REQ_DATE_DESC_FORM
End Class
<System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://appdev.cincom.com/MantisServer")> _
Public Class CONTROL
Public NAME As String
Public CLEARANCE As String
Public PARAMETER As String
Public OPERATION As String
End Class
<System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://appdev.cincom.com/MantisServer")> _
Public Class REQ_DATE_DESC_FORM
Public year As Decimal
Public month As Decimal
End Class
In a button_onClick event I instantiate an instance of the service (not described here), an instance of REQ_DATE_DESC, an instance of CONTROL and an instance of REQ_DATE_DESC_FORM. I initialize the request value for the input fields, and then assign the CONTROL and REQ_DATE_DESC_FORM instances into their reference variables in REQ_DATE_DESC.
Then I call service.LOOKUP_DATE_DESC with the following statement:
aRspRec = aService.LOOKUP_DATE_DESC(aReqRec)
aRspRec is defined with: Dim aRspRec As localhost.RESP_DATE_DESC_OUT
The definitions for the response classes are:
<System.Xml.Serialization.XmlTypeAttribute([Namespace]:= _
http://appdev.cincom.com/MantisServer")> _
Public Class RESP_DATE_DESC_OUT
Public RESP_DATE_DESC As RESP_DATE_DESC
<System.Xml.Serialization.XmlElementAttribute("CONTROL-RESERVED_INFO")> _
Public CONTROLRESERVED_INFO As CONTROLRESERVED_INFO
<System.Xml.Serialization.XmlAttributeAttribute()> _
Public NAME As String
End Class
<System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://appdev.cincom.com/MantisServer")> _
Public Class RESP_DATE_DESC
Public resultCode As String
Public resultMessage As String
Public year As Decimal
Public month As Decimal
Public description As String
End Class
<System.Xml.Serialization.XmlTypeAttribute(TypeName:="CONTROL-RESERVED_INFO", -
[Namespace]:="http://appdev.cincom.com/MantisServer")> _
Public Class CONTROLRESERVED_INFO
Public MSG As String
Public INPUT_LINE As String
Public KEYSIM As String
End Class
The LOOKUP_DATE_DESC(aReqRec) returns and instance of aRspRec, but both of the reference variables (RESP_DATE_DESC, CONTOLRESEREVED_INFO,) are “Nothing”; i.e., nil.
The input SOAP message into the LOOKUP_DATE_DESC service looks like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:q0="http://appdev.cincom.com/MantisServer"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<q0:REQ_DATE_DESC>
<q0:CONTROL>
<q0:NAME>EXAMPLES</q0:NAME>
<q0:CLEARANCE>CASINO</q0:CLEARANCE>
<q0ARAMETER>LOOKUP_DATE_DESC</q0ARAMETER>
</q0:CONTROL>
<q0:REQ_DATE_DESC_FORM>
<q0:year>2010</q0:year>
<q0:month>7</q0:month>
</q0:REQ_DATE_DESC_FORM>
</q0:REQ_DATE_DESC>
</soapenv:Body>
</soapenv:Envelope>
The response SOAP message from the LOOKUP_DATE_DESC service looks like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<man:RESP_DATE_DESC_OUT xmlns:man="http://appdev.cincom.com/MantisServer"
NAME="RESP_DATE_DESC">
<RESP_DATE_DESC xmlns:ns1="http://appdev.cincom.com/MantisServer">
<resultCode HID="N" LEN="8" PRO="N" TYP="T">Found</resultCode>
<resultMessage HID="N" LEN="100" PRO="N" TYP="T">Description found for
year(2010) month( 7)</resultMessage>
<year HID="N" LEN="4" PRO="N" TYP="B">2010</year>
<month HID="N" LEN="2" PRO="N" TYP="B">7</month>
<description HID="N" LEN="16" PRO="N" TYP="T">July, 2010</description>
</RESP_DATE_DESC>
<CONTROL-RESERVED_INFO xmlns:ns1="http://appdev.cincom.com/MantisServer">
<MSG PRO="Y" />
<INPUT_LINE PRO="N" />
<KEYSIM PRO="N" />
</CONTROL-RESERVED_INFO>
</man:RESP_DATE_DESC_OUT>
</soapenv:Body>
</soapenv:Envelope>
Can anyone tell me what I am doing wrong. If requested to do so, I will post the entire button_onClick method source; I can also post the Web Service WSDL.
Any insight will be greatly apprecieated.
Rodney