• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

ColdFusion Web Service/WSDL Connection Issue

Greetings Experts,

I am working on a web payment site for a university that uses a fairly outdated system.  I have worked with this system before but in .Net.  The Web Service functions as follows, you pass two methods for this Web Service to function authCredentials (user and pass) and getCRUrl (order information and getCRUrl returns an external payment URL to process the payment). For this project I have to use ColdFusion (CF 11 on IIS 7.5).  I have a few questions:

From all that I have read I have to install the WSDL's SSL cert on my CF server before I will be able to connect to the web service.  I believe that I have done this but I am still not able to add the web service in the CF Administrator "Error creating web service. Please ensure that you have entered a correct Web Service name or URL".  Is this a required step before I move on to try to consume the web service?

Secondly here a snippit from the 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 try to invoke the 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:

Unable to read WSDL from URL: https://sais.###.edu:8080/axis2/services/###_WebPayment.

Error: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: java.security.cert.CertPathBuilderException: Could not build a validated path.. It is recommended that you use a web browser to retrieve and examine 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 incorrect?  Do I need so somehow pass the authentication a different way?

Here is an example of how I was able to consume the web service from .Net.

Visual Studio connected to the WSDL with no issues, pulled all elements.

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.
0
esiss
Asked:
esiss
1 Solution
 
Pravin AsarPrincipal Systems EngineerCommented:
Hope you have installed appropriate cert for SSL

ColdFusion can not access any secure URLs (beginning with HTTPS) unless it contained the server’s SSL certificate (or the certificate’s issuer’s certificate) in its certificate store.

You may look/use at certman utility (available at riaforge.org)


http://certman.riaforge.org/ 

This is a custom administrator extension named "CertMan" that allows you to view, add, and delete SSL certificates from within the ColdFusion administrator.
0
 
esissAuthor Commented:
Thank you for this.  We ended up going a different route.  But Certman seemed to work.

Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now