Can someone help me with defining classic ASP logic for retrieving data from a ASP.NET web service WSDL using SOAP. I am not sure I am calling event and passing the variables correcly. I just need to call the ASP.NET web service with 5 parmeters and accept the result set.
Dim oSOAP
Dim objSoapClient
Dim AccountNumber = 1234
Dim BillMonth = 12
Dim BillYear = 12
Dim StartDate = "2/1/2006"
Dim EndDate = "2/28/2006"
Dim CallMethod
'Create a SOAP client and callthe C# web services)
SET objSoapClient = Server.CreateObject("MSSOA
P.SoapClie
nt")
objSoapClient.ClientProper
ty("Server
HTTPReques
t") = True
Call objSoapClient.mssoapinit("
http://ua-www.energydirect.com/ENetBillCalc.asmx?WSDL", "BillCalc")
'Now I want to pass my selection fields to the web services and return results to the results table.
CallMethod = objSoapClient.CalculateBil
l(results,
"AccountNumber" , "BillMonth", "BillYear", "StartDate", "EndDate")
Is this correct? Is CalculateBill the correct event to call from the WSDL below?
response.write(results)
Here is the WSDL
<?xml version="1.0" encoding="utf-8" ?>
- <wsdl:definitions xmlns:http="
http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="
http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="
http://www.w3.org/2001/XMLSchema" xmlns:soapenc="
http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="
http://BillGen.com/ENetBillCalc/" xmlns:tm="
http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="
http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="
http://BillGen.com/ENetBillCalc/" xmlns:wsdl="
http://schemas.xmlsoap.org/wsdl/">
- <wsdl:types>
- <s:schema elementFormDefault="qualif
ied" targetNamespace="
http://BillGen.com/ENetBillCalc/">
- <s:element name="CalculateBill">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="AccountNumber" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="BillMonth" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="BillYear" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="StartDate" type="s:dateTime" />
<s:element minOccurs="1" maxOccurs="1" name="EndDate" type="s:dateTime" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="CalculateBillRespons
e">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="ResultCode" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="ResultMessage" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="RateName" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="LineItemCount" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="LineItems" type="tns:ArrayOfLineItem"
/>
</s:sequence>
</s:complexType>
</s:element>
- <s:complexType name="ArrayOfLineItem">
- <s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="LineItem" nillable="true" type="tns:LineItem" />
</s:sequence>
</s:complexType>
- <s:complexType name="LineItem">
- <s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="LineNumber" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="Description" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Amount" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="AmountUnit" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Rate" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="RateUnit" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="NetAmount" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ParameterCode" type="s:string" />
</s:sequence>
</s:complexType>
<s:element name="BGLoginParams" type="tns:BGLoginParams" />
- <s:complexType name="BGLoginParams">
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="username" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
</s:sequence>
</s:complexType>
</s:schema>
</wsdl:types>
- <wsdl:message name="CalculateBillSoapIn"
>
<wsdl:part name="parameters" element="tns:CalculateBill
" />
</wsdl:message>
- <wsdl:message name="CalculateBillSoapOut
">
<wsdl:part name="parameters" element="tns:CalculateBill
Response" />
</wsdl:message>
- <wsdl:message name="CalculateBillBGLogin
Params">
<wsdl:part name="BGLoginParams" element="tns:BGLoginParams
" />
</wsdl:message>
- <wsdl:portType name="BGBillCalcSoap">
- <wsdl:operation name="CalculateBill">
<wsdl:input message="tns:CalculateBill
SoapIn" />
<wsdl:output message="tns:CalculateBill
SoapOut" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="BGBillCalcSoap" type="tns:BGBillCalcSoap">
<soap:binding transport="
http://schemas.xmlsoap.org/soap/http" style="document" />
- <wsdl:operation name="CalculateBill">
<soap:operation soapAction="
http://BillGen.com/ENetBillCalc/CalculateBill" style="document" />
- <wsdl:input>
<soap:body use="literal" />
<soap:header message="tns:CalculateBill
BGLoginPar
ams" part="BGLoginParams" use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="BGBillCalc">
- <wsdl:port name="BGBillCalcSoap" binding="tns:BGBillCalcSoa
p">
<soap:address location="
http://ua-www.energydirect.com:9443/ENetBillCalc.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Start Free Trial