Note that there are some explanatory texts on larger screens.

plurals
  1. POSOAP request modification
    primarykey
    data
    text
    <p>I have a SOAP request like this, it's working fine:</p> <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://com/"&gt; &lt;soapenv:Header/&gt; &lt;soapenv:Body&gt; &lt;web:ConversionRate&gt; &lt;!--Optional:--&gt; &lt;FromCurrency&gt;?&lt;/FromCurrency&gt; &lt;!--Optional:--&gt; &lt;ToCurrency&gt;?&lt;/ToCurrency&gt; &lt;/web:ConversionRate&gt; &lt;/soapenv:Body&gt; &lt;/soapenv:Envelope&gt; </code></pre> <p>I was changing the request a litle bit to understand the concepts:</p> <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" &gt; &lt;soapenv:Header/&gt; &lt;soapenv:Body&gt; &lt;ConversionRate xmlns="http://com/"&gt;&gt; &lt;!--Optional:--&gt; &lt;FromCurrency&gt;?&lt;/FromCurrency&gt; &lt;!--Optional:--&gt; &lt;ToCurrency&gt;?&lt;/ToCurrency&gt; &lt;/ConversionRate&gt; &lt;/soapenv:Body&gt; &lt;/soapenv:Envelope&gt; </code></pre> <p>The second one is not working, throwing a wrong answer.</p> <p>My service class is</p> <pre><code>package com; import javax.jws.WebService; import javax.jws.WebMethod; import javax.jws.WebParam; @WebService (targetNamespace="http://com/") public class CurrencyConvertor { public String ConversionRate (@WebParam(name = "FromCurrency") String FromCurrency, @WebParam(name = "ToCurrency") String ToCurrency) { System.out.println("ST\n" + FromCurrency + "\n" + ToCurrency + "\nEnd" ); switch(FromCurrency+","+ToCurrency) { case "USD,INR": return "58"; case "INR,USD": return "0.017"; default: return "XXX"; } } } </code></pre> <p>The second request always falling to default case, the thing is, the values are sending as null since I changed the name space. So my Web service should answer for the second request properly, what should cause the issue, how to rectify this.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload