[JBoss jBPM] - Re: How can I assign attribute of the complex object?
by pkovgan
Ok ,
I'll try to give concrete example:
I failed on last assign in BPEL description below.
Actually I did not fail(no errors), but I do know that last invoke was not completed. Probably because last assign is wrong.
My process should connect to WS called Customer and retrieve Complex object as response:
My bpel is:
| <?xml version="1.0" encoding="UTF-8"?>
| <process name="salesOrderCreationBusinessProcess" targetNamespace="http://xtp.sap.com/bp/salesOrderCreation" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:tns="http://xtp.sap.com/bp/salesOrderCreation" xmlns:bpel="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:impl1="http://com.sap.xtp/services/Salesorder" xmlns:impl2="http://com.sap.xtp/services/Item" xmlns:impl0="http://com.sap.xtp/services/Customer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.xmlsoap.org/ws/2003/03/business-process/
| http://schemas.xmlsoap.org/ws/2003/03/business-process/">
| <partnerLinks>
| <partnerLink name="salesOrderCreationcaller" partnerLinkType="tns:salesOrderCreationLinkType" myRole="SalesOrderCreationConsumer"/>
| <partnerLink name="Customer" partnerLinkType="tns:CustomerLinkType" partnerRole="ICustomerService"/>
| <partnerLink name="Item" partnerLinkType="tns:ItemLinkType" partnerRole="IItemService"/>
| <partnerLink name="Salesorder" partnerLinkType="tns:SalesorderLinkType" partnerRole="ISalesorderService"/>
| </partnerLinks>
| <!--Variables of BP-->
| <variables>
| <variable name="_var0" messageType="tns:startCreateOrderMessage"/>
| <variable name="_var1" messageType="impl0:ICustomerService_DiscoveryService_findCustomer"/>
| <variable name="_var2" messageType="impl0:ICustomerService_DiscoveryService_findCustomerResponse"/>
| <variable name="_var3" messageType="impl2:IItemService_DiscoveryService_findItem"/>
| <variable name="_var4" messageType="impl2:IItemService_DiscoveryService_findItemResponse"/>
| <variable name="_var5" messageType="impl1:ISalesorderService_CreationService_createOrder"/>
| <variable name="_var6" messageType="impl1:ISalesorderService_CreationService_createOrderResponse"/>
| </variables>
| <sequence>
| <!-- receive the name of a person -->
| <receive operation="startCreateOrder" partnerLink="salesOrderCreationcaller" portType="tns:SalesOrderCreationConsumer" variable="_var0" createInstance="yes"/>
| <assign>
| <copy>
| <from variable="_var0" part="customerName"/>
| <to variable="_var1" part="customerName"/>
| </copy>
| </assign>
| <invoke name="DiscoveryService_findCustomer" operation="DiscoveryService_findCustomer" partnerLink="Customer" portType="impl0:ICustomerService" inputVariable="_var1" outputVariable="_var2">
| </invoke>
| <assign>
| <copy>
| <from variable="_var0" part="itemName"/>
| <to variable="_var3" part="itemName"/>
| </copy>
| </assign>
| <invoke name="DiscoveryService_findItem" operation="DiscoveryService_findItem" partnerLink="Item" portType="impl2:IItemService" inputVariable="_var3" outputVariable="_var4">
| </invoke>
| <assign>
| <copy>
| <from variable="_var2" part="return" query="/return/id"/>
| <to variable="_var5" part="customerId"/>
| </copy>
| <copy>
| <from variable="_var4" part="return" query="/return/id"/>
| <to variable="_var5" part="itemId"/>
| </copy>
| </assign>
| <invoke name="CreationService_createOrder" operation="CreationService_createOrder" partnerLink="Salesorder" portType="impl1:ISalesorderService" inputVariable="_var5" outputVariable="_var6">
| </invoke>
| </sequence>
| </process>
|
|
|
As you noticed last assign takes variable _var2 from call to WS,
WSDL of this WS below:
| <definitions name='CustomerService' targetNamespace='http://com.sap.xtp/services/Customer' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://com.sap.xtp/services/Customer' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
| <types>
| <schema elementFormDefault='qualified' targetNamespace='http://com.sap.xtp/services/Customer' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://com.sap.xtp/services/Customer' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
| <complexType name='ResultCustomer_DiscoveryService_findCustomer'>
| <sequence>
| <element name='id' type='int'/>
| </sequence>
| </complexType>
| <complexType name='ResultCustomer_s2_o1'>
|
| <sequence>
| <element name='p1' nillable='true' type='string'/>
| <element name='p2' nillable='true' type='string'/>
| </sequence>
| </complexType>
| </schema>
| </types>
| <message name='ICustomerService_DiscoveryService_findCustomer'>
| <part name='customerName' type='xsd:string'/>
|
| </message>
| <message name='ICustomerService_s2_o1Response'>
| <part name='return' type='tns:ResultCustomer_s2_o1'/>
| </message>
| <message name='ICustomerService_s2_o1'>
| <part name='p1' type='xsd:string'/>
| <part name='p2' type='xsd:string'/>
| </message>
| <message name='ICustomerService_DiscoveryService_findCustomerResponse'>
|
| <part name='return' type='tns:ResultCustomer_DiscoveryService_findCustomer'/>
| </message>
| <portType name='ICustomerService'>
| <operation name='DiscoveryService_findCustomer' parameterOrder='customerName'>
| <input message='tns:ICustomerService_DiscoveryService_findCustomer'/>
| <output message='tns:ICustomerService_DiscoveryService_findCustomerResponse'/>
| </operation>
| <operation name='s2_o1' parameterOrder='p1 p2'>
| <input message='tns:ICustomerService_s2_o1'/>
|
| <output message='tns:ICustomerService_s2_o1Response'/>
| </operation>
| </portType>
| <binding name='ICustomerServiceBinding' type='tns:ICustomerService'>
| <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
| <operation name='DiscoveryService_findCustomer'>
| <soap:operation soapAction=''/>
| <input>
| <soap:body namespace='http://com.sap.xtp/services/Customer' use='literal'/>
|
| </input>
| <output>
| <soap:body namespace='http://com.sap.xtp/services/Customer' use='literal'/>
| </output>
| </operation>
| <operation name='s2_o1'>
| <soap:operation soapAction=''/>
| <input>
| <soap:body namespace='http://com.sap.xtp/services/Customer' use='literal'/>
|
| </input>
| <output>
| <soap:body namespace='http://com.sap.xtp/services/Customer' use='literal'/>
| </output>
| </operation>
| </binding>
| <service name='CustomerService'>
| <port binding='tns:ICustomerServiceBinding' name='ICustomerServicePort'>
| <soap:address location='http://TLVD60155051A:8080/quickstart/Customer'/>
|
| </port>
| </service>
| </definitions>
|
|
|
Could you help me?
What's wrong in my variable/part/query?What is wrong in WSDL?
Please, help.
Thanks in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992705#3992705
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992705
19 years, 4 months
[EJB 3.0] - Re: java.lang.ClassCastException: $Proxy79 getting conext
by helloween0809
I met the same problem.
and the same code runs correctly in a java eclipse.
============= the code ===================
public class MainFrame {
public static void main(String[] args) throws Exception {
Properties props = new Properties();
props.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
props.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
props.setProperty("java.naming.provider.url", "localhost:1099");
InitialContext initCtx = new InitialContext(props);
Rankgrade rankgrade = (Rankgrade)initCtx.lookup("RankgradeBean/remote");
}
}
=========== the excepiton ====================
16:16:28,064 WARN [RequestProcessor] Unhandled Exception thrown: class java.lang.ClassCastException
16:16:28,064 ERROR [[action]] Servlet.service() for servlet action threw exception
java.lang.ClassCastException: $Proxy100
at com.ufmobile.mstreet.rank.action.RankGradeAction.execute(RankGradeAction.java:57)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
========= the JNDI ===================
+- StreetBean (class: org.jnp.interfaces.NamingContext)
| +- local (proxy: $Proxy92 implements interface com.ufmobile.mstreet.street.bo.Street,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
| +- remote (proxy: $Proxy91 implements interface com.ufmobile.mstreet.street.bo.Street,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)
+- RankplaceBean (class: org.jnp.interfaces.NamingContext)
| +- local (proxy: $Proxy75 implements interface com.ufmobile.mstreet.rank.bo.Rankplace,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
| +- remote (proxy: $Proxy73 implements interface com.ufmobile.mstreet.rank.bo.Rankplace,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)
+- QueueConnectionFactory (class: org.jboss.naming.LinkRefPair)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992699#3992699
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992699
19 years, 4 months
[EJB 3.0] - Java Client of Embedded EJB3 into Tomcat5.5.20 problem
by coral
Is it prossible to use eclipse java class to call embedded EJB3 into Tomcat?
I knew it's easy for Jboss ejb3 to make it work. But for embedded ejb3 it maybe can not work.
I try the codes as Jboss EJB3
| final Hashtable<String,String> properties = new Hashtable<String,String>();
| properties.put("java.naming.factory.initial","org.jnp.interfaces.LocalOnlyContextFactory");
| properties.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
| InitialContext ctx = new InitialContext(properties);
| RemoteIntf remote = (RemoteIntf) ctx.lookup(RemoteIntf.class.getName());
| remote.runMethod();
|
It will throw exception when run on InitialContext ctx = new InitialContext(properties);
The exception is:
| javax.naming.NamingException: Local server is not initialized
| at org.jnp.interfaces.LocalOnlyContextFactory.getInitialContext(LocalOnlyContextFactory.java:45)
| at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
| at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
| at javax.naming.InitialContext.init(InitialContext.java:223)
| at javax.naming.InitialContext.<init>(InitialContext.java:197)
| at test.Test.main(Test.java:34)
|
Did the error message means not find service? I think every step I do is correct, but...
Thanks for any reply
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992698#3992698
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992698
19 years, 4 months