ColdFusion Web Service / WSDL problem

I am working on a web payment site for a university that uses a rather outdated system. I've worked with this system before, but in .Net. The web service functions like this: you pass two methods to this web service: authCredentials

(user and password) and getCRUrl

(order information and getCRUrl

returns the external payment URL to process the payment). For this project I have to use ColdFusion (CF 11 on IIS 7.5). I have several questions:

From everything I've read, I need to install a WSDL SSL certificate on my ColdFusion server before I can connect to the web service. I believe I have done this, but I still cannot add the web service to the ColdFusion Administrator "Error creating web service. Make sure you entered the correct web service name or URL." Is this a necessary step before I move on to using the web service?

Second, this is a snippet from WSDL:

<wsdl:definitions targetNamespace="http://finance.asg.itc.XXX.edu/">
<wsdl:documentation>XXX_WebPayment</wsdl:documentation>
<wsdl:types>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://finance.asg.itc.XXX.edu/xsd">
<xs:complexType name="Exception">
  <xs:sequence>
    <xs:element minOccurs="0" name="Exception" nillable="true" type="xs:anyType"/>
  </xs:sequence>
</xs:complexType>
<xs:element name="Exception">
<xs:complexType>
  <xs:sequence>
    <xs:element minOccurs="0" name="Exception" nillable="true" type="ns:Exception"/>
  </xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getCMUrl">
<xs:complexType>
  <xs:sequence>
    <xs:element name="orderType" type="xs:string"/>
    <xs:element minOccurs="0" name="orderNumber" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="orderName" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="orderDescription" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="amount" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="orderFee" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="amountDue" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="currentAmountDue" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="balance" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="currentBalance" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="dueDate" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="userChoice1" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="userChoice2" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="userChoice3" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="userChoice4" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="userChoice5" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="userChoice6" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="userChoice7" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="userChoice8" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="userChoice9" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="userChoice10" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="paymentMethod" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="streetOne" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="streetTwo" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="city" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="state" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="zip" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="country" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="daytimePhone" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="eveningPhone" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="email" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="redirectUrl" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="redirectUrlParameters" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="retriesAllowed" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="contentEmbedded" nillable="true" type="xs:string"/>
  </xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="authCredentials">
<xs:complexType>
  <xs:all>
    <xs:element name="region" type="xs:string"/>
    <xs:element name="passphrase" type="xs:string"/>
  </xs:all>
</xs:complexType>
</xs:element>

      

For my initial attempt to call a web service, I tried the following:

<cfinvoke returnvariable="returndata" webservice="https://sais.###.edu:8080/axis2/services/###_WebPayment" refreshwsdl="yes" method="authCredentials">
      <cfinvokeargument name="region" value="###">
      <cfinvokeargument name="passphrase" value="###">
</cfinvoke>
<cfdump var="#returndata#" />

<cfinvoke returnvariable="paymenturl" webservice="https://sais.###.edu:8080/axis2/services/###_WebPayment" refreshwsdl="yes" method="getCMUrl">            
    <cfinvokeargument name="orderType" value="TST_BZ">
    <cfinvokeargument name="amount" value="100">
    <cfinvokeargument name="streetOne" value="100">
    <cfinvokeargument name="streetTwo" value="100">
    <cfinvokeargument name="city" value="100">
    <cfinvokeargument name="state" value="100">
    <cfinvokeargument name="zip" value="100">
    <cfinvokeargument name="county" value="United States">
    <cfinvokeargument name="email" value="myemail">
    <cfinvokeargument name="redirectUrl" value="https://localhost/registration/confirmation.cfm">
    <cfinvokeargument name="redirectUrlParameters" value="true,1234,awesome">
</cfinvoke>
<cfdump var="#paymenturl#" />

      

This returns:

Can't read WSDL from url: https: //sais.###.edu: 8080 / axis2 / services / ### _ WebPayment .

Error: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: Failed to create PKIX path: java.security.cert.CertPathBuilderException: Failed to create verified path. It is recommended that you use a web browser to retrieve and validate the requested WSDL document to ensure it is correct.

If I go directly to the WSDL - https: //sais.###.edu: 8080 / axis2 / services / ### _ WebPayment? Wsdl , I can view the documentation.

Is my initial connection attempt wrong? Do I need to authenticate this way differently?

Here is an example of how I was able to use a web service from .Net.

Visual Studio connected to the WSDL without issue, pulled out all the items.

Here is my .Net source:

            Dim wsRequest As edu.###.sais.###_WebPayment (Appsettings name used in web.config file) 

            wsRequest = New edu.###.sais.###_WebPayment
            Dim myHeader As New edu.###.sais.authCredentials

            myHeader.region = ConfigurationManager.AppSettings("Region")
            myHeader.passphrase = ConfigurationManager.AppSettings("Passphrase")
            Dim oType As String
            oType = ConfigurationManager.AppSettings("OrderType")
            Dim totalamount As Double
            Dim information As String


            totalamount = (Basket.GrandTotal) * 100
            totalamount = Math.Round(totalamount, 0)

            wsRequest.authCredentialsValue = myHeader
            information = Server.HtmlEncode(wsRequest.getCMUrl(oType, "", "", "", totalamount.ToString(), "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", Basket.BillingAddress.Line1, Basket.BillingAddress.Line2, Basket.BillingAddress.City, Basket.BillingAddress.RegionName, Basket.BillingAddress.PostalCode, "United States", Basket.ShippingAddress.Phone, "", Basket.UserEmail, "http://john117.msu.montana.edu/store/comManager.aspx", "transactionStatus,orderNumber,orderAmount,payerFullName", "", ""))

Session("paymentURL") = information

      

Works like a charm.

Any help would be greatly appreciated.

+3


source to share





All Articles