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

Re: Consume WCF web service with .svc extension



   The extension doesn't matter...it's a standard SOAP web service
   �(though there is a REST version also)
   Sending it an XML like so:
   <soapenv:Envelope
   xmlns:soapenv="[1]http://schemas.xmlsoap.org/soap/envelope/";
   xmlns:ns="[2]http://www.restfulwebservices.net/ServiceContracts/2008/01
   ">
   � �<soapenv:Header/>
   � �<soapenv:Body>
   � � � <ns:GetConversionRate>
   � � � � �<ns:FromCurrency>USD</ns:FromCurrency>
   � � � � �<ns:ToCurrency>EUR</ns:ToCurrency>
   � � � </ns:GetConversionRate>
   � �</soapenv:Body>
   </soapenv:Envelope>
   Gets a response back of:
   <s:Envelope xmlns:s="[3]http://schemas.xmlsoap.org/soap/envelope/";>
   � �<s:Body>
   � � � <GetConversionRateResponse
   xmlns="[4]http://www.restfulwebservices.net/ServiceContracts/2008/01";>
   � � � � �<GetConversionRateResult
   xmlns:a="[5]http://www.restfulwebservices.net/DataContracts/2008/01";
   xmlns:i="[6]http://www.w3.org/2001/XMLSchema-instance";>
   � � � � � � <a:FromCurrency>USD</a:FromCurrency>
   � � � � � � <a:ToCurrency>EUR</a:ToCurrency>
   � � � � � � <a:Rate>0.7577</a:Rate>
   � � � � �</GetConversionRateResult>
   � � � </GetConversionRateResponse>
   � �</s:Body>
   </s:Envelope>
   Scott's presentation on consuming Web services is a good place to start
   [7]http://www.scottklement.com/presentations/#HTTPAPI
   Otherwise, turn on HTTP debuging
   callp http_debug(*ON);
   And post the resulting log
   /tmp/httpapi_debug.txt
   Charles

   On Wed, Aug 27, 2014 at 12:58 PM, Nikhil Rustagi
   <[8]nik.rust@xxxxxxxxx> wrote:

     � �Hi,
     � �I have been trying to consume a wcf service using HTTPAPI, but
     have
     � �been consistently getting error code 400 'Bad Request'. Is �     there any
     � �example which I can use to consume a wcf service. The current
     examples
     � �all use .asmx services.�     � �I tried with the below service:
     � �[1][9]http://www.restfulwebservices.net/wcf/CurrencyService.svc
     � �Nikhil
     References
     � �1.
     [10]http://www.restfulwebservices.net/wcf/CurrencyService.svc?wsdl
     --------------------------------------------------------------------
     ---
     This is the FTPAPI mailing list.� To unsubscribe, please go to:
     [11]http://www.scottklement.com/mailman/listinfo/ftpapi
     --------------------------------------------------------------------
     ---

References

   1. http://schemas.xmlsoap.org/soap/envelope/
   2. http://www.restfulwebservices.net/ServiceContracts/2008/01
   3. http://schemas.xmlsoap.org/soap/envelope/
   4. http://www.restfulwebservices.net/ServiceContracts/2008/01
   5. http://www.restfulwebservices.net/DataContracts/2008/01
   6. http://www.w3.org/2001/XMLSchema-instance
   7. http://www.scottklement.com/presentations/#HTTPAPI
   8. mailto:nik.rust@xxxxxxxxx
   9. http://www.restfulwebservices.net/wcf/CurrencyService.svc
  10. http://www.restfulwebservices.net/wcf/CurrencyService.svc?wsdl
  11. http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------