WEB SERVICES Integration WITH JBPM(need help)
marcoferraz May 11, 2006 1:29 PMhi!
I am trying to start a process from a web service cliente...
On this moment i have:
A Web Service that is the main page form JBPM Portal:
where is the WSDL:
< ?xml version="1.0" encoding="UTF-8" ?>
- < wsdl:definitions targetNamespace="http://localhost:8888/axis/login_jsp.jws" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://localhost:8888/axis/login_jsp.jws" xmlns:intf="http://localhost:8888/axis/login_jsp.jws" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="http://http.servlet.javax" xmlns:tns2="http://servlet.javax" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <!--
WSDL created by Apache Axis version: 1.3
Built on Oct 05, 2005 (05:23:37 EDT)
-->
- < wsdl:types>
- < schema targetNamespace="http://localhost:8888/axis/login_jsp.jws" xmlns="http://www.w3.org/2001/XMLSchema">
< import namespace="http://xml.apache.org/xml-soap" />
< import namespace="http://servlet.javax" />
< import namespace="http://http.servlet.javax" />
< import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
- < complexType name="ArrayOf_xsd_anyType">
- < complexContent>
- < restriction base="soapenc:Array">
< attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:anyType[]" />
< /restriction>
< /complexContent>
< /complexType>
< /schema>
- < schema targetNamespace="http://xml.apache.org/xml-soap" xmlns="http://www.w3.org/2001/XMLSchema">
< import namespace="http://localhost:8888/axis/login_jsp.jws" />
< import namespace="http://servlet.javax" />
< import namespace="http://http.servlet.javax" />
< import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
- < complexType name="Vector">
- < sequence>
< element maxOccurs="unbounded" minOccurs="0" name="item" type="xsd:anyType" />
< /sequence>
< /complexType>
< /schema>
< /wsdl:types>
- < wsdl:message name="getServletInfoResponse">
< wsdl:part name="getServletInfoReturn" type="xsd:string" />
< /wsdl:message>
- < wsdl:message name="initRequest">
<wsdl:part name="config" type="xsd:anyType" />
</wsdl:message>
- <wsdl:message name="serviceRequest">
<wsdl:part name="request" type="tns1:HttpServletRequest" />
<wsdl:part name="response" type="tns1:HttpServletResponse" />
</wsdl:message>
<wsdl:message name="_jspInitRequest" />
<wsdl:message name="_jspDestroyResponse" />
<wsdl:message name="jspDestroyResponse" />
<wsdl:message name="initResponse" />
<wsdl:message name="jspInitResponse" />
<wsdl:message name="jspInitRequest" />
- <wsdl:message name="getDependantsResponse">
<wsdl:part name="getDependantsReturn" type="impl:ArrayOf_xsd_anyType" />
</wsdl:message>
<wsdl:message name="destroyRequest" />
<wsdl:message name="_jspDestroyRequest" />
<wsdl:message name="_jspInitResponse" />
<wsdl:message name="jspDestroyRequest" />
<wsdl:message name="getServletInfoRequest" />
- <wsdl:message name="_jspServiceRequest">
<wsdl:part name="request" type="xsd:anyType" />
<wsdl:part name="response" type="xsd:anyType" />
</wsdl:message>
<wsdl:message name="destroyResponse" />
<wsdl:message name="_jspServiceResponse" />
<wsdl:message name="getDependantsRequest" />
<wsdl:message name="serviceResponse" />
- <wsdl:portType name="login_jsp">
- <wsdl:operation name="_jspDestroy">
<wsdl:input message="impl:_jspDestroyRequest" name="_jspDestroyRequest" />
<wsdl:output message="impl:_jspDestroyResponse" name="_jspDestroyResponse" />
</wsdl:operation>
- <wsdl:operation name="_jspInit">
<wsdl:input message="impl:_jspInitRequest" name="_jspInitRequest" />
<wsdl:output message="impl:_jspInitResponse" name="_jspInitResponse" />
</wsdl:operation>
- <wsdl:operation name="_jspService" parameterOrder="request response">
<wsdl:input message="impl:_jspServiceRequest" name="_jspServiceRequest" />
<wsdl:output message="impl:_jspServiceResponse" name="_jspServiceResponse" />
</wsdl:operation>
- <wsdl:operation name="getDependants">
<wsdl:input message="impl:getDependantsRequest" name="getDependantsRequest" />
<wsdl:output message="impl:getDependantsResponse" name="getDependantsResponse" />
</wsdl:operation>
- <wsdl:operation name="init" parameterOrder="config">
<wsdl:input message="impl:initRequest" name="initRequest" />
<wsdl:output message="impl:initResponse" name="initResponse" />
</wsdl:operation>
- <wsdl:operation name="destroy">
<wsdl:input message="impl:destroyRequest" name="destroyRequest" />
<wsdl:output message="impl:destroyResponse" name="destroyResponse" />
</wsdl:operation>
- <wsdl:operation name="service" parameterOrder="request response">
<wsdl:input message="impl:serviceRequest" name="serviceRequest" />
<wsdl:output message="impl:serviceResponse" name="serviceResponse" />
</wsdl:operation>
- <wsdl:operation name="getServletInfo">
<wsdl:input message="impl:getServletInfoRequest" name="getServletInfoRequest" />
<wsdl:output message="impl:getServletInfoResponse" name="getServletInfoResponse" />
</wsdl:operation>
- <wsdl:operation name="jspInit">
<wsdl:input message="impl:jspInitRequest" name="jspInitRequest" />
<wsdl:output message="impl:jspInitResponse" name="jspInitResponse" />
</wsdl:operation>
- <wsdl:operation name="jspDestroy">
<wsdl:input message="impl:jspDestroyRequest" name="jspDestroyRequest" />
<wsdl:output message="impl:jspDestroyResponse" name="jspDestroyResponse" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="login_jspSoapBinding" type="impl:login_jsp">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="_jspDestroy">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="_jspDestroyRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" use="encoded" />
</wsdl:input>
- <wsdl:output name="_jspDestroyResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8888/axis/login_jsp.jws" use="encoded" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="_jspInit">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="_jspInitRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" use="encoded" />
</wsdl:input>
- <wsdl:output name="_jspInitResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8888/axis/login_jsp.jws" use="encoded" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="_jspService">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="_jspServiceRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" use="encoded" />
</wsdl:input>
- <wsdl:output name="_jspServiceResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8888/axis/login_jsp.jws" use="encoded" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="getDependants">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="getDependantsRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" use="encoded" />
</wsdl:input>
- <wsdl:output name="getDependantsResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8888/axis/login_jsp.jws" use="encoded" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="init">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="initRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://runtime.jasper.apache.org" use="encoded" />
</wsdl:input>
- <wsdl:output name="initResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8888/axis/login_jsp.jws" use="encoded" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="destroy">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="destroyRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://runtime.jasper.apache.org" use="encoded" />
</wsdl:input>
- <wsdl:output name="destroyResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8888/axis/login_jsp.jws" use="encoded" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="service">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="serviceRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://runtime.jasper.apache.org" use="encoded" />
</wsdl:input>
- <wsdl:output name="serviceResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8888/axis/login_jsp.jws" use="encoded" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="getServletInfo">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="getServletInfoRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://runtime.jasper.apache.org" use="encoded" />
</wsdl:input>
- <wsdl:output name="getServletInfoResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8888/axis/login_jsp.jws" use="encoded" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="jspInit">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="jspInitRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://runtime.jasper.apache.org" use="encoded" />
</wsdl:input>
- <wsdl:output name="jspInitResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8888/axis/login_jsp.jws" use="encoded" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="jspDestroy">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="jspDestroyRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://runtime.jasper.apache.org" use="encoded" />
</wsdl:input>
- <wsdl:output name="jspDestroyResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8888/axis/login_jsp.jws" use="encoded" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="login_jspService">
- <wsdl:port binding="impl:login_jspSoapBinding" name="login_jsp">
<wsdlsoap:address location="http://localhost:8888/axis/login_jsp.jws" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
AND HERE I HAVE THE CLIENT:
< % // includes necessários para ligar a um web service em AXIS %>
< %@ page import="org.apache.axis.client.Call" %>
< %@ page import="org.apache.axis.client.Service" %>
< %@ page import="org.apache.axis.encoding.XMLType" %>
< %@ page import="javax.xml.rpc.ParameterMode" %>
< !DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
< html>
< head>
< /head>
< body>
< %
String configg="";
String endpoint = "http://localhost:8080/axis/login_jsp.jws";
//instânciar axis e call
Service service = new Service();
Call call = (Call) service.createCall();
//url de ligação
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
//nome do método a chamar
call.setOperationName( "init" );
//definir nomes do parametros a enviar
configg="2";
call.addParameter( "configg", XMLType.XSD_ANY, ParameterMode.IN );
//definir o tipo de retorno
call.setReturnType(XMLType.XSD_ANYTYPE);
//invocar o web service e imprimir o resultado na pagina
String ret[] = (String[]) call.invoke( new Object [] { "configg"});
out.println("Resultado: "+ret);
%>
< /body>
< /html>
THE PROBLEM IS..
when i start the client....
An error appears:
java.net.ConnectException: Connection refused: connect
org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
org.apache.axis.client.Call.invokeEngine(Call.java:2784)
org.apache.axis.client.Call.invoke(Call.java:2767)
org.apache.axis.client.Call.invoke(Call.java:2443)
org.apache.axis.client.Call.invoke(Call.java:2366)
org.apache.axis.client.Call.invoke(Call.java:1812)
org.apache.jsp.Webservices_005fteste.cliente2_jsp._jspService(cliente2_jsp.java:84)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
PLEASE, HELP is NEEDEd.. i truly don´t see where it is the error!!
SUGESTIONS needed=)!
waiting for reply..(if anyone now other way of make my invocation from a web service to start a process it's also good)
thanks,
marco