Hello,
I try to call a webservice with the signatur:
public int addzwo(int a, int b, int c);
and get the following exception,
java.lang.NumberFormatException: For input string: ""
I tried it with a webservice that accepts strings as Parameters
@WebMethod
| public String concat(String a, String b)
| { return a+b; }
This works.
If I look at the SOAP Call I can see, that the int Parameters are coded as href and then
referenced with a multiref Tag.
What do I have to tell the webservice (EJB3 style) that it unterstands this kind of int
parameters.
SOAP call
| <soapenv:Envelope
|
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
|
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
mlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
| <soapenv:Body>
| <ns1:addzwo
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://server/jaws">
| <int_1 href="#id0"/>
| <int_2 href="#id1"/>
| <int_3 href="#id2"/>
| </ns1:addzwo>
|
| <multiRef id="id2" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:int"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
| 4
| </multiRef>
| <multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:int"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
| 8
| </multiRef>
| <multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:int"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
| 2
| </multiRef></soapenv:Body></soapenv:Envelope>
WSDL
?
| <definitions name="SessionTestBeanService"
targetNamespace="http://server/jaws">
| <types/>
| ?
| <message name="SessionTestBean_getZaehlerResponse">
| <part name="result" type="xsd:int"/>
| </message>
| ?
| <message name="SessionTestBean_addzwo">
| <part name="int_1" type="xsd:int"/>
| <part name="int_2" type="xsd:int"/>
| <part name="int_3" type="xsd:int"/>
| </message>
| ?
| <message name="SessionTestBean_add">
| <part name="int_1" type="xsd:int"/>
| <part name="int_2" type="xsd:int"/>
| </message>
| <message name="SessionTestBean_getZaehler"/>
| ?
| <message name="SessionTestBean_addzwoResponse">
| <part name="result" type="xsd:int"/>
| </message>
| ?
| <message name="SessionTestBean_addResponse">
| <part name="result" type="xsd:int"/>
| </message>
| ?
| <portType name="SessionTestBean">
| ?
| <operation name="add" parameterOrder="int_1 int_2">
| <input message="tns:SessionTestBean_add"/>
| <output message="tns:SessionTestBean_addResponse"/>
| </operation>
| ?
| <operation name="addzwo" parameterOrder="int_1 int_2
int_3">
| <input message="tns:SessionTestBean_addzwo"/>
| <output message="tns:SessionTestBean_addzwoResponse"/>
| </operation>
| ?
| <operation name="getZaehler">
| <input message="tns:SessionTestBean_getZaehler"/>
| <output message="tns:SessionTestBean_getZaehlerResponse"/>
| </operation>
| </portType>
| ?
| <binding name="SessionTestBeanBinding"
type="tns:SessionTestBean">
| <soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
| ?
| <operation name="add">
| <soap:operation soapAction=""/>
| ?
| <input>
| <soap:body namespace="http://server/jaws" use="literal"/>
| </input>
| ?
| <output>
| <soap:body namespace="http://server/jaws" use="literal"/>
| </output>
| </operation>
| ?
| <operation name="addzwo">
| <soap:operation soapAction=""/>
| ?
| <input>
| <soap:body namespace="http://server/jaws" use="literal"/>
| </input>
| ?
| <output>
| <soap:body namespace="http://server/jaws" use="literal"/>
| </output>
| </operation>
| ?
| <operation name="getZaehler">
| <soap:operation soapAction=""/>
| ?
| <input>
| <soap:body namespace="http://server/jaws" use="literal"/>
| </input>
| ?
| <output>
| <soap:body namespace="http://server/jaws" use="literal"/>
| </output>
| </operation>
| </binding>
| ?
| <service name="SessionTestBeanService">
| ?
| <port binding="tns:SessionTestBeanBinding"
name="SessionTestBeanPort">
| <soap:address location="http://nbmicho:8080/beans/SessionTestBean"/>
| </port>
| </service>
| </definitions>
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985794#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...