当前位置:编程学习 > JAVA >>

java调用eclipse bpel组合的web服务??

我用eclipse bpel组合的两个可以用的web服务,形成一个新的web服务
部署在ODE之上后可以打开http://localhost:8080/ode/processes/show/showprocess?wsdl
但是在Java中调用
Client test=new Client(new URL("http://localhost:8080/ode/processes/show/showprocess?wsdl"));
Object[] result=test.invoke("process", new Integer[]{1,2,3});
System.out.println(result[0]); 
却出现

Exception in thread "main" org.codehaus.xfire.fault.XFireFault: axis2ns1:selectionFailure
at org.codehaus.xfire.fault.Soap11FaultSerializer.readMessage(Soap11FaultSerializer.java:31)
at org.codehaus.xfire.fault.SoapFaultSerializer.readMessage(SoapFaultSerializer.java:28)
at org.codehaus.xfire.soap.handler.ReadHeadersHandler.checkForFault(ReadHeadersHandler.java:111)
at org.codehaus.xfire.soap.handler.ReadHeadersHandler.invoke(ReadHeadersHandler.java:67)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.client.Client.onReceive(Client.java:406)
at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:139)
at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:79)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:114)
at org.codehaus.xfire.client.Client.invoke(Client.java:336)
at org.codehaus.xfire.client.Client.invoke(Client.java:368)
at com.tongji.xfire.main(xfire.java:35)

但是我测试是明明有方法


求大神指点!
--------------------编程问答-------------------- 你的wsdl是标准格式么?
如果不是标准格式的一样可以看到wsdl文件,但是xfire就认识不了 --------------------编程问答--------------------  <?xml version="1.0" encoding="UTF-8" ?> 
- <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl2="http://mulss" xmlns:wsdl1="http://subss" xmlns:ns1="http://subss" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:tns="http://eclipse.org/bpel/sample" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns0="http://addss" xmlns:vprop="http://docs.oasis-open.org/wsbpel/2.0/varprop" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://eclipse.org/bpel/sample">
- <wsdl:types>
- <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://addss" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://eclipse.org/bpel/sample">
- <element name="showprocessRequest">
- <complexType>
- <sequence>
  <element name="d1" type="double" /> 
  <element name="d2" type="double" /> 
  <element name="d3" type="double" /> 
  </sequence>
  </complexType>
  </element>
- <element name="showprocessResponse">
- <complexType>
- <sequence>
  <element name="result" type="double" /> 
  </sequence>
  </complexType>
  </element>
  </schema>
- <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:impl="http://addss" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:intf="http://addss" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://addss">
- <element name="add">
- <complexType>
- <sequence>
  <element name="a" type="xsd:double" /> 
  <element name="b" type="xsd:double" /> 
  </sequence>
  </complexType>
  </element>
- <element name="addResponse">
- <complexType>
- <sequence>
  <element name="addReturn" type="xsd:double" /> 
  </sequence>
  </complexType>
  </element>
  </schema>
- <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:impl="http://subss" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:intf="http://subss" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://subss">
- <element name="sub">
- <complexType>
- <sequence>
  <element name="a" type="xsd:double" /> 
  <element name="b" type="xsd:double" /> 
  </sequence>
  </complexType>
  </element>
- <element name="subResponse">
- <complexType>
- <sequence>
  <element name="subReturn" type="xsd:double" /> 
  </sequence>
  </complexType>
  </element>
  </schema>
  </wsdl:types>
- <wsdl:message name="showprocessRequestMessage">
  <wsdl:part name="payload" element="tns:showprocessRequest" /> 
  </wsdl:message>
- <wsdl:message name="showprocessResponseMessage">
  <wsdl:part name="payload" element="tns:showprocessResponse" /> 
  </wsdl:message>
- <wsdl:portType name="show/showprocessPortType">
- <wsdl:operation name="process">
  <wsdl:input message="tns:showprocessRequestMessage" wsaw:Action="http://eclipse.org/bpel/sample/process" /> 
  <wsdl:output message="tns:showprocessResponseMessage" wsaw:Action="http://eclipse.org/bpel/sample/showprocess/processResponse" /> 
  </wsdl:operation>
  </wsdl:portType>
- <wsdl:binding name="show/showprocessSOAP11Binding" type="tns:show/showprocessPortType">
  <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> 
- <wsdl:operation name="process">
  <soap:operation soapAction="http://eclipse.org/bpel/sample/process" style="document" /> 
- <wsdl:input>
  <soap:body use="literal" /> 
  </wsdl:input>
- <wsdl:output>
  <soap:body use="literal" /> 
  </wsdl:output>
  </wsdl:operation>
  </wsdl:binding>
- <wsdl:binding name="show/showprocessSOAP12Binding" type="tns:show/showprocessPortType">
  <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> 
- <wsdl:operation name="process">
  <soap12:operation soapAction="http://eclipse.org/bpel/sample/process" style="document" /> 
- <wsdl:input>
  <soap12:body use="literal" /> 
  </wsdl:input>
- <wsdl:output>
  <soap12:body use="literal" /> 
  </wsdl:output>
  </wsdl:operation>
  </wsdl:binding>
- <wsdl:binding name="show/showprocessHttpBinding" type="tns:show/showprocessPortType">
  <http:binding verb="POST" /> 
- <wsdl:operation name="process">
  <http:operation location="show/showprocess/process" /> 
- <wsdl:input>
  <mime:content type="text/xml" part="process" /> 
  </wsdl:input>
- <wsdl:output>
  <mime:content type="text/xml" part="process" /> 
  </wsdl:output>
  </wsdl:operation>
  </wsdl:binding>
- <wsdl:service name="show/showprocess">
- <wsdl:port name="show/showprocessSOAP11port_http" binding="tns:show/showprocessSOAP11Binding">
  <soap:address location="http://192.168.10.104:8089/ode/processes/show/showprocess" /> 
  </wsdl:port>
- <wsdl:port name="show/showprocessSOAP12port_http" binding="tns:show/showprocessSOAP12Binding">
  <soap12:address location="http://192.168.10.104:8089/ode/processes/show/showprocess" /> 
  </wsdl:port>
- <wsdl:port name="show/showprocessHttpport" binding="tns:show/showprocessHttpBinding">
  <http:address location="http://192.168.10.104:8089/ode/processes/show/showprocess" /> 
  </wsdl:port>
  </wsdl:service>
  </wsdl:definitions>
///////////////////////////////////////////
Test with Web Services Explorer测试服务能正常运行



望大神指点一下 
补充:Java ,  Eclipse
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,