我最近在学习oracle的bpel,使用jdeveloper直接创建一个同步的流程,即synchronous bpel process,然后调用,就会一直报axis的错误。
对应发布服务的wsdl为
<?xml version="1.0" encoding="UTF-8" ?>
- <definitions name="BPELProcess5" targetNamespace="http://xmlns.oracle.com" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:client="http://xmlns.oracle.com" xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/">
- <!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TYPE DEFINITION - List of services participating in this BPEL process
The default output of the BPEL designer uses strings as input and
output to the BPEL Process. But you can define or import any XML
Schema type and use them as part of the message types.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <types>
- <schema xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://xmlns.oracle.com" schemaLocation="BPELProcess5.xsd" />
</schema>
</types>
- <!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MESSAGE TYPE DEFINITION - Definition of the message types used as
part of the port type defintions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <message name="BPELProcess5RequestMessage">
<part name="payload" element="client:BPELProcess5ProcessRequest" />
</message>
- <message name="BPELProcess5ResponseMessage">
<part name="payload" element="client:BPELProcess5ProcessResponse" />
</message>
- <!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PORT TYPE DEFINITION - A port type groups a set of operations into
a logical service unit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <!-- portType implemented by the BPELProcess5 BPEL process
-->
- <portType name="BPELProcess5">
- <operation name="process">
<input message="client:BPELProcess5RequestMessage" />
<output message="client:BPELProcess5ResponseMessage" />
</operation>
</portType>
- <!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PARTNER LINK TYPE DEFINITION
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <plnk:partnerLinkType name="BPELProcess5">
- <plnk:role name="BPELProcess5Provider">
<plnk:portType name="client:BPELProcess5" />
</plnk:role>
</plnk:partnerLinkType>
</definitions>
BPEL源文件为
<?xml version = "1.0" encoding = "UTF-8" ?>
<!--
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Oracle JDeveloper BPEL Designer
Created: Wed Apr 14 05:29:18 GMT 2010
Author: 康超
Purpose: Synchronous BPEL Process
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-->
<process name="BPELProcess5" targetNamespace="http://xmlns.oracle.com"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:client="http://xmlns.oracle.com"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc">
<!--
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
PARTNERLINKS
List of services participating in this BPEL process
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-->
<partnerLinks>
<!--
The 'client' role represents the requester of this service. It is
used for callback. The location and correlation information associated
with the client role are automatically set using WS-Addressing.
-->
<partnerLink name="client" partnerLinkType="client:BPELProcess5"
myRole="BPELProcess5Provider"/>
</partnerLinks>
<!--
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VARIABLES
List of messages and XML documents used within this BPEL process
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-->
<variables>
<!-- Reference to the message passed as input during initiation -->
<variable name="inputVariable"
messageType="client:BPELProcess5RequestMessage"/>
<!-- Reference to the message that will be returned to the requester-->
<variable name="outputVariable"
messageType="client:BPELProcess5ResponseMessage"/>
</variables>
<!--
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ORCHESTRATION LOGIC
Set of activities coordinating the flow of messages across the
services integrated within this business process
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-->
<sequence name="main">
<!-- Receive input from requestor. (Note: This maps to operation defined in BPELProcess5.wsdl) -->
<receive name="receiveInput" partnerLink="client"
portType="client:BPELProcess5" operation="process"
variable="inputVariable" createInstance="yes"/>
<!-- Generate reply to synchronous request -->
<assign name="Assign_1">
<copy>
<from variable="inputVariable" part="payload"
query="/client:BPELProcess5ProcessRequest/client:input"/>
<to variable="outputVariable" part="payload"
query="/client:BPELProcess5ProcessResponse/client:result"/>
</copy>
</assign>
<reply name="replyOutput" partnerLink="client"
portType="client:BPELProcess5" operation="process"
variable="outputVariable"/>
</sequence>
</process>
对应的java代码为
package com.otn.samples;import javax.xml.namespace.QName;import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.description.OperationDesc;
import org.apache.axis.encoding.XMLType;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;public class Test { private static final Log log = LogFactory.getLog(Test.class); /**
* @param args
*/
public static void main(String[] args) {
String result = null;
// 调用webservice
try {
// URL
String url = "http://3xcvmvir9nbovr4:8888/orabpel/default/BPELProcess5/1.0"; Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress(new java.net.URL(url)); call.setOperationName(new QName("http://xmlns.oracle.com",
"process")); call.addParameter("payload", XMLType.XSD_STRING,
javax.xml.rpc.ParameterMode.IN); call.setUseSOAPAction(true); // SoapRpcMethod:Action
call
.setSOAPActionURI("http://3xcvmvir9nbovr4:8888/orabpel/default/BPELProcess5/1.0"); result = call.invoke(new Object[] { "asdf" }).toString(); } catch (Exception e) {
e.printStackTrace();
}
System.out.println(result); }}
请高手帮我弄弄啊。我觉得我快崩溃了。哎。
对应发布服务的wsdl为
<?xml version="1.0" encoding="UTF-8" ?>
- <definitions name="BPELProcess5" targetNamespace="http://xmlns.oracle.com" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:client="http://xmlns.oracle.com" xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/">
- <!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TYPE DEFINITION - List of services participating in this BPEL process
The default output of the BPEL designer uses strings as input and
output to the BPEL Process. But you can define or import any XML
Schema type and use them as part of the message types.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <types>
- <schema xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://xmlns.oracle.com" schemaLocation="BPELProcess5.xsd" />
</schema>
</types>
- <!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MESSAGE TYPE DEFINITION - Definition of the message types used as
part of the port type defintions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <message name="BPELProcess5RequestMessage">
<part name="payload" element="client:BPELProcess5ProcessRequest" />
</message>
- <message name="BPELProcess5ResponseMessage">
<part name="payload" element="client:BPELProcess5ProcessResponse" />
</message>
- <!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PORT TYPE DEFINITION - A port type groups a set of operations into
a logical service unit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <!-- portType implemented by the BPELProcess5 BPEL process
-->
- <portType name="BPELProcess5">
- <operation name="process">
<input message="client:BPELProcess5RequestMessage" />
<output message="client:BPELProcess5ResponseMessage" />
</operation>
</portType>
- <!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PARTNER LINK TYPE DEFINITION
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <plnk:partnerLinkType name="BPELProcess5">
- <plnk:role name="BPELProcess5Provider">
<plnk:portType name="client:BPELProcess5" />
</plnk:role>
</plnk:partnerLinkType>
</definitions>
BPEL源文件为
<?xml version = "1.0" encoding = "UTF-8" ?>
<!--
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Oracle JDeveloper BPEL Designer
Created: Wed Apr 14 05:29:18 GMT 2010
Author: 康超
Purpose: Synchronous BPEL Process
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-->
<process name="BPELProcess5" targetNamespace="http://xmlns.oracle.com"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:client="http://xmlns.oracle.com"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc">
<!--
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
PARTNERLINKS
List of services participating in this BPEL process
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-->
<partnerLinks>
<!--
The 'client' role represents the requester of this service. It is
used for callback. The location and correlation information associated
with the client role are automatically set using WS-Addressing.
-->
<partnerLink name="client" partnerLinkType="client:BPELProcess5"
myRole="BPELProcess5Provider"/>
</partnerLinks>
<!--
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VARIABLES
List of messages and XML documents used within this BPEL process
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-->
<variables>
<!-- Reference to the message passed as input during initiation -->
<variable name="inputVariable"
messageType="client:BPELProcess5RequestMessage"/>
<!-- Reference to the message that will be returned to the requester-->
<variable name="outputVariable"
messageType="client:BPELProcess5ResponseMessage"/>
</variables>
<!--
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ORCHESTRATION LOGIC
Set of activities coordinating the flow of messages across the
services integrated within this business process
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-->
<sequence name="main">
<!-- Receive input from requestor. (Note: This maps to operation defined in BPELProcess5.wsdl) -->
<receive name="receiveInput" partnerLink="client"
portType="client:BPELProcess5" operation="process"
variable="inputVariable" createInstance="yes"/>
<!-- Generate reply to synchronous request -->
<assign name="Assign_1">
<copy>
<from variable="inputVariable" part="payload"
query="/client:BPELProcess5ProcessRequest/client:input"/>
<to variable="outputVariable" part="payload"
query="/client:BPELProcess5ProcessResponse/client:result"/>
</copy>
</assign>
<reply name="replyOutput" partnerLink="client"
portType="client:BPELProcess5" operation="process"
variable="outputVariable"/>
</sequence>
</process>
对应的java代码为
package com.otn.samples;import javax.xml.namespace.QName;import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.description.OperationDesc;
import org.apache.axis.encoding.XMLType;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;public class Test { private static final Log log = LogFactory.getLog(Test.class); /**
* @param args
*/
public static void main(String[] args) {
String result = null;
// 调用webservice
try {
// URL
String url = "http://3xcvmvir9nbovr4:8888/orabpel/default/BPELProcess5/1.0"; Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress(new java.net.URL(url)); call.setOperationName(new QName("http://xmlns.oracle.com",
"process")); call.addParameter("payload", XMLType.XSD_STRING,
javax.xml.rpc.ParameterMode.IN); call.setUseSOAPAction(true); // SoapRpcMethod:Action
call
.setSOAPActionURI("http://3xcvmvir9nbovr4:8888/orabpel/default/BPELProcess5/1.0"); result = call.invoke(new Object[] { "asdf" }).toString(); } catch (Exception e) {
e.printStackTrace();
}
System.out.println(result); }}
请高手帮我弄弄啊。我觉得我快崩溃了。哎。
解决方案 »
- drools规则引擎问题
- 谁能帮我看看,哪错了
- JAVA面试题:把一串数字从中间怎么切成两段?
- JSP+XML分页技术
- spring + hiberate 框架下如何配置多个数据库连接
- war和ejb-jar里面的class重复了的问题
- 求Set(HashSet,TreeSet)/List/Map(HashMap,TreeMap)/Bag/idbag之间区别与好处缺点
- 是使用一个dispatchAction还是使用几个action?
- 谁有Weblogic8.1的解密文件?
- 求指教ChannelSftp.cd() 问题
- SSH——opengSesion()和getCurrentSession()有什么区别?
- java 用jni 调用 c++ 接口 急需解决 谢谢!
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
faultSubcode:
faultString: java.lang.NullPointerException
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.lang.NullPointerException
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.otn.samples.Test.main(Test.java:44) {http://xml.apache.org/axis/}hostname:康超-幻想之城java.lang.NullPointerException
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.otn.samples.Test.main(Test.java:44)
jdk7就会出现这样的情况,试试吧
如果用过active bpel请跟我联系
[email protected]