Question
Consuming a Webservice is extremly slow
Hi
I would like to use a Webservice to communicate with a server. For test purposes I wrote a small java webservice which adds to numbers using the following 2 classes.
== Class Calculator ==
package de.theserverside.webservice.service;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
@WebService
@SOAPBinding(style=Style.RPC)
public class Calculator
{
public long addValues(int val1, int val2) {
return val1 + val2;
}
}
== Class CalculatorServer ==
package de.theserverside.webservice.service;
import javax.xml.ws.Endpoint;
import de.theserverside.webservice.service.Calculator;
public class CalculatorServer {
public static void main (String args[]) {
Calculator server = new Calculator();
Endpoint endpoint =Endpoint.publish(" http://<IP Adresse>/calculator?wsdl", server);
}
}
In Coldfusion I tested both methods to consume this Webservice:
<cfinvoke webservice=" http://<IP Adresse>/calculator?wsdl" method="addValues" returnvariable="aString">
<cfinvokeargument name="arg0" value="1"/>
<cfinvokeargument name="arg1" value="6"/>
</cfinvoke>
<cfoutput>#aString#</cfoutput>
== mit cfskript ==
<cfscript>
ws = createObject("webservice"," http://<IP Adresse>/calculator?wsdl");
xlatstring = ws.addValues(2,9);
</cfscript>
<cfoutput>#xlatstring#</cfoutput>
The Webservice works with both methods but it takes between 5 and 6 Minutes to get a result.
I also wrote a java client to test the webservice which returned the result within 1 second.
Whats the problem here with CF?
I am using CF 8
I would like to use a Webservice to communicate with a server. For test purposes I wrote a small java webservice which adds to numbers using the following 2 classes.
== Class Calculator ==
package de.theserverside.webservice.service;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
@WebService
@SOAPBinding(style=Style.RPC)
public class Calculator
{
public long addValues(int val1, int val2) {
return val1 + val2;
}
}
== Class CalculatorServer ==
package de.theserverside.webservice.service;
import javax.xml.ws.Endpoint;
import de.theserverside.webservice.service.Calculator;
public class CalculatorServer {
public static void main (String args[]) {
Calculator server = new Calculator();
Endpoint endpoint =Endpoint.publish(" http://<IP Adresse>/calculator?wsdl", server);
}
}
In Coldfusion I tested both methods to consume this Webservice:
<cfinvoke webservice=" http://<IP Adresse>/calculator?wsdl" method="addValues" returnvariable="aString">
<cfinvokeargument name="arg0" value="1"/>
<cfinvokeargument name="arg1" value="6"/>
</cfinvoke>
<cfoutput>#aString#</cfoutput>
== mit cfskript ==
<cfscript>
ws = createObject("webservice"," http://<IP Adresse>/calculator?wsdl");
xlatstring = ws.addValues(2,9);
</cfscript>
<cfoutput>#xlatstring#</cfoutput>
The Webservice works with both methods but it takes between 5 and 6 Minutes to get a result.
I also wrote a java client to test the webservice which returned the result within 1 second.
Whats the problem here with CF?
I am using CF 8
