Author Message
JNemani
Joined: Apr 6, 2017
Messages: 56
Offline
I am attempting to call a webservice that requires the following 3 data types for the input, String, Big Decimal and PaymentRefundType.


public StopPaymentRequest(
java.lang.String sequenceNumber,
java.math.BigDecimal amount,
ca.company.CustomerCare.Payment.PaymentRefundType refund) {
this.sequenceNumber = sequenceNumber;
this.amount = amount;
this.refund = refund;
}


Based on various menu choices in the IVR, I determine the PaymentRefundType to be one of 3 values as seen in this SOAP call (RefundToCompany or RefundToPayee or RefundToCreditPayroll) and have that assigned to a variable stopPaymentRefundRequest

Which then calls the webservice called StopPayment
see attached screenshot

Here is the SOAPUI call

POST [SOAP address not available] HTTP/1.1
Host: [Host not available]
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<stopPaymentRequest xmlns="http://ceridian.ca/CustomerCare/IVR">
<sequenceNumber />
<amount>decimal</amount>
<refund>RefundToCompany or RefundToPayee or RefundToCreditPayroll</refund>
</stopPaymentRequest>
</soap12:Body>
</soap12:Envelope>


I am getting type mismatch when trying to just send a string with one of those 3 values into the PaymentRefundType value before I call the webservice, of course. I cannot figure out how to get this string called stopPaymentRefundRequest, cast to PaymentRefundType Type? What is the syntax of the statement?

Here I’ve included the PaymentRefundType src


/**
* PaymentRefundType.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/

package ca.company.CustomerCare.Payment;

public class PaymentRefundType implements java.io.Serializable {
private java.lang.String _value_;
private static java.util.HashMap _table_ = new java.util.HashMap();

// Constructor
protected PaymentRefundType(java.lang.String value) {
_value_ = value;
_table_.put(_value_,this);
}

public static final java.lang.String _RefundToCompany = "RefundToCompany";
public static final java.lang.String _RefundToPayee = "RefundToPayee";
public static final java.lang.String _RefundToCreditPayroll = "RefundToCreditPayroll";
public static final PaymentRefundType RefundToCompany = new PaymentRefundType(_RefundToCompany);
public static final PaymentRefundType RefundToPayee = new PaymentRefundType(_RefundToPayee);
public static final PaymentRefundType RefundToCreditPayroll = new PaymentRefundType(_RefundToCreditPayroll);
public java.lang.String getValue() { return _value_;}
public static PaymentRefundType fromValue(java.lang.String value)
throws java.lang.IllegalArgumentException {
PaymentRefundType enumeration = (PaymentRefundType)
_table_.get(value);
if (enumeration==null) throw new java.lang.IllegalArgumentException();
return enumeration;
}
public static PaymentRefundType fromString(java.lang.String value)
throws java.lang.IllegalArgumentException {
return fromValue(value);
}
public boolean equals(java.lang.Object obj) {return (obj == this);}
public int hashCode() { return toString().hashCode();}
public java.lang.String toString() { return _value_;}
public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);}
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.EnumSerializer(
_javaType, _xmlType);
}
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.EnumDeserializer(
_javaType, _xmlType);
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(PaymentRefundType.class);

static {
typeDesc.setXmlType(new javax.xml.namespace.QName("http://company.ca/CustomerCare/IVR", "PaymentRefundType"));
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}

}

Thanks.



  • [Thumb - StopPaymentWS.PNG]
[Disk] Download
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
The screenshot show some information that does not make sense. How can a request type be a parameter? The real input parameters should be the ones you mentioned. Do you have the wsdl file for me to look at?
JNemani
Joined: Apr 6, 2017
Messages: 56
Offline
Is there an email i can send it too please?
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
You can send private message in this forum.
JNemani
Joined: Apr 6, 2017
Messages: 56
Offline
I finally figured it out. I added the two following lines to a servlet prior to the WS call and it went thru.

// convert the string to PaymentRefundType
PaymentRefundType spt = PaymentRefundType.fromString(var1);


// Now we need to get spt INTO stopPaymentRequest:refund before it calls the StopPayment WS
sprRefundValue.setValue(spt);
Go to:   
Mobile view