Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7560413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:53:47+00:00 2026-05-30T12:53:47+00:00

I am trying to send a soap request to an open webservice (webserviceX.NET currency

  • 0

I am trying to send a soap request to an open webservice (webserviceX.NET currency converter). Here is my code:

String SOAP_REQUEST = "<SOAP:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:SOAP=\"http://schemas.xmlsoap.org/soap/envelope/\"><SOAP:Body><ConversionRate xmlns=\"http://www.webserviceX.NET/\"/>" +
        "<FromCurrency>EUR</FromCurrency><ToCurrency>ILS</ToCurrency></SOAP:Body></SOAP:Envelope>";



//  SOAPEnvelope env = new SOAPEnvelope();
//Create a Stream Source of the Request String
  byte[] reqBytes = SOAP_REQUEST.getBytes();
  ByteArrayInputStream bis = new ByteArrayInputStream(reqBytes);
  StreamSource ss = new StreamSource(bis);

  //Create a SOAP Message Object
  MessageFactoryImpl messageFactory = new MessageFactoryImpl();
  SOAPMessage msg = messageFactory.createMessage();
  SOAPPart soapPart = msg.getSOAPPart();

  //Set the soapPart Content with the stream source
  soapPart.setContent(ss);

  //Create a WebService Call
  Service service = new Service();
  Call call = (Call)service.createCall();
  call.setTargetEndpointAddress(new java.net.URL(endpoint));
  call.setProperty( Call.SOAPACTION_USE_PROPERTY, new Boolean( true ) );
  call.setProperty( Call.SOAPACTION_URI_PROPERTY, "http://www.webserviceX.NET/ConversionRate");
  call.setEncodingStyle("utf-8");

  //Invoke the WebService.
  SOAPEnvelope resp = call.invoke(((org.apache.axis.SOAPPart)soapPart).getAsSOAPEnvelope());
 ...
//then i parse the resulting SOAPEnvelope get the value.

here in this url, you can see the nature of the soap request and response when interacting with this webservice..
http://www.webservicex.net/CurrencyConvertor.asmx?op=ConversionRate

my java code above, get the right and exact soap response specified in the URL I provided and expected.. but always with the value I need as 0.
This is the soap response I get:

<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><ConversionRateResponse 
xmlns="http://www.webserviceX.NET/">
<ConversionRateResult>0</ConversionRateResult></ConversionRateResponse>
</soap:Body></soap:Envelope>

You can see the CoversionRateResult as 0, although it should return 4.69. I tried another webservice they provide and I get aways such result.

Can someone please help me by looking what could be missing in my java code? I tried different variations and keep playing around since a day 🙁 .. and nothing.
I would really appreciate anyone help me in this.
Thank you,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T12:53:48+00:00Added an answer on May 30, 2026 at 12:53 pm

    The correct string passed in my above example, which worked is:

    String SOAP_REQUEST = 
    "<soapenv:Envelope 
         xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"
         xmlns:web=\"http://www.webserviceX.NET/\">
     <soapenv:Header/>
     <soapenv:Body>
     <web:ConversionRate>
     <web:FromCurrency>EUR</web:FromCurrency>
     <web:ToCurrency>ILS</web:ToCurrency>
     </web:ConversionRate>
     </soapenv:Body></soapenv:Envelope>"
    

    Just in case anyone encountered this issue.. my reputation does not allow me to mark it as correct.
    And many thanks to mcfinnigan for helping me out..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to dynamically send a SOAP request to different webservices. Each webservice has
Hello I am trying to do a SOAP request here is my code: #
I'm trying to send a SOAP request using SOAPpy as the client. I've found
I'm trying to send a SOAP request but I receive an error telling me
I am trying to compose a SOAP message(including header) in C# .NET to send
Here's the scenario: I'm trying to send a SOAP message to an intermediary router
I am trying to send a SOAP request from a xml file and send
I'm tired of trying to send a request with SOAP. this is my xml
I am trying to send a soap request to a remote server and getting
I am trying to send a request to server with my soap request and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.