Hello All

I am having an issue with the way AXIS is creating the XML-SOAP
request that it sends to a 3rd party webservice.

PROBLEM:  AXIS is adding  xsi:type="xsd:int" to certain elements of the request.
               <ns1:month xsi:type="xsd:int">12</ns1:month>

The 3rd party webservice rejects the request, stating "You submitted
an invalid XML request. Please verify your request and retry the
transaction."    The WSDL is at
https://webservices.optimalpayments.com/creditcardWS/CreditCardService/v1?wsdl

If I manually remove the xsi:type="xsd:int" string and perform a
manual CFHTTP post of the raw SOAP message (that I captured using
getSoapRequest) , it works fine.   However, this requires use of
CFHTTP and not the native use of the wsdl object, which then requires
me to parse the XML response myself, which is another time-consuming
and error-prone task.

Things I have tried:

               See:
http://ws.apache.org/axis/java/reference.html#WSDL2JavaReference

               Modify server-config.wsdd, add the following to the
<globalConfiguration>

<parameter name="sendXsiTypes" value="false"/>

This setting seems to make no difference.  The SOAP request generated
by AXIS is identical regardless if the above is set to true or false.
Yes, I was sure to restart the CFApp server each time I changed the
above.


     Adding wsdl2JavaArgs:
         argStruct.wsdl2JavaArgs="--property PROP_SEND_XSI=false";
 <-- ERRORS OUT, tried several versions of this.


Things I haven't figured out yet:

Perform a _setProperty on the object before calling the method, like:

        
optimalPayments.creditCard._setProperty("java?????.axis.????.sendXsiTypes",
false);

        Although, I'm not sure the above will even work, see
                http://osdir.com/ml/text.xml.axis.user/2002-12/msg00513.html


CALLING COLDFUSION CODE:   (CF uses Axis for all web service requests)

<cfscript>
      argStruct = structNew();
      argStruct.refreshWSDL="yes";
      argStruct.wsdl2JavaArgs="";
      //argStruct.wsdl2JavaArgs="-W -T 1.2";
      //argStruct.wsdl2JavaArgs="--property PROP_SEND_XSI=0";
      optimalPayments.creditCard = createObject("webservice",
"https://webservices.optimalpayments.com/creditcardWS/CreditCardService/v1?wsdl";,
argStruct);

      requestStruct = structNew();
      requestStruct.merchantAccount = structNew();
      requestStruct.merchantAccount.accountNum = "89999340";
      requestStruct.merchantAccount.storeID = "test";
      requestStruct.merchantAccount.storePwd = "test";
      requestStruct.merchantRefNum = randRange(99,99999999);
      requestStruct.merchantRefNum = "987564";
      requestStruct.amount = "10.00";
      requestStruct.card = structNew();
      requestStruct.card.cardNum = "5442981111111023";
      requestStruct.card.cardExpiry = structNew();
      requestStruct.card.cardExpiry.month = 12;
      requestStruct.card.cardExpiry.year = 2010;
      requestStruct.billingDetails = structNew();
      requestStruct.billingDetails.zip = "49444";

      response = optimalPayments.creditCard.ccPurchase(requestStruct);
      request  = getSoapRequest(optimalPayments.creditCard);
</cfscript>

<cfdump var="#optimalPayments.creditCard#">
<cfdump var="#request#">
<cfdump var="#response#">


GENERATED SOAP REQUEST:

<?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>
             <ccPurchase xmlns="http://www.optimalpayments.com/creditcard/v1";>

                    <ns1:ccAuthRequestV1
xmlns:ns1="http://www.optimalpayments.com/creditcard/xmlschema/v1";>

                          <ns1:merchantAccount>

                                 <ns1:accountNum>89999340</ns1:accountNum>

                                 <ns1:storeID>test</ns1:storeID>

                                 <ns1:storePwd>test</ns1:storePwd>

                          </ns1:merchantAccount>

                          <ns1:merchantRefNum>987564</ns1:merchantRefNum>

                          <ns1:amount>10.00</ns1:amount>

                          <ns1:card>

                                 <ns1:cardNum>5442981111111023</ns1:cardNum>

                                 <ns1:cardExpiry>

                                        <ns1:month
xsi:type="xsd:int">12</ns1:month>

                                        <ns1:year
xsi:type="xsd:int">2010</ns1:year>

                                 </ns1:cardExpiry>

                          </ns1:card>

                          <ns1:billingDetails>

                                 <ns1:zip>49444</ns1:zip>

                          </ns1:billingDetails>

                    </ns1:ccAuthRequestV1>

             </ccPurchase>

      </soapenv:Body>

</soapenv:Envelope>


RESPONSE FROM 3rd PARTY WEB SERVICE:


<?xml version='1.0' encoding='UTF-8'?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
      <soap:Body>
             <ccPurchaseResponse
xmlns="http://www.optimalpayments.com/creditcard/v1";>
                    <ccTxnResponseV1
xmlns="http://www.optimalpayments.com/creditcard/xmlschema/v1";>
                          <confirmationNumber>244966178</confirmationNumber>
                          <decision>ERROR</decision>
                          <code>5023</code>
                          <actionCode>M</actionCode>
                          <description>You submitted an invalid XML
request. Please verify your request and retry the
transaction.</description>
                          <detail>
                                 <tag>InternalResponseCode</tag>
                                 <value>24</value>
                          </detail>
                          <detail>
                                 <tag>SubErrorCode</tag>
                                 <value>0</value>
                          </detail>
                          <detail>
                                 <tag>InternalResponseDescription</tag>
                                 <value>xml error</value>
                          </detail>
                          <detail>
                                 <tag>ErrorDetail</tag>
                                 <value>
                                        Errors:
                                        Node: ns1:month, Detail: Type
'[EMAIL PROTECTED]://www.w3.org/2001/XMLSchema' is not derived from
'E=month|[EMAIL PROTECTED]://www.optimalpayments.com/creditcard/xmlschema/v1'
in element [EMAIL PROTECTED]://www.optimalpayments.com/creditcard/xmlschema/v1
                                        Node: ns1:year, Detail: Type
'[EMAIL PROTECTED]://www.w3.org/2001/XMLSchema' is not derived from
'E=year|[EMAIL PROTECTED]://www.optimalpayments.com/creditcard/xmlschema/v1'
in element [EMAIL PROTECTED]://www.optimalpayments.com/creditcard/xmlschema/v1
                                 </value>
                          </detail>
                          <txnTime>2008-11-07T04:12:38.741-05:00</txnTime>
                          <duplicateFound>false</duplicateFound>
                    </ccTxnResponseV1>
             </ccPurchaseResponse>
      </soap:Body>
</soap:Envelope>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to