Calling Tuxedo Service using BEA Jolt.

I'm trying to call Tuxedo service from java stored procedure using BEA JOLT.My normal java client works fine but when i use the same client as java stored procedure i get following error message :
can not connect to any //lucy:9021(host:port)
Reason:Nwhdlr:can not open socket
I've successfully loaded all required JOLT jar files using loadjava and created the procedure successfully .Java code is given below :
import bea.jolt.*;
import java.sql.*;
public class JoltToTux
     public static void callTuxService() throws Exception
          JoltSession session;
          JoltSessionAttributes sattr;
          JoltRemoteService toupper;
          JoltTransaction trans;
          String userName=null;
          String userPassword=null;
          String appPassword=null;
          String userRole=null;
          String outstr;
          try {
          sattr = new JoltSessionAttributes();
          sattr.setString(sattr.APPADDRESS, "//lucy:9021");
          sattr.setInt(sattr.IDLETIMEOUT, 300);
          session = new JoltSession(sattr, userName, userRole,userPassword, appPassword);
                    toupper = new JoltRemoteService ("CB_EXESUB", session);
          toupper.setString("CLFY_SUB", "PingSrvr");
          toupper.call(null);
          System.out.println( "Call to Tuxedo complete" );
          outstr = toupper.getStringDef("WF_MESSAGE","" );
          System.out.println("return string : " + outstr);
                    session.endSession();
          System.exit(0);
          } //end of try
          catch (Exception e) {
               // System.err.println(e.getMessage());}
               e.printStackTrace();
     } // end main
     public static void main( String args[] ) {
          try {
               JoltToTux jt = new JoltToTux();
               jt.callTuxService();
          catch ( Exception e0 ) {
               e0.printStackTrace();
} // end ToUpper
thanks
anurag

Ams,
You can't do that with JOLT. You will need to use the WTC product,
currently in beta - see WTC Questions and Answers
Regards,
Peter.
Got a Question? Ask BEA at http://askbea.bea.com
The views expressed in this posting are solely those of the author, and
BEA
Systems, Inc. does not endorse any of these views.
BEA Systems, Inc. is not responsible for the accuracy or completeness of
the
information provided
and assumes no duty to correct, expand upon, delete or update any of the
information contained in this posting.
Ams wrote:
Hi Manoj,
I want to call a tuxedo service and also want to update
database (using entity beabs) in same transaction so I
can't use AUTOTRAN , Am I right ?
I am using bea.jolt.pool.SessionPool's startTransaction
method to start a transaction and passing this
to SessionPool's call method.
Ams.
"Manoj SASIDHARAN" <[email protected]> wrote:
Hello Ams,
Could u plz give more information abt the usage scenario. Another way
to test
would be to put AUTOTRAN=Y for the service in question.
HTH
regards
MS
"Ams" <[email protected]> wrote:
Hi,
I am calling Tuxedo service from ejb using jolt.
I want the service call in transaction started in ejb.
I am getting following error.
LIBTUX_CAT:481: ERROR: Service xa_start returned -7
Does jolt support transaction ?
Ams
[att1.html]

Similar Messages

  • TPESYSTEM error when calling tuxedo service

    Hello,
    I have a problem when running my own EJB as a TUXEDO service using WTC.
    Im using TUXEDO 8.1 and WL 8.1.
    My TUXEDO and WTC configuration seems OK, because TOLOWER example is running OK.
    When im trying to run my own EJB as a TUXEDO service on TUXEDO side TPESYSTEM
    error appears.
    JDNI name and configuration of the EJB is correct, because when I put wrong JNDI
    then on TUXEDO side TPENOENTRY error appears. Additionally - my EJB's bussines
    logic is pretty the same as TOLOWER example.
    I think that is EJB issue because in server logs there is an information that
    domains are connected but ejbCreate method isn't called. My EJB was developed
    using JBuilder 9 WebLOgic Edition and WL Workshop 8.1.
    Thanks,
         Patrick

    Hi Hemant,
    I'm not sure, but my guess is it was a setup problem. Perhaps not implementing the right interface in the EJB, not having the correct home specified, etc.
    Usually the best way to find these errors the first time is to turn on some debugging information in WLS. More information can be found at: http://edocs.bea.com/wls/docs91/wtc_admin/Install.html
    For this sort of problem, it probably makes sense to enable -Dweblogic.debug.DebugWTCGwtEx=true and/or -Dweblogic.debug.DebugWTCJatmiEx=true
    The above examples are for WLS 9.1 and later. For earlier releases of WLS, check edocs for the settings of weblogic.wtc.TraceLevel
    Best Regards,
    Todd Little
    BEA Tuxedo Chief Architect

  • Debugging a tuxedo service using dbx

    Hi,
    Is is possible to debug a tuxedo service using dbx by enabing the tmboot switches
    and -g option of the compiler. I am able to step into tpsvrinit during initialisation,
    but not able to do when a client calls a service. I could not step into the service
    by setting breakpoints. Please help.
    rgds,
    Dominic

    The only thing to be aware of is that while you play around in the debugger, Tuxedo
    is timing out your transaction.
    So, if you want things to keep working while you debug, setup some nice long timouts.
    ...Lyall
    "RC Bryan" <[email protected]> wrote:
    >
    I have not done this on Solaris in a while but basically, what you have
    to do is
    to build the process with -g and start it with tmboot as you would normally.
    After the process is running, you can attach by typing:
    dbx name pid
    where the name is the name of the executable and pid is the process id
    of the
    server process (obtained either with ps -ef | grep name or with verbose
    mode psr
    in tmadmin). This will break into the running process. You can then
    set your
    break points in the service routines as required. When the service is
    entered,
    control will return to your debugger session and you can debug as you
    normally
    would.
    Incidentally, I find the buildserver -k (keep) option to be useful when
    debugging
    servers. This allows you to debug through the startup code that is normally
    deleted
    as a part of the buildserver process.
    Regards,
    /RC Bryan
    "Dominic" <[email protected]> wrote:
    Hi,
    Is is possible to debug a tuxedo service using dbx by enabing the tmboot
    switches
    and -g option of the compiler. I am able to step into tpsvrinit during
    initialisation,
    but not able to do when a client calls a service. I could not step into
    the service
    by setting breakpoints. Please help.
    rgds,
    Dominic

  • I have a problem when running my own EJB as a TUXEDO service using WTC.

    Hello,
    I have a problem when running my own EJB as a TUXEDO service using WTC. I am using TUXEDO 8.1 and WL 9.1.
    When I am trying to run my own EJB as a TUXEDO service error appears.
    TPENOENT(6):0:0:TPED_MINVAL(0):QMNONE(0):0:Could not find service TOUPPER
    at weblogic.wtc.gwt.WTCService.getImport(WTCService.java:4988)
    at weblogic.wtc.gwt.TuxedoConnection.getImport(TuxedoConnection.java:303)
    at weblogic.wtc.gwt.TuxedoConnection.tpcall(TuxedoConnection.java:1302)
    at examples.MyTestSessionBean.Toupper(MyTestSessionBean.java:102)
    at examples.TestSessionBean_knby6k_EOImpl.Toupper(TestSessionBean_knby6k_EOImpl.java:61)
    at net.roseindia.web.servlets.SessionTestServlet.doGet(SessionTestServlet.java:69)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
    e8
    10
    java.rmi.RemoteException: EJB Exception: ; nested exception is:
    java.lang.NullPointerException
    at weblogic.ejb.container.internal.EJBRuntimeUtils.throwRemoteException(EJBRuntimeUtils.java:95)
    at weblogic.ejb.container.internal.BaseEJBObject.handleSystemException(BaseEJBObject.java:713)
    at weblogic.ejb.container.internal.BaseEJBObject.handleSystemException(BaseEJBObject.java:681)
    at weblogic.ejb.container.internal.BaseEJBObject.postInvoke1(BaseEJBObject.java:447)
    at weblogic.ejb.container.internal.StatelessEJBObject.postInvoke1(StatelessEJBObject.java:72)
    at weblogic.ejb.container.internal.BaseEJBObject.postInvokeTxRetry(BaseEJBObject.java:374)
    at examples.TestSessionBean_knby6k_EOImpl.Toupper(TestSessionBean_knby6k_EOImpl.java:75)
    at net.roseindia.web.servlets.SessionTestServlet.doGet(SessionTestServlet.java:69)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
    Caused by: java.lang.NullPointerException
    at examples.MyTestSessionBean.Toupper(MyTestSessionBean.java:130)
    at examples.TestSessionBean_knby6k_EOImpl.Toupper(TestSessionBean_knby6k_EOImpl.java:61)
    ... 15 more
    Any clue on this.
    With Regards,
    MVS

    If you are trying to create a Tuxedo service in Java using WTC you need to develop an EJB that implements the TuxedoService interface and register its home in JNDI so WTC can look it up. Once that is done you can then export the service to a remote domain in the WTC configuration.
    Regards,
    Todd Little
    Oracle Tuxedo Chief Architect

  • How to call web-service using only java code

    Hello, how to call web-service using only java code. I can call it from BPM process or Web Dynpro Java Application, but if I need to call it from ejb component?

    I'm found answer:
    Java and SAP Portal blog: How to call web service from java code example

  • How to call web service using J2SE 1.3?

    Dear All,
    i have developed a web service by jdev 10.1.3 (JAX-RPC with web service security
    enabled).
    i generate the ws proxy (jdev 10.1.3) and run it with wsclient_extended.jar (required JDK 1.4.1 or above??).
    but one of my client say he has to use J2SE 1.3.x (as OS=AIX 4.3 that without J2SE
    1.4.x ), could anyone tell me how can generate ws proxy (with supporting
    library) for jdk 1.3.x?
    if oracle don't have such library / tools, any third party tools / library available?
    thank you.
    lsp

    I'm found answer:
    Java and SAP Portal blog: How to call web service from java code example

  • Error 504 DNS look up failed while calling web services using XML

    Hi, I am trying to call web service from Oracle using XML.
    Everything seems to be in place but im getting an error "The webserver for <My End URL> reported that an error occurred while trying to access the website. Please click here to return to the previous page."
    If I directly access the end url from my browser its accessible and seems to work fine.
    The http response receiveed is mentioned below:
    Status code: 403
    Reason phrase: Forbidden
    <html>
    <head>
    <title>504 DNS look up failed</title>
    </head>
    <body>
    <font size=2><table width="100%"><tr><td bgcolor=#3300cc align="center" colspan=2>504 DNS look up failed</td></tr></table><br><br>The webserver for 'My End URL' reported that an error occurred while trying to access the website. Please click <u>here</u> to return to the previous page.<br><br><hr></font></body>
    </html>
    Im using Oracle 9i
    Please help
    Edited by: 927814 on Apr 15, 2012 11:41 PM
    Edited by: 927814 on Apr 15, 2012 11:46 PM

    Without far greater details as to what you are doing, what you have installed, and what you have tried, not much can be offered. All that I can gather from the information you provided is that the server name you are trying to contact either is not responding or is invalid. If you have Forms installed on your local machine (for example using Developer Suite), try using localhost rather than the hostname. For example, http://localhost:port/forms/frmservlet?form=yourform
    http://www.checkupdown.com/status/E504.html

  • Call web service using code.

    we want to call a web service from ADF JSP form.
    We used web service data control. But deployment failed.
    we applied Patch 5878326 to JDeveloper 10.1.3.3.0 and OAS.
    But problem is not solved.
    So we need a new way to call web services.
    is there any other way to call web services from Jdev.
    any code sample will be appreciated.
    Thanks.

    Workaround for the Connection Failure
    In JDeveloper, locate the .deploy file in the Resources folder of your web application project.
    Double-click the file to open the WAR Deployment Profile Properties dialog.
    Expand File Groups - WEB-INF/classes - Contributors.
    In the Contributors panel, click Add and use the Browse dialog to locate the .adf folder in the root for your application (for example, /jdev/mywork//.adf path.)
    Select the .adf folder and add it as a contributor to the deployment profile.
    Note that the .adf folder does not become part of the deployable archive. This merely ensures that the contents of the META-INF get placed in an appropriate location in the archive that will permit the web container to find it when the application loads.
    The failure to get the connection to Webservice is beacuse the "connections.xml" is not available in the deployed archive.
    This has been release note'd as in
    http://www.oracle.com/technology/products/jdev/htdocs/10.1.3.0.3/10.1.3_addendum.html under "Deployment issues"

  • Calling Web Service using utl_http; Parameters not being recognized by ws

    Hi All,
    I have set-up appropriate function & packages based on this article:
    Calling Web Services from PL/SQL in the Oracle9i Database -
    http://www.oracle.com/technology/tech/webservices/htdocs/samples/dbwebservice/DBWebServices_PLSQL.html
    I am able to consume my sample web service using the above, but my web service doesn't see any parameters that I'm passing.
    Any ideas? I'm using Oracle 10g calling a .Net 1.1 web service
    Thanks,
    Robert

    Hello,
    I am not able to access the link you posted about calling a web service. Could please share your code again ?
    Thanks in advance for your help...
    Lionel

  • Calling Portal Service using result as Java Bean Model impossible?

    Hello folks,
    we try to achieve to call a portal service (working) which gives as a result a list of object of type com.foo.Report. We want to make use of this class as a model class, so we have the class as a model node in the context. The class itself is part of the service DC.
    Unfortunately at run time it gives us a NoClassDefFound Exception of com.foo.Report.
    As the com.foo.Report is part of the same DC as the service, it is no option to add the PAR public part to the used DCs of the WD DC because then there is this type conflict when we call the service (service look up). Or am I wrong and this is the way to do it? I mean I struggled quite a while to get the service look up right and needed to remove all the PAR/lib used DCs from the used DCs of the WD Project, when I got it working this Model error came up. I also tried to put the Model class in a separate DC but that caused the same error.
    how is it possible to call a Portal service from WD and using it's return vale as a Model class
    our system iis 7.0.17
    best
    Stefan

    Hi,
    Refers the following docs..
    EJBs in Web Dynpro Application Using Wrapper Class
    Here Java Bean Model used in web dynpro.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00be903b-8551-2b10-c28a-8520400c6451
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1f5f3366-0401-0010-d6b0-e85a49e93a5c
    Accessing database table using EJB and web dynpro
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70929198-0d36-2b10-04b8-84d90fa3df9c
    Oracle Connectivity with EJB using WebDynpro Application
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdjava/oracle%2bconnectivity%2bwith%2bejb%2busing%2bwebdynpro%2bapplication
    Hope it will help u.
    thanks
    Abhilasha

  • Service Instance remains active when calling Web Service using WCF-BasicHttp binding

    I am trying to call a web service using ESB ToolKit using a dynamic send port. The message went through all the pipeline components successfully. However, after the message is picked up by the WCF adapter, the service instance remains in "Active"
    status, and then eventually it dehydrates itself. There's no error in the event log at all. Have anyone seen this problem before? If so, what is the solution?
    I tried using a static send port with exactly the same configuration and the message reaches the web service successfully and got the response back.
    Please note the web service is RPC-Style web service, not sure if it makes a difference.
    Here is the configuration for the static send port
    <Address>http://myserver:8088/mockLoadDataBinding</Address><TransportType Name="WCF-BasicHttp" Capabilities="899" ConfigurationClsid="467c1a52-373f-4f09-9008-27af6b985f14" />
    <TransportTypeData>
    <CustomProps>
    <InboundNodeEncoding vt="8">String</InboundNodeEncoding>
    <MessageEncoding vt="8">Text</MessageEncoding>
    <ServiceCertificate vt="8" />
    <InboundBodyPathExpression vt="8">//*[local-name()='return']/node() | //*[local-name()='SecurityException']</InboundBodyPathExpression>
    <OutboundBodyLocation vt="8">UseTemplate</OutboundBodyLocation>
    <StaticAction vt="8" />
    <InboundBodyLocation vt="8">UseBodyPath</InboundBodyLocation>
    <ProxyAddress vt="8" />
    <MaxReceivedMessageSize vt="3">65536</MaxReceivedMessageSize>
    <ClientCertificate vt="8" />
    <AlgorithmSuite vt="8">Basic256</AlgorithmSuite>
    <ProxyUserName vt="8" />
    <OutboundXmlTemplate vt="8">&lt;web:loadData soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:web="http://www.company.com/webservices" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;&lt;input xsi:type="xsd:string"&gt;&lt;bts-msg-body xmlns="http://www.microsoft.com/schemas/bts2007" encoding="string"/&gt;&lt;/input&gt;&lt;/web:loadData&gt;</OutboundXmlTemplate>
    <TextEncoding vt="8">utf-8</TextEncoding>
    <PropagateFaultMessage vt="11">-1</PropagateFaultMessage>
    <SecurityMode vt="8">None</SecurityMode>
    <ProxyToUse vt="8">Default</ProxyToUse>
    <TransportClientCredentialType vt="8">None</TransportClientCredentialType>
    <OpenTimeout vt="8">00:01:00</OpenTimeout>
    <UseAcsAuthentication vt="11">0</UseAcsAuthentication>
    <MessageClientCredentialType vt="8">UserName</MessageClientCredentialType>
    <UseSSO vt="11">0</UseSSO>
    <CloseTimeout vt="8">00:01:00</CloseTimeout>
    <SendTimeout vt="8">00:01:00</SendTimeout>
    </CustomProps>
    </TransportTypeData>
    here is the configuration for the dynamic send port (using BRE Resolver)
    Set Endpoint Outbound TransportType to WCF-BasicHttp
    Set Endpoint Outbound TransportLocation to http://myserver:8088/mockLoadDataBinding
    Set Endpoint Message Exchange Pattern to Solicit-Response
    Set EndPoint WCF Action to <empty string>
    Set Endpoint Config to InboundNodeEncoding=String&amp;MessageEncoding=Text&amp;InboundBodyPathExpression=//*[local-name()='return']/node() | //*[local-name()='SecurityException']&amp;OutboundBodyLocation=UseTemplate&amp;StaticAction=&amp;InboundBodyLocation=UseBodyPath&amp;MaxReceivedMessageSize=65536&amp;AlgorithmSuite=Basic256&amp;OutboundXmlTemplate=&lt;web:loadData 
    soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"  xmlns:web="http://www.company.com/webservices" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;&lt;input xsi:type="xsd:string"&gt;&lt;bts-msg-body xmlns="http://www.microsoft.com/schemas/bts2007"
    encoding="string"/&gt;&lt;/input&gt;&lt;/web:loadData&gt;&amp;TextEncoding=utf-8&amp;PropagateFaultMessage vt="11">-1&amp;SecurityMode=None&amp;ProxyToUse=Default&amp;TransportClientCredentialType=None&amp;OpenTimeout=00:01:00&amp;UseAcsAuthentication=False&amp;MessageClientCredentialType=UserName&amp;UseSSO=False&amp;CloseTimeout=00:01:00&amp;SendTimeout=00:01:00
    Set Endpoint Target Namespace to
    http://www.company.com/webservices

    Thanks Birdsven,
    I updated the Resolver policy to as follows, and still I am getting the same result.
    <then>
    <function>
    <vocabularylink uri="95dced57-5e9b-4dbe-9cd8-4b166853dd8a" element="4ad331d0-820c-41cb-a98e-7e1f5a9d5360" />
    <classmember member="set_TransportType" sideeffects="true">
    <classref ref="Resolution" />
    <argument>
    <constant>
    <string>WCF-BasicHttp</string>
    </constant>
    </argument>
    </classmember>
    </function>
    <function>
    <vocabularylink uri="95dced57-5e9b-4dbe-9cd8-4b166853dd8a" element="20652bdd-c1f2-4b75-9e6b-7e20af98e66d" />
    <classmember member="set_MessageExchangePattern" sideeffects="true">
    <classref ref="Resolution" />
    <argument>
    <constant>
    <string>Solicit-Response</string>
    </constant>
    </argument>
    </classmember>
    </function>
    <function>
    <vocabularylink uri="95dced57-5e9b-4dbe-9cd8-4b166853dd8a" element="9357b8ea-3663-4625-9681-a2fc2f423911" />
    <classmember member="set_TransportLocation" sideeffects="true">
    <classref ref="Resolution" />
    <argument>
    <constant>
    <string>http://myservice.com:8089/loadDataService</string>
    </constant>
    </argument>
    </classmember>
    </function>
    <function>
    <vocabularylink uri="95dced57-5e9b-4dbe-9cd8-4b166853dd8a" element="9c97e7a0-d119-4b0d-8e39-2b281ae6ef8d" />
    <classmember member="set_Action" sideeffects="true">
    <classref ref="Resolution" />
    <argument>
    <constant>
    <string>{loadData}</string>
    </constant>
    </argument>
    </classmember>
    </function>
    <function>
    <vocabularylink uri="95dced57-5e9b-4dbe-9cd8-4b166853dd8a" element="2829f1b7-09c0-4396-b82e-23fd65d8439c" />
    <classmember member="set_EndpointConfig" sideeffects="true">
    <classref ref="Resolution" />
    <argument>
    <constant>
    <string>InboundNodeEncoding=String&amp;MessageEncoding=Text&amp;ServiceCertificate=&amp;InboundBodyPathExpression=//*[local-name()='return']/node() | //*[local-name()='SecurityException']&amp;OutboundBodyLocation=UseTemplate&amp;StaticAction=&amp;InboundBodyLocation=UseBodyPath&amp;ProxyAddress=&amp;MaxReceivedMessageSize=65536&amp;ClientCertificate=&amp;AlgorithmSuite=Basic256&amp;ProxyUserName=&amp;OutboundXmlTemplate=&lt;web:loadData soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:web="http://www.mycompany.com/webservices" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;&lt;input xsi:type="xsd:string"&gt;&lt;bts-msg-body xmlns="http://www.microsoft.com/schemas/bts2007" encoding="string"/&gt;&lt;/input&gt;&lt;/web:loadData&gt;&amp;TextEncoding=utf-8&amp;PropagateFaultMessage=True&amp;SecurityMode=None&amp;ProxyToUse=Default&amp;TransportClientCredentialType=None&amp;OpenTimeout=00:01:00&amp;UseAcsAuthentication=False&amp;MessageClientCredentialType=UserName&amp;UseSSO=False&amp;CloseTimeout=00:01:00&amp;SendTimeout=00:01:00</string>
    </constant>
    </argument>
    </classmember>
    </function>
    <function>
    <vocabularylink uri="95dced57-5e9b-4dbe-9cd8-4b166853dd8a" element="54624479-caea-4228-86b9-fbe188a8c64d" />
    <classmember member="set_TargetNamespace" sideeffects="true">
    <classref ref="Resolution" />
    <argument>
    <constant>
    <string>http://www.mycompany.com/webservices</string>
    </constant>
    </argument>
    </classmember>
    </function>
    </then>

  • Calling Web services using SOAP

    Hi,
    I am trying to execute a function through a webservice using a SOAP
    package and am getting the following error:ORA-30625: method dispatch
    on NULL SELF argument is disallowed. I think this is to do with one of
    the parameters being null but dont know how to fix this. Following is
    the function:
    CREATE OR REPLACE FUNCTION ILACPMSPRC.GET_GREETING_fnc (p_name IN
    VARCHAR2
    --, p_date VARCHAR2
    , p_age VARCHAR2 )
    RETURN NUMBER
    AS
    l_request soap_api_pkg.t_request;
    l_response soap_api_pkg.t_response;
    l_price NUMBER;
    -- DBMS_OUTPUT.ENABLE(20000);
    BEGIN
    DBMS_OUTPUT.ENABLE(20000);
    DBMS_OUTPUT.PUT_LINE('BEGIN');
    -- Set proxy details if no direct net connection.
    --UTL_HTTP.set_proxy('myproxy:4480', NULL);
    --UTL_HTTP.set_persistent_conn_support(TRUE);
    -- Set proxy authentication if necessary.
    --soap_api.set_proxy_authentication(p_username => 'myusername',
    -- p_password => 'mypassword');
    l_request := soap_api_pkg.new_request(p_method => 'ns1:validate',
    p_namespace => 'xmlns:ns1="http://
    impl.webservice.validation.workmgt.cb.irishlife.ie/xsd"');
    -- parameter 1 is name
    soap_api_pkg.add_parameter(p_request => l_request,
    p_name => 'workType',
    p_type => 'xsd:string',
    p_value => p_name);
    -- parameter 2 is date
    soap_api_pkg.add_parameter(p_request => l_request,
    p_name => 'workItemNo',
    p_type => 'xsd:string',
    p_value => 'ABC');
    --p_value   => '2007-01-01T00:00:00Z');
    -- parameter 3 is age
    soap_api_pkg.add_parameter(p_request => l_request,
    p_name => 'indexName',
    p_type => 'xsd:string',
    p_value => p_age);
    l_response := soap_api_pkg.invoke(p_request => l_request,
    p_url => 'http://
    10.253.55.139:7400/axis2/services/ValidationService',
    p_action => 'http://
    10.253.55.139:7400/axis2/services/ValidationService/validate');
    if l_response.doc is not null then
    dbms_output.put_line('the doc is not null');
    end if;
    DBMS_OUTPUT.PUT_LINE ( 'p_name = ' || p_name );
    HERE l_price := soap_api_pkg.get_return_value(p_response =>
    l_response,
    p_name =>
    'validateResponse',
    p_namespace =>
    'xmlns:ns1="http://impl.webservice.validation.workmgt.cb.irishlife.ie/
    xsd"');
    if l_price is null then
    dbms_output.put_line('opps, the price is null');
    end if;
    DBMS_OUTPUT.PUT_LINE('PRICE:'||l_price);
    RETURN l_price;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line(SQLCODE || ', ' || SQLERRM);
    RETURN NULL;
    END GET_GREETING_fnc;
    Where HERE is marked is where the problem lies...the package body is
    here:
    CREATE OR REPLACE PACKAGE BODY SOAP_API_PKG AS
    -- Name : http://www.oracle-base.com/dba/miscellaneous/soap_api
    -- Author : DR Timothy S Hall
    -- Description : SOAP related functions for consuming web services.
    -- Ammedments :
    -- When Who What
    -- =========== ========
    =================================================
    -- 04-OCT-2003 Tim Hall Initial Creation
    -- 23-FEB-2006 Tim Hall Parameterized the "soap" envelope tags.
    -- 08-JUN-2006 Tim Hall Add proxy authentication functionality.
    g_proxy_username VARCHAR2(50) := NULL;
    g_proxy_password VARCHAR2(50) := NULL;
    PROCEDURE set_proxy_authentication(p_username IN VARCHAR2,
    p_password IN VARCHAR2) AS
    BEGIN
    g_proxy_username := p_username;
    g_proxy_password := p_password;
    END;
    FUNCTION new_request(p_method IN VARCHAR2,
    p_namespace IN VARCHAR2,
    p_envelope_tag IN VARCHAR2 DEFAULT 'SOAP-ENV')
    RETURN t_request AS
    l_request t_request;
    BEGIN
    l_request.method := p_method;
    l_request.namespace := p_namespace;
    l_request.envelope_tag := p_envelope_tag;
    RETURN l_request;
    END;
    PROCEDURE add_parameter(p_request IN OUT NOCOPY t_request,
    p_name IN VARCHAR2,
    p_type IN VARCHAR2,
    p_value IN VARCHAR2) AS
    BEGIN
    p_request.body := p_request.body||'<'||p_name||' xsi:type="'||
    p_type||'">'||p_value||'</'||p_name||'>';
    DBMS_OUTPUT.PUT_LINE ( 'p_request.body = ' || p_request.body );
    END;
    --PROCEDURE add_parameter(p_request    IN OUT NOCOPY  t_request,
    -- p_name IN VARCHAR2,
    -- p_type IN DATE,
    -- p_value IN VARCHAR2) AS
    --BEGIN
    -- p_request.body := p_request.body||'<'||p_name||' xsi:type="'||
    p_type||'">'||p_value||'</'||p_name||'>';
    --END;
    --PROCEDURE add_parameter(p_request    IN OUT NOCOPY  t_request,
    -- p_name IN VARCHAR2,
    -- p_type IN INTEGER,
    -- p_value IN VARCHAR2) AS
    --BEGIN
    -- p_request.body := p_request.body||'<'||p_name||' xsi:type="'||
    p_type||'">'||p_value||'</'||p_name||'>';
    --END;
    PROCEDURE generate_envelope(p_request IN OUT NOCOPY t_request,
    p_env IN OUT NOCOPY VARCHAR2) AS
    BEGIN
    p_env := '<'||p_request.envelope_tag||':Envelope xmlns:'||
    p_request.envelope_tag||'="http://schemas.xmlsoap.org/soap/envelope/"
    ' ||
    'xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema">' ||
    '<'||p_request.envelope_tag||':Body>' ||
    '<'||p_request.method||' '||p_request.namespace||' '||
    p_request.envelope_tag||':encodingStyle="http://schemas.xmlsoap.org/
    soap/encoding/">' ||
    p_request.body ||
    '</'||p_request.method||'>' ||
    '</'||p_request.envelope_tag||':Body>' ||
    '</'||p_request.envelope_tag||':Envelope>';
    END;
    PROCEDURE show_envelope(p_env IN VARCHAR2) AS
    i PLS_INTEGER;
    l_len PLS_INTEGER;
    BEGIN
    i := 1; l_len := LENGTH(p_env);
    WHILE (i <= l_len) LOOP
    DBMS_OUTPUT.put_line(SUBSTR(p_env, i, 60));
    i := i + 60;
    END LOOP;
    END;
    PROCEDURE check_fault(p_response IN OUT NOCOPY t_response) AS
    l_fault_node XMLTYPE;
    l_fault_code VARCHAR2(256);
    l_fault_string VARCHAR2(32767);
    BEGIN
    dbms_output.put_line('midas8-1');
    l_fault_node := p_response.doc.extract('/'||
    p_response.envelope_tag||':Fault',
    'xmlns:'||
    p_response.envelope_tag||'="http://schemas.xmlsoap.org/soap/
    envelope/');
    dbms_output.put_line('midas8-2');
    IF (l_fault_node IS NOT NULL) THEN
    dbms_output.put_line('midas8-3');
    l_fault_code := l_fault_node.extract('/'||
    p_response.envelope_tag||':Fault/faultcode/child::text()',
    'xmlns:'||
    p_response.envelope_tag||'="http://schemas.xmlsoap.org/soap/
    envelope/').getstringval();
    dbms_output.put_line('midas8-4');
    l_fault_string := l_fault_node.extract('/'||
    p_response.envelope_tag||':Fault/faultstring/child::text()',
    'xmlns:'||
    p_response.envelope_tag||'="http://schemas.xmlsoap.org/soap/
    envelope/').getstringval();
    dbms_output.put_line('midas8-5');
    --RAISE_APPLICATION_ERROR(-20000, l_fault_code || ' - ' ||
    l_fault_string);
    END IF;
    END;
    FUNCTION invoke(p_request IN OUT NOCOPY t_request,
    p_url IN VARCHAR2,
    p_action IN VARCHAR2)
    RETURN t_response AS
    l_envelope VARCHAR2(32767);
    l_http_request UTL_HTTP.req;
    l_http_response UTL_HTTP.resp;
    l_response t_response;
    BEGIN
    dbms_output.put_line('Invoking request');
    dbms_output.put_line('url :'||p_url);
    dbms_output.put_line('action :'|| p_action);
    generate_envelope(p_request, l_envelope);
    show_envelope(l_envelope);
    l_http_request := UTL_HTTP.begin_request(p_url, 'POST','HTTP/1.0');
    dbms_output.put_line('midas1');
    IF g_proxy_username IS NOT NULL THEN
    DBMS_OUTPUT.PUT_LINE('PROXY USERNAME IS NOT NULL');
    UTL_HTTP.set_authentication(r => l_http_request,
    username => g_proxy_username,
    password => g_proxy_password,
    scheme => 'Basic',
    for_proxy => TRUE);
    END IF;
    UTL_HTTP.set_header(l_http_request, 'Content-Type', 'text/xml');
    UTL_HTTP.set_header(l_http_request, 'Content-Length',
    LENGTH(l_envelope));
    UTL_HTTP.set_header(l_http_request, 'SOAPAction', p_action);
    UTL_HTTP.write_text(l_http_request, l_envelope);
    dbms_output.put_line('midas2');
    l_http_response := UTL_HTTP.get_response(l_http_request);
    dbms_output.put_line('midas3');
    UTL_HTTP.read_text(l_http_response, l_envelope);
    dbms_output.put_line('midas4');
    UTL_HTTP.end_response(l_http_response);
    dbms_output.put_line('midas5');
    l_response.doc := XMLTYPE.createxml(l_envelope);
    dbms_output.put_line('midas6');
    l_response.envelope_tag := p_request.envelope_tag;
    dbms_output.put_line('midas7');
    l_response.doc := l_response.doc.extract('/'||
    l_response.envelope_tag||':Envelope/'||l_response.envelope_tag||':Body/
    child::node()',
    'xmlns:'||
    l_response.envelope_tag||'="http://schemas.xmlsoap.org/soap/
    envelope/"');
    -- show_envelope(l_response.doc.getstringval());
    dbms_output.put_line('midas8');
    check_fault(l_response);
    dbms_output.put_line('midas9');
    RETURN l_response;
    END;
    FUNCTION get_return_value(p_response IN OUT NOCOPY t_response,
    p_name IN VARCHAR2,
    p_namespace IN VARCHAR2)
    RETURN VARCHAR2 AS
    BEGIN
    -- RETURN p_response.doc.extract('//'||p_name||'/
    child::text()',p_namespace).getstringval();
    dbms_output.put_line('function');
    dbms_output.put_line(p_name);
    DBMS_OUTPUT.PUT_LINE (p_response.doc.extract('//'||p_name||'/
    child::text()', p_namespace).getstringval());
    RETURN p_response.doc.extract('//'||p_name||'/child::text()',
    p_namespace).getstringval();
    END;
    END SOAP_API_PKG;
    Any help greatly appreciated!!

    Hello,
    I have not looked in detail to you code but I would like to point out that Oracle provides utilities to call Web Services from the database, using a DB package and/or Java in the DB.
    Have you looked to the documentation about:
    - Developing a Web Service Client in the Database
    regards
    Tugdual Grall

  • Unable to call the service using JAX-RPC

    Hi,
    I created a web service in Weblogic6.1 using the ant wsgen utility.
    When i tried to invoke the service using my client program, i get the following error.
    Exception in thread "main" modeler error: model error: invalid entity name: "string" (in namespace: "http://www.w3.org/1999/XMLSchema"
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:137)
    at com.sun.xml.rpc.processor.config.ModelInfo.buildModel(ModelInfo.java:77)
    at com.sun.xml.rpc.client.dii.ServiceInfoBuilder.getModel(ServiceInfoBuilder.java:96)
    at com.sun.xml.rpc.client.dii.ServiceInfoBuilder.buildServiceInfo(ServiceInfoBuilder.java:59)
    at com.sun.xml.rpc.client.dii.ConfiguredService.<init>(ConfiguredService.java:44)
    at com.sun.xml.rpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:32)
    at JAXRPCClient.main(JAXRPCClient.java:20)
    CAUSE:
    model error: invalid entity name: "string" (in namespace: "http://www.w3.org/1999/XMLSchema")
    at com.sun.xml.rpc.processor.schema.InternalSchemaBuilder.buildTypeDefinition(InternalSchemaBuilder.java:61)
    at com.sun.xml.rpc.processor.schema.InternalSchema.findTypeDefinition(InternalSchema.java:45)
    at com.sun.xml.rpc.processor.modeler.wsdl.SchemaAnalyzer.schemaTypeToSOAPType(SchemaAnalyzer.java:66)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.processSOAPOperationRPCStyle(WSDLModeler.java:592)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.processSOAPOperation(WSDLModeler.java:423)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.processPort(WSDLModeler.java:344)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.processService(WSDLModeler.java:231)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:196)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:103)
    at com.sun.xml.rpc.processor.config.ModelInfo.buildModel(ModelInfo.java:77)
    at com.sun.xml.rpc.client.dii.ServiceInfoBuilder.getModel(ServiceInfoBuilder.java:96)
    at com.sun.xml.rpc.client.dii.ServiceInfoBuilder.buildServiceInfo(ServiceInfoBuilder.java:59)
    at com.sun.xml.rpc.client.dii.ConfiguredService.<init>(ConfiguredService.java:44)
    at com.sun.xml.rpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:32)
    at JAXRPCClient.main(JAXRPCClient.java:20)
    CAUSE:
    invalid entity name: "string" (in namespace: "http://www.w3.org/1999/XMLSchema")
    at com.sun.xml.rpc.wsdl.framework.AbstractDocument.find(AbstractDocument.java:110)
    at com.sun.xml.rpc.processor.schema.InternalSchemaBuilder.buildTypeDefinition(InternalSchemaBuilder.java:54)
    at com.sun.xml.rpc.processor.schema.InternalSchema.findTypeDefinition(InternalSchema.java:45)
    at com.sun.xml.rpc.processor.modeler.wsdl.SchemaAnalyzer.schemaTypeToSOAPType(SchemaAnalyzer.java:66)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.processSOAPOperationRPCStyle(WSDLModeler.java:592)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.processSOAPOperation(WSDLModeler.java:423)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.processPort(WSDLModeler.java:344)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.processService(WSDLModeler.java:231)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:196)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:103)
    at com.sun.xml.rpc.processor.config.ModelInfo.buildModel(ModelInfo.java:77)
    at com.sun.xml.rpc.client.dii.ServiceInfoBuilder.getModel(ServiceInfoBuilder.java:96)
    at com.sun.xml.rpc.client.dii.ServiceInfoBuilder.buildServiceInfo(ServiceInfoBuilder.java:59)
    at com.sun.xml.rpc.client.dii.ConfiguredService.<init>(ConfiguredService.java:44)
    at com.sun.xml.rpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:32)
    at JAXRPCClient.main(JAXRPCClient.java:20)
    My wsdl file is
    - <definitions targetNamespace="java:com.mountain.molehill.ejb.controller" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:tns="java:com.mountain.molehill.ejb.controller" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
    - <types>
    <schema targetNamespace="java:com.mountain.molehill.ejb.controller" xmlns="http://www.w3.org/1999/XMLSchema" />
    </types>
    - <message name="getPointBalanceRequest">
    <part name="arg0" type="xsd:string" />
    </message>
    - <message name="getPointBalanceResponse">
    <part name="return" type="xsd:string" />
    </message>
    - <portType name="WSManagerPortType">
    - <operation name="getPointBalance">
    <input message="tns:getPointBalanceRequest" />
    <output message="tns:getPointBalanceResponse" />
    </operation>
    </portType>
    - <binding name="WSManagerBinding" type="tns:WSManagerPortType">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
    - <operation name="getPointBalance">
    <soap:operation soapAction="urn:getPointBalance" />
    - <input>
    <soap:body use="encoded" namespace="urn:WSManager" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </input>
    - <output>
    <soap:body use="encoded" namespace="urn:WSManager" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </output>
    </operation>
    </binding>
    - <service name="WSManager">
    <documentation>todo</documentation>
    - <port name="WSManagerPort" binding="tns:WSManagerBinding">
    <soap:address location="http://blrkec17805:7001/WS/rpc_URI" />
    </port>
    </service>
    </definitions>
    Could anybody help me in resolving this problem?
    Thanks in advance,
    Rajadurai

    Hello,
    edit the wsdl file and change 'http://www.w3.org/1999/XMLSchema' to 'http://www.w3.org/2001/XMLSchema' for both xmlns:xsd and xmlns then try again.
    Andre

  • Tuxedo client calls Tuxedo server using FML32

    I used a Tuxedo client calling a Tuxedo Server.
    Tuxedo server:
    It receives FML32 buffer and parse the info from ui_fml.h, e.g.
    #define     UI_SID     ((FLDID32)33852433)     /* number: 298001     type: long */
    #define     UI_NAME     ((FLDID32)33852434)     /* number: 298002     type: long */
    #define     UI_TEST     ((FLDID32)33852435)     /* number: 298003     type: long */
    In server code:
    void TEST(TPSVCINFO *rqst) {
    char line[200];
    long len = sizeof(line);
    FBFR32 bfr = (FBFR32) rqst->data;
    Fget32(bfr, UI_TEXT, 0, line, (FLDLEN32*)&len);
    printf("Fstrerror32(Ferror32)=[%s]\n", Fstrerror32(Ferror32);
    In Tuxedo client code:
    int main(int argc, char* argv[]) (
    char *sendbuf;
    if (tpinit((TPINIT *) NULL) == -1) {
              (void) fprintf(stderr, "tpcall2X:Tpinit failed\n");
              exit(1);
    if((sendbuf = (FBFR32 *) tpalloc("FML32", NULL, BUFLEN)) == (FBFR32*) NULL) {
              (void) fprintf(stderr,"Error allocating send buffer\n");
              tpterm();
              exit(1);
    len = Fsizeof32(sendbuf);
    if (-1 == Finit32(sendbuf, (FLDLEN32)len)) {
              tpfree((char*)sendbuf);
              exit(1);
    ret = tpcall("TEST", (char *)sendbuf, 0L, &rcvbuf, &rcvlen, 0);
    The server returns "Fstrerror32(Ferror32)=[LIBFML_CAT:2: ERROR: Buffer not fielded]", while the client works well.
    What are the reason? How to change that?
    Thanks.

    Hi Bill,
    Your problems are mostly in the client. You allocate sendbuf as an FML32 buffer, but then proceed to strcpy() into it which won't work. To manipulate the contents of an FML/FML32 buffer you must use the FML routines. So removing the strcpy(sendbuf, temp) in the client and replacing it with Fadd32(sendbuf, UI_TEXT, temp, sendlen) allows your application to work.
    By the way, in general you shouldn't need to be doing all the memset() calls you are doing. The extraneous stuff in buffers will be ignored, and certainly never memset() an FML32 buffer as it is not simply a bunch of bytes, but a complex dynamic structure that Tuxedo maintains.
    Finally on the server side, I couldn't get this line to compile as I indicated earlier:
    memset(out.out, 0, 4096);
    so I don't know how that is compiling for you, but the GCC compiler will not accept that, nor does it even make sense.
    Regards,
    Todd Little
    Oracle Tuxedo Chief Architect
    PS Here is the exact code that worked on my system:
    Server:
    #include <string.h>
    #include <stdio.h>
    #include <ctype.h>
    #include <atmi.h>     /* TUXEDO Header File */
    #include <userlog.h>     /* TUXEDO Header File */
    #include "bill.h"
    #if defined(__STDC__) || defined(__cplusplus)
    tpsvrinit(int argc, char *argv[])
    #else
    tpsvrinit(argc, argv)
    int argc;
    char **argv;
    #endif
         /* Some compilers warn if argc and argv aren't used. */
         argc = argc;
         argv = argv;
         /* userlog writes to the central TUXEDO message log */
         userlog("Welcome to the simple server");
         return(0);
    #ifdef __cplusplus
    extern "C"
    #endif
    void
    #if defined(__STDC__) || defined(__cplusplus)
    TEST(TPSVCINFO *rqst)
    #else
    TEST(rqst)
    TPSVCINFO *rqst;
    #endif
    char line[200];
    char *out;
    long n,len;
    FBFR32 *bfr = (FBFR32*) rqst->data;
    out = tpalloc("X_OCTET", NULL, 4096);
    memset(out, 0, 4096);
    memset(line , 0, sizeof(line));
    Fget32(bfr, UI_TEXT, 0, line, (FLDLEN32*)&len);
    printf("Fstrerror32(Ferror32)=[%s]\n", Fstrerror32(Ferror32));
    printf("line=[%s]\n", line);
    n = sprintf(out, "success");
    tpreturn(TPSUCCESS, 0, out, n, 0);
    }And the client:
    #include <string.h>
    #include <stdio.h>
    #include <atmi.h>
    #include "bill.h"
    #define BUFLEN 2400
    int main(int argc, char* argv[])
    char *sendbuf, *rcvbuf, service[15];
    long sendlen, rcvlen;
    int ret, i;
    char *result;
    char temp[2000];
    FLDLEN32 len = 0;
    if (tpinit((TPINIT *) NULL) == -1) {
    (void) fprintf(stderr, "tpcall2X:Tpinit failed\n");
    exit(1);
    if((sendbuf = (FBFR32 *) tpalloc("FML32", NULL, BUFLEN)) == (FBFR32*) NULL) {
    (void) fprintf(stderr,"Error allocating send buffer\n");
    tpterm();
    exit(1);
    if((rcvbuf = (char *) tpalloc("X_OCTET", NULL, BUFLEN)) == NULL) {
    (void) fprintf(stderr,"Error allocating receive buffer\n");
    tpfree(sendbuf);
    tpterm();
    exit(1);
    len = Fsizeof32(sendbuf);
    if (-1 == Finit32(sendbuf, (FLDLEN32)len))
    tpfree((char*)sendbuf);
    tpfree((char*)rcvbuf);
    exit(1);
    /* memset(rcvbuf, 0, sizeof(rcvbuf));
    memset(service, 0, sizeof(service));
    memset(temp, 0, sizeof(temp));
    strcpy(service, "TEST");
    strcat(temp, "(FLDID(168070265)) test \n\n");
    sendlen = (long)strlen(temp);
    strcpy(sendbuf, temp);
    Fadd32(sendbuf, UI_TEXT, temp, sendlen);
    printf("TEST call [%s] begin.\n", service);
    printf("sendbuf len=[%d]\n",sendlen);
    ret = tpcall(service, (char *)sendbuf, 0L, &rcvbuf, &rcvlen, 0);
    printf("ret=[%d]\n", ret);
    if(ret == -1) {
    printf("tpcall [%s] failed.\n", service);
    printf("Tperrno = %d, %s\n", tperrno, tpstrerror(tperrno));
    tpfree(sendbuf);
    tpfree(rcvbuf);
    tpterm();
    exit(1);
    printf("Returned string is: [%s]\n", rcvbuf);
    printf("tpcall successs.\n");
    /* Free Buffers & Detach from System/T */
    tpfree(sendbuf);
    tpfree(rcvbuf);
    tpterm();
    return(0);
    }

  • Calling web service using ksoap2

    Hello Friends,
    I am writing a Java client which uses ksoap2. I am new to web services and ksoap2. The WSDL is like this
    <?xml version="1.0" encoding="utf-8"?>
    <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://leaguematch.com/matchwatch/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://leaguematch.com/matchwatch/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://leaguematch.com/matchwatch/">
    <s:element name="WebServiceInfo">
    <s:complexType />
    </s:element>
    <s:element name="WebServiceInfoResponse">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="1" maxOccurs="1" name="WebServiceInfoResult" type="tns:Information" />
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:complexType name="Information">
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="ServiceName" type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="SupportPhone" type="s:string" />
    </s:sequence>
    </s:complexType>
    <s:complexType name="Credential">
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="Email" type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="Password" type="s:string" />
    </s:sequence>
    </s:complexType>
    <s:element name="GetScore">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="1" maxOccurs="1" name="credValidate" type="tns:Credential" />
    <s:element minOccurs="1" maxOccurs="1" name="MyScript" type="tns:ScriptData" />
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:complexType name="ScriptData">
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="sScriptCode" type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="sScriptName" type="s:string" />
    </s:sequence>
    </s:complexType>
    <s:element name="GetScoreResponse">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="1" maxOccurs="1" name="GetScoreResult" type="s:boolean" />
    <s:element minOccurs="1" maxOccurs="1" name="MyScript" type="tns:ScriptData" />
    </s:sequence>
    </s:complexType>
    </s:element>
    </s:schema>
    </wsdl:types>
    <wsdl:message name="WebServiceInfoSoapIn">
    <wsdl:part name="parameters" element="tns:WebServiceInfo" />
    </wsdl:message>
    <wsdl:message name="WebServiceInfoSoapOut">
    <wsdl:part name="parameters" element="tns:WebServiceInfoResponse" />
    </wsdl:message>
    <wsdl:message name="GetScoreSoapIn">
    <wsdl:part name="parameters" element="tns:GetScore" />
    </wsdl:message>
    <wsdl:message name="GetScoreSoapOut">
    <wsdl:part name="parameters" element="tns:GetScoreResponse" />
    </wsdl:message>
    <wsdl:portType name="matchwatchSoap">
    <wsdl:operation name="WebServiceInfo">
    <wsdl:input message="tns:WebServiceInfoSoapIn" />
    <wsdl:output message="tns:WebServiceInfoSoapOut" />
    </wsdl:operation>
    <wsdl:operation name="GetScore">
    <wsdl:input message="tns:GetScoreSoapIn" />
    <wsdl:output message="tns:GetScoreSoapOut" />
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="matchwatchSoap12" type="tns:matchwatchSoap">
    <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="WebServiceInfo">
    <soap12:operation soapAction="http://leaguematch.com/matchwatch/WebServiceInfo" style="document" />
    <wsdl:input>
    <soap12:body use="literal" />
    </wsdl:input>
    <wsdl:output>
    <soap12:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="GetScore">
    <soap12:operation soapAction="http://leaguematch.com/matfchwatch/GetScore" style="document" />
    <wsdl:input>
    <soap12:body use="literal" />
    </wsdl:input>
    <wsdl:output>
    <soap12:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="matchwatch">
    <wsdl:port name="matchwatchSoap" binding="tns:matchwatchSoap">
    <soap:address location="http://www.leaguematch.com.au/matchwatch/matchwatch.asmx" />
    </wsdl:port>
    <wsdl:port name="matchwatchSoap12" binding="tns:matchwatchSoap12">
    <soap12:address location="http://www.leaguematch.com.au/matchwatch/matchwatch.asmx" />
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    This is how I get the data from the web service with J2SE platform
    javax.xml.ws.Holder<com.leaguematch.matchwatch.ScriptData> myScript = new
    javax.xml.ws.Holder<com.leaguematch.matchwatch.ScriptData>();
    com.leaguematch.matchwatch.ScriptData scData = new com.leaguematch.matchwatch.ScriptData();
    scData.setSScriptCode(jTextField1.getText());
    myScript.value = scData;
    javax.xml.ws.Holder<Boolean> getScoreResult = new javax.xml.ws.Holder<Boolean>();
    port.getScore(credValidate, myScript, getScoreResult);
    What is the equivalent for JavaME platform? This is what I tried.
    SoapObject credential = new SoapObject(nameSpace, "Credential");
    credential.addProperty("Email", new String("[email protected]"));
    credential.addProperty("Password", new String("[email protected]"));
    SoapObject scriptData = new SoapObject(nameSpace, "ScriptData");
    scriptData.addProperty("sScriptCode", new String("GROUND1"));
    request.addProperty("credValidate", credential );
    request.addProperty("MyScript", scriptData);
    request.addProperty("getScoreResult", getScoreResult);
    // serialize the envelope
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.bodyOut = request;
    envelope.setOutputSoapObject(request);
    //make the call
    // set up the transport
    HttpTransport ht = new HttpTransport(endPointURL);
    ht.debug = true;
    ht.call("http://leaguematch.com/matchwatch/GetScore", envelope);
         The server responded
         SoapFault - faultcode: 'soap:Server' faultstring: 'System.Web.Services.Protocols.SoapException:
         Server was unable to process request. ---> System.Exception: You must pass Script Code in
         MyScript.sScriptCode:=ScriptData.sScriptCode to execute GetScore successfully
    I am able to get data using "WebServiceInfoResponse" method.
    But to getScore, I don't know how to pass the credential and scriptData to the web services and get its result ?
    Please help
    Sudheer Palaprambil

    Hello,
    I am not able to access the link you posted about calling a web service. Could please share your code again ?
    Thanks in advance for your help...
    Lionel

Maybe you are looking for

  • XML files from ABAP programs

    Hi everyone! Is there a way in ABAP to output XML files?  Pls. send code/ function module if any. From ABAP programs, we are sure that we can output TEXT files, but how about XML files? The significance of this question is related Currently we are us

  • Single page view not working.

    Hi, everyone. I have created a book using Blurb's template for InDesign. After I finished the book I exported it as a PDF file and wanted to review it on my notebook and iPad but Acrobat only displays it in two page view (the 'spread' as InDesign ref

  • Visio 2013 Ribbon not visible

    I have installed Visio Professional 2013 on a Windows 7 Pro Virtual  Machine (Apple OS 10.9.2 as the host, VMWare Fusion 4.1.4). Needless to say, all software is genuine :-).  When I open Visio, the  startup screen is simply dark grey. The various do

  • New to Visual Studio 2008, not new to CR - but have  question

    Hi, I started a position to build reports for a small company.  They use VS 2008 and Crystal 2008 (basic).  I am not new to Crystal Reports, been using it since version 4.0.  But I am new to integrating it into Visual Studio or using it to deploy rep

  • JTextPane and HyperLinks

    I've got a JTextPane that reads in htm file. It displays fine, but the hyperlinks though underlined and blue do not behave like hyperlinks. Any ideas? import java.applet.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java