How to Call Web Service from Java.?

Posted by sanswa19 on 27-Oct-2014 02:47

1)I created and deployed decision service in contortion server from rule test and created wsdl file .Now i am able to access this wsdl in server.


Now i am try to access that wsdl file from java and call a particular operation in wsdl namely execute.

Now i am struct with how to pass parameter in the execute method.

I think need to pass xml file in that parameter.

Kindly give detailed steps to address this issue.

Note:-And it is working fine in Soap-UI

Thanks in advance,

Saravanan P

Posted by James Arsenault on 27-Oct-2014 07:58

Saravanan,
 
The Corticon Server install includes a sample which demonstrates how to call Corticon SOAP services from Java. In the work directory created during install is the sample
 
               Samples\Clients\SOAP\CcServerApiTest.java
 
This combined with the Corticon guide “Deploying Web Services with Java” should provide you the information you need.
 
               http://documentation.progress.com/output/ua/Corticon/index.html#page/Corticon/Corticon.0662.html#
 
Jim
 
 
[collapse]
From: sanswa19 [mailto:bounce-sanswa19@community.progress.com]
Sent: Monday, October 27, 2014 3:48 AM
To: TU.Corticon@community.progress.com
Subject: [Technical Users - Corticon] How to Call Web Service from Java.?
 
How to Call Web Service from Java.?
Thread created by sanswa19

1)I created and deployed decision service in contortion server from rule test and created wsdl file .Now i am able to access this wsdl in server.


Now i am try to access that wsdl file from java and call a particular operation in wsdl namely execute.

Now i am struct with how to pass parameter in the execute method.

I think need to pass xml file in that parameter.

Kindly give detailed steps to address this issue.

Note:-And it is working fine in Soap-UI

Thanks in advance,

Saravanan P

Stop receiving emails on this subject.

Flag this post as spam/abuse.

 
[/collapse]

All Replies

Posted by James Arsenault on 27-Oct-2014 07:58

Saravanan,
 
The Corticon Server install includes a sample which demonstrates how to call Corticon SOAP services from Java. In the work directory created during install is the sample
 
               Samples\Clients\SOAP\CcServerApiTest.java
 
This combined with the Corticon guide “Deploying Web Services with Java” should provide you the information you need.
 
 
Jim
 
 
[collapse]
From: sanswa19 [mailto:bounce-sanswa19@community.progress.com]
Sent: Monday, October 27, 2014 3:48 AM
To: TU.Corticon@community.progress.com
Subject: [Technical Users - Corticon] How to Call Web Service from Java.?
 
Thread created by sanswa19

1)I created and deployed decision service in contortion server from rule test and created wsdl file .Now i am able to access this wsdl in server.


Now i am try to access that wsdl file from java and call a particular operation in wsdl namely execute.

Now i am struct with how to pass parameter in the execute method.

I think need to pass xml file in that parameter.

Kindly give detailed steps to address this issue.

Note:-And it is working fine in Soap-UI

Thanks in advance,

Saravanan P

Stop receiving emails on this subject.

Flag this post as spam/abuse.

 
[/collapse]

Posted by sanswa19 on 27-Oct-2014 09:51

Hi James,

I am getting below type of error when i pass string value as parameter in excecute()

Error Details,

Exception in thread "main" com.sun.xml.internal.ws.fault.ServerSOAPFaultException: Client received SOAP Fault from server: java.rmi.RemoteException: Unexpected Error; nested exception is:

com.corticon.service.ccserver.exception.CcServerInvalidArgumentException: CcServer.execute(Document) Invalid Root Element Name....expected 'CorticonRequest' but received execute

Object state for: com.corticon.eclipse.server.core.impl.CcServerImpl: com.corticon.eclipse.server.core.impl.CcServerImpl@796e1c Please see the server log to find more detail regarding exact cause of the failure.

at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(Unknown Source)

at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(Unknown Source)

at com.sun.xml.internal.ws.client.sei.StubHandler.readResponse(Unknown Source)

at com.sun.xml.internal.ws.db.DatabindingImpl.deserializeResponse(Unknown Source)

at com.sun.xml.internal.ws.db.DatabindingImpl.deserializeResponse(Unknown Source)

at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)

at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)

at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source)

at com.sun.proxy.$Proxy32.execute(Unknown Source)

at Run.main(Run.java:55)

My Request xml is been like below

<?xml version="1.0"?>

<CorticonRequest  xmlns="urn:Corticon" xmlns:xsi="www.w3.org/.../XMLSchema-instance" decisionServiceName="Sample">

 <WorkDocuments>

   <Applicant id="Order_id_1">

       <Blind>true</Blind>

   </Applicant>

 </WorkDocuments>

</CorticonRequest>

Thanks in advance

Saravanan P.

Posted by James Arsenault on 27-Oct-2014 22:39

Saravanan,
 
Try this with the bundled SOAP test client included with Corticon Server. Run
 
<install dir>\Server\bin\testServerAxis.bat
 
Use option “130” to send your test XML file to the server. See the section “Consuming a Decision Service” in the “Deploying Web Services with Java” guide. I’m asking you to try this to help identify if it’s possibly in your client code.
 
Thanks,
Jim
 
 
[collapse]
From: sanswa19 [mailto:bounce-sanswa19@community.progress.com]
Sent: Monday, October 27, 2014 10:52 AM
To: TU.Corticon@community.progress.com
Subject: RE: [Technical Users - Corticon] How to Call Web Service from Java.?
 
Reply by sanswa19

Hi James,

I am getting below type of error when i pass string value as parameter in excecute()

Error Details,

Exception in thread "main" com.sun.xml.internal.ws.fault.ServerSOAPFaultException: Client received SOAP Fault from server: java.rmi.RemoteException: Unexpected Error; nested exception is:

com.corticon.service.ccserver.exception.CcServerInvalidArgumentException: CcServer.execute(Document) Invalid Root Element Name....expected 'CorticonRequest' but received execute

Object state for: com.corticon.eclipse.server.core.impl.CcServerImpl: com.corticon.eclipse.server.core.impl.CcServerImpl@796e1c Please see the server log to find more detail regarding exact cause of the failure.

at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(Unknown Source)

at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(Unknown Source)

at com.sun.xml.internal.ws.client.sei.StubHandler.readResponse(Unknown Source)

at com.sun.xml.internal.ws.db.DatabindingImpl.deserializeResponse(Unknown Source)

at com.sun.xml.internal.ws.db.DatabindingImpl.deserializeResponse(Unknown Source)

at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)

at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)

at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source)

at com.sun.proxy.$Proxy32.execute(Unknown Source)

at Run.main(Run.java:55)

My Request xml is been like below

<?xml version="1.0"?>

<CorticonRequest  xmlns="urn:Corticon" xmlns:xsi="www.w3.org/.../XMLSchema-instance" decisionServiceName="Sample">

 <WorkDocuments>

   <Applicant id="Order_id_1">

       <Blind>true</Blind>

   </Applicant>

 </WorkDocuments>

</CorticonRequest>

Thanks in advance

Saravanan P.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by borigorl on 28-Oct-2014 02:01

Given 130 and provided the Decision service name. After that we are getting below error. It is working fine in SOAPUI tool.

Calculator

com.corticon.service.ccserver.exception.CcServerDecisionServiceNotRegisteredExce

ption: CcServer.lookupCcServerPoolHighestVersionNumber() Decision Service: Calcu

lator is not registered.  Update failed.

Object state for: com.corticon.eclipse.server.core.impl.CcServerImpl: com.cortic

on.eclipse.server.core.impl.CcServerImpl@1543c88

       at com.corticon.eclipse.server.core.impl.CcServerImpl.lookupCcServerPool

HighestVersionActiveNonTestingDecisionServiceNumber(CcServerImpl.java:3919)

       at com.corticon.eclipse.server.core.impl.CcServerImpl.clearExecutionCoun

ts(CcServerImpl.java:6603)

       at com.corticon.eclipse.server.core.CcServerApiTest.clearExecutionCounts

(CcServerApiTest.java:3110)

       at com.corticon.eclipse.server.core.CcServerApiTest.executeTransaction(C

cServerApiTest.java:564)

       at com.corticon.eclipse.server.core.CcServerApiTest.beginProcess(CcServe

rApiTest.java:419)

       at com.corticon.eclipse.server.core.CcServerApiTest.main(CcServerApiTest

.java:4192)

Transaction completed.

Posted by Jan Krishnamurthy on 28-Oct-2014 08:23

What does option 120 : Get Decision service Names return ? Is Calculator Decision Service returned

Posted by borigorl on 28-Oct-2014 10:12

Hi,

I am getting the below error. in console if i provide decision service name after providing 120

com.corticon.service.ccserver.exception.CcServerDecisionServiceNotRegisteredExce

ption: CcServer.lookupCcServerPoolHighestVersionNumber() Decision Service: Calcu

lator is not registered.  Update failed.

Object state for: com.corticon.eclipse.server.core.impl.CcServerImpl: com.cortic

on.eclipse.server.core.impl.CcServerImpl@1479feb

       at com.corticon.eclipse.server.core.impl.CcServerImpl.lookupCcServerPool

HighestVersionActiveNonTestingDecisionServiceNumber(CcServerImpl.java:3919)

       at com.corticon.eclipse.server.core.impl.CcServerImpl.getIntervalExecuti

onCounts(CcServerImpl.java:6242)

       at com.corticon.eclipse.server.core.CcServerApiTest.getIntervalExecution

Counts(CcServerApiTest.java:2889)

       at com.corticon.eclipse.server.core.CcServerApiTest.executeTransaction(C

cServerApiTest.java:546)

       at com.corticon.eclipse.server.core.CcServerApiTest.beginProcess(CcServe

rApiTest.java:419)

       at com.corticon.eclipse.server.core.CcServerApiTest.main(CcServerApiTest

.java:4192)

Thanks in advance.

Posted by Jan Krishnamurthy on 28-Oct-2014 10:17

What is returned when you use use menu item 120 ?

It should return a list of  decision services deployed on the server.

Posted by Jan Krishnamurthy on 28-Oct-2014 10:27

If this returns an empty list or [ ] , it means no decision service is deployed on the Server.

Posted by borigorl on 28-Oct-2014 10:43

But i am able to run in SOAPUI and i got the result as well. Works fine

Thank you.

Posted by borigorl on 30-Oct-2014 01:51

Hi,

provide me any details or doc to call the corticon decision service from java. After deploying decision service, it is working from SOAP UI but if i am executing using the execute method by passing the xml as input am getting the error which is mentioned in this thread at starting.

Do we have any small procedure to invoke the corticon service from a jsp button trigger.

Thanks in advance.....

Regards,

Brahmaiah B.

This thread is closed