| | |
Trying to consume Coldfusion Web Service using VB.NET
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: May 2008
Posts: 2
Reputation:
Solved Threads: 0
Hi all,
I'm trying to consume a Service called GetMemberPointsAvailable using VB.NET. Here is the wsdl:
http://sp-s3g-uat.iclp.com.au/ws/ega...egapi.cfc?wsdl
This service is written in coldfusion - axis engine.
The steps:
I'm using VB.net on Visual Studio 2005. I created a new windows application project.
Then I added a web reference with URL http://sp-s3g-uat.iclp.com.au/ws/ega...egapi.cfc?wsdl and named the reference as webserviceICLP
Then I added a button on my form and put the following code on the button click event:
Dim client As New webserviceICLP.SportingWS '(or egapiClient in VB2008)
For Each item As webserviceICLP.mapItem In client.getMemberPointsAvailable("xxxxx", "yyyy", "123456789")
MsgBox(item.key & vbNewLine & item.value)
Next
It does nothing because (i think) there are no item created by the response of the webservice.
Also i tried to serialize the returning webservice message object using the following code:
Dim wsICLP As New webserviceICLP.SportingWS
Dim MyParams() As webserviceICLP.mapItem = {New webserviceICLP.mapItem}
MyParams = wsICLP.getMemberPointsAvailable("xxxxx", "yyyy", "123456789")
MsgBox(SerializeToXML(MyParams))
Public Shared Function SerializeToXML(Of T)(ByVal obj As T) As String
Dim returnXML As String = String.Empty
Dim serializer As New Serialization.XmlSerializer(GetType(T))
Using writer As New IO.StringWriter
serializer.Serialize(New XmlTextWriter(writer), obj)
returnXML = writer.ToString()
End Using
Return returnXML
End Function
and the result I get is :
<?xml version="1.0" encoding="utf-16"?><ArrayOfMapItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
I know that the webservice is running because i tried to test it with the Soap UI tool and it did Ok. Here's the reponse of the WS:
<?xml version='1.0' encoding='UTF-8'?>
<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>
<getMemberPointsAvailableResponse xmlns='http://v10.egapi.ws'>
<getMemberPointsAvailableReturn xsi:type='ns1:Map' xmlns:ns1='http://xml.apache.org/xml-soap'>
<item xmlns=''>
<key xsi:type='xsd:string'>
RESPONSEERRORS
</key>
<value xsi:type='ns2:ArrayOf_xsd_anyType' xmlns:ns2='http://rpc.xml.coldfusion'/>
</item>
<item xmlns=''>
<key xsi:type='xsd:string'>
RESPONSESUCCESS
</key>
<value xsi:type='xsd:string'>
true
</value>
</item>
<item xmlns=''>
<key xsi:type='xsd:string'>
RESPONSEDATA
</key>
<value xsi:type='ns1:Map'>
<item>
<key xsi:type='xsd:string'>
POINTS_AVAILABLE
</key>
<value xsi:type='xsd:int'>
106
</value>
</item>
</value>
</item>
</getMemberPointsAvailableReturn>
</getMemberPointsAvailableResponse>
</soapenv:Body>
</soapenv:Envelope>
Any help would be much appreciated!
All the best,
BS
I'm trying to consume a Service called GetMemberPointsAvailable using VB.NET. Here is the wsdl:
http://sp-s3g-uat.iclp.com.au/ws/ega...egapi.cfc?wsdl
This service is written in coldfusion - axis engine.
The steps:
I'm using VB.net on Visual Studio 2005. I created a new windows application project.
Then I added a web reference with URL http://sp-s3g-uat.iclp.com.au/ws/ega...egapi.cfc?wsdl and named the reference as webserviceICLP
Then I added a button on my form and put the following code on the button click event:
Dim client As New webserviceICLP.SportingWS '(or egapiClient in VB2008)
For Each item As webserviceICLP.mapItem In client.getMemberPointsAvailable("xxxxx", "yyyy", "123456789")
MsgBox(item.key & vbNewLine & item.value)
Next
It does nothing because (i think) there are no item created by the response of the webservice.
Also i tried to serialize the returning webservice message object using the following code:
Dim wsICLP As New webserviceICLP.SportingWS
Dim MyParams() As webserviceICLP.mapItem = {New webserviceICLP.mapItem}
MyParams = wsICLP.getMemberPointsAvailable("xxxxx", "yyyy", "123456789")
MsgBox(SerializeToXML(MyParams))
Public Shared Function SerializeToXML(Of T)(ByVal obj As T) As String
Dim returnXML As String = String.Empty
Dim serializer As New Serialization.XmlSerializer(GetType(T))
Using writer As New IO.StringWriter
serializer.Serialize(New XmlTextWriter(writer), obj)
returnXML = writer.ToString()
End Using
Return returnXML
End Function
and the result I get is :
<?xml version="1.0" encoding="utf-16"?><ArrayOfMapItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
I know that the webservice is running because i tried to test it with the Soap UI tool and it did Ok. Here's the reponse of the WS:
<?xml version='1.0' encoding='UTF-8'?>
<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>
<getMemberPointsAvailableResponse xmlns='http://v10.egapi.ws'>
<getMemberPointsAvailableReturn xsi:type='ns1:Map' xmlns:ns1='http://xml.apache.org/xml-soap'>
<item xmlns=''>
<key xsi:type='xsd:string'>
RESPONSEERRORS
</key>
<value xsi:type='ns2:ArrayOf_xsd_anyType' xmlns:ns2='http://rpc.xml.coldfusion'/>
</item>
<item xmlns=''>
<key xsi:type='xsd:string'>
RESPONSESUCCESS
</key>
<value xsi:type='xsd:string'>
true
</value>
</item>
<item xmlns=''>
<key xsi:type='xsd:string'>
RESPONSEDATA
</key>
<value xsi:type='ns1:Map'>
<item>
<key xsi:type='xsd:string'>
POINTS_AVAILABLE
</key>
<value xsi:type='xsd:int'>
106
</value>
</item>
</value>
</item>
</getMemberPointsAvailableReturn>
</getMemberPointsAvailableResponse>
</soapenv:Body>
</soapenv:Envelope>
Any help would be much appreciated!
All the best,
BS
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: NoBody Have any idea about Regsistry
- Next Thread: Status Bar Marquee...Need Help!
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2005 2008 access account arithmetic array assignment basic box button buttons center check code component connectionstring convert crystalreport data database databasesearch datagrid datagridview date design dissertation dissertations dissertationthesis dosconsolevb.net dropdownlist excel fade file-dialog firewall folder ftp generatetags hardcopy image images input insert intel isnumericfuntioncall math monitor navigate net networking opacity output passingparameters peertopeervideostreaming picturebox picturebox1 port problem problemwithinstallation project record reports" savedialog searchvb.net select serial shutdown string survey tcp temp temperature text textbox timer toolbox trim updown user useraccounts usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf





