[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

HTTPAPI Related Problem



   First, let me say I'm new to using HTTPAPI and I have limited (but
   good) experience with using XML.  I know we do have HTTPAPI working in
   another application for communications with UPS, so the product
   (installed in 2008) is functioning well.



   I'm trying to communicate with a Webservice using HTTPAPI.  I can use
   the Webservice itself to communicate the XML data stream, but I can't
   seem to do it from an RPG program or from soapUI.



   If I plug this XML data (see below) into the Webservice at
   [1]https://shop.aafes.com/val/MilStarVendor.asmx?op=MSApproval  , it
   will come back with a valid response.



   <?xml version="1.0" encoding="utf-8" ?><MSApproval
   xmlns="MSApproval"><Request
   ID="XX000001"><CCNumber>1111222233334444</CCNumber><Amount>100</Amount
   >

   <FacNbr>99999999</FacNbr><Region>T</Region></Request></MSApproval>



   Response:

   <?xml version="1.0" encoding="utf-8" ?>
     <string xmlns="http://thor.aafes.com/val/MilStarVendor.asmx";><?xml
   version="1.0" encoding="utf-8"?><MSApproval><Request
   ID="99999999"><CCNumber>1111222233334444</CCNumber><Amount>000000100</
   Amount><FacNbr>99999999</FacNbr><Region>T</Region></Request><Response>
   <ReturnCode>X</ReturnCode><AuthCode></AuthCode><AuthTkt></AuthTkt><Ret
   urnMessage>Internal Error: Invalid Facility
   Number</ReturnMessage></Response></MSApproval></string>





   If I plug the same data (field WK_XML) into my RPG program using
   HTTPAPI:



   http_setCCSIDs(1208: 0);
   http_debug(*ON);
   RC = HTTP_URL_POST(
   'https://shop.aafes.com/val/MilStarVendor.asmx':
   %addr(WK_XML):%len(%trimr(WK_XML)):%trim(WK_FILE):30:'':'':
   'https://shop.aafes.com/val/MilStarVendor.asmx?op=MSApproval');



   It comes back with the following error in the httpapi_debug.txt file:



   SetError() #13: HTTP/1.1 500 Internal Server Error.

   recvdoc parms: identity 874

   header_load_cookies() entered

   recvdoc(): entered

   SetError() #0:

   <?xml version="1.0" encoding="utf-8"?>

   <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
   xmlns:xsd="http://www.w3.org/2001/XMLSchema";>

   <soap:Body>

   <soap:Fault>

   <faultcode>soap:Client</faultcode>

   <faultstring>System.Web.Services.Protocols.SoapException: Server did
   not recognize the value of HTTP Header SOAPAction:
   [2]https://thor.aafes.com/val/MilStarVendor.asmx?op=MSApproval.

   at
   System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest(
   )

   at System.Web.Services.Protocols.SoapServerProtocol.Initialize()

   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type
   type, HttpContext context, HttpRequest request, HttpResponse response,
   Boolean&amp; abortProcessing)</faultstring>

   <detail />

   </soap:Fault>

   </soap:Body>

   </soap:Envelope>

   SetError() #13: HTTP/1.1 500 Internal Server Error.

   http_close(): entered





   If I setup  [3]https://shop.aafes.com/val/MilStarVendor.asmx?wsdl  in
   soapUI 3.0.1 and plug in the same data:



   <soapenv:Envelope
   xmlns:soapenv="[4]http://schemas.xmlsoap.org/soap/envelope/";
   xmlns:mil="[5]http://thor.aafes.com/val/MilStarVendor.asmx";>
      <soapenv:Header/>
      <soapenv:Body>
         <mil:MSApproval>
            <!--Optional:-->
            <mil:inXMLApproval><?xml version="1.0" encoding="utf-8"
   ?><MSApproval xmlns="MSApproval"><Request
   ID="XX000001"><CCNumber>1111222233334444</CCNumber><Amount>100</Amount
   >
   <FacNbr>99999999</FacNbr><Region>T</Region></Request></MSApproval></mi
   l:inXMLApproval>
         </mil:MSApproval>
      </soapenv:Body>
   </soapenv:Envelope>



   It comes back with the following response:



   <soap:Envelope
   xmlns:soap="[6]http://schemas.xmlsoap.org/soap/envelope/";
   xmlns:xsi="[7]http://www.w3.org/2001/XMLSchema-instance";
   xmlns:xsd="[8]http://www.w3.org/2001/XMLSchema";>
      <soap:Body>
         <soap:Fault>
            <faultcode>soap:Client</faultcode>
            <faultstring>System.Web.Services.Protocols.SoapException:
   Server was unable to read request. --->
   System.InvalidOperationException: There is an error in XML document
   (6, 11). ---> System.Xml.XmlException: The XML declaration is
   unexpected. Line 6, position 31.
      at System.Xml.XmlTextReader.ParseTag()
      at System.Xml.XmlTextReader.ParseBeginTagExpandCharEntities()
      at System.Xml.XmlTextReader.Read()
      at System.Xml.XmlReader.ReadElementString()
      at
   Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.
   Read2_MSApproval()
      at
   Microsoft.Xml.Serialization.GeneratedAssembly.MSApprovalSerializer.Des
   erialize(XmlSerializationReader reader)
      at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader
   xmlReader, String encodingStyle, XmlDeserializationEvents events)
      --- End of inner exception stack trace ---
      at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader
   xmlReader, String encodingStyle, XmlDeserializationEvents events)
      at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader
   xmlReader, XmlDeserializationEvents events)
      at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader
   xmlReader)
      at
   System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
      --- End of inner exception stack trace ---
      at
   System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
      at System.Web.Services.Protocols.WebServiceHandler.Invoke()
      at
   System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()</
   faultstring>
            <detail/>
         </soap:Fault>
      </soap:Body>
   </soap:Envelope>



   Can anyone see the error of my ways?  Any help at all is much
   appreciated.





CONFIDENTIALITY NOTICE: This electronic message transmission contains informati
on from this organization,
which may be confidential or privileged. The information is intended for the so
le use of the individual or
entity named above. If you are not the intended recipient, be aware that any di
sclosure, copying, distribution,
or use of the contents of this information is prohibited. If you have received
this email in error, please
notify the sender immediately and delete the original message. Neither the send
er nor the company for which
he or she works accepts any liability for any damage caused by any virus transm
itted by this email.

References

   1. https://shop.aafes.com/val/MilStarVendor.asmx?op=MSApproval
   2. https://thor.aafes.com/val/MilStarVendor.asmx?op=MSApproval
   3. https://shop.aafes.com/val/MilStarVendor.asmx?wsdl
   4. http://schemas.xmlsoap.org/soap/envelope/
   5. http://thor.aafes.com/val/MilStarVendor.asmx
   6. http://schemas.xmlsoap.org/soap/envelope/
   7. http://www.w3.org/2001/XMLSchema-instance
   8. http://www.w3.org/2001/XMLSchema
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------