Java web service with php SOAP client

Hi!
I have a Java web service with a procedure, which connects to a database:
public boolean connectDB(String driver,String host, String user, String password)
try {
Class.forName(driver);
connection =
DriverManager.getConnection
host
, user
, password
return true;
} catch (Exception v_exception) {
System.out.println("connectDB(): " + v_exception);
return false;
If I call it from a PHP client, it doesn't work but doesn't throw any exceptions on the server side.
The way I call it:
$client = new SoapClient
(<path>);
try
$conn=$client->connectDB();
catch (SoapFault $exception)
echo "\nexception: " .$exception;
On the client side, I have an exception, but it's not very detailed:
exception: Object id #2
I had a simple function, too, which returns a string:
public String getTestString()
return "test";
and if I call it from PHP, it's working...
What may be the problem?

Neither the simple "setter" methods work.. :(
The php client side:
$string="aladar";
$client->setSample($string);
$return = $client->getSample();
The server side:
public String sample;
public String getSample() {
return sample;
public void setSample(String a_sample) {
sample = a_sample;
Any ideas?

Similar Messages

  • Web Service with attachments (SOAP with attachments) without PI

    Hi,
    Is it possible to send across file(say PDF) using ABAP web services. I know it can be done with Java using SOAP with attachments. Is something similar available for ABAP ? since if we transfer raw binary data as type string / xstring it may have a performance impact.
    I could not see any option for attachments when using web service wizard from SE37 / soamanager
    Note I am not using PI, this Web service would be consumed by a 3rd party tool. There is very little material available on transferring files using web service with SOAP attachments.
    Regards,
    Aditya

    Hi thanks for your input, but did you have to encode your binary data stream in say Base64 / utf-8 ? Also if you are transferring files in bulk(say 10 -100 files)  how does your web  service indicate end of one file or what is the best way so as to avoid performance problems.
    Regards,
    Aditya

  • Web Services with REST, SOAP and  JAX-RPC

    Hi,
    Can somebody who has developed web services extensively comment/suggest a java development environment that works best for developing web services mainly with REST. I've found that Eclipse with Axis2 and Tomcat works well. But I would like to get your opinion on it and some other alternatives.

    Hi,
    Please help me its urgent.
    can u give me a detail example how to do Web services
    with REST.
    Here is my id [email protected]
    Thanks in advance.You can do this in many ways. It depends on how heavy your service is. You can write a simple servlet that will take a REST (I'm assuming you know what REST is) request and parses it out, calls a server-side method and generates a REST response.
    Another way is to use a web-service container such as AXIS. You can read some examples and documentation on their website. AXIS2 has REST support as well.

  • Consuming Java Web Service with complex return types

    Hi,
    I'm consuming a Java Web Service and the return I get in
    ColdFusion is a typed Java Object (with custom Java classes like
    com.company.project.JavaClass ...)
    Within this object I don't get direct accessible properties
    as when I'm consuming ColdFusion Web Services, instead I get a
    getPROPERTYNAME and setPROPERTYNAME method for each property.
    How can I handle this? I don't want to call this methods for
    each property (and there are nested objects with arrays of custom
    classes below, which would really make this complicated).
    What's the best way to cope up with this?
    Thanks a lot,
    Fritz

    The web service is actually the function, not the cfc and you
    didn't show a function.
    My own opinion is that since webservices by definition should
    be available to any calling app (cold fusion, .net, flash, etc),
    whatever gets returned from the method should be as universally
    recognizable as possible. This generally means text, numbers,
    boolean, or xml.

  • Invoking web service with customized SOAP Header

    Hi,
    how can I invoke web services from my BPEL process with additional elements in the SOAP Header?
    Regards,
    Piotr

    I don't know if I completely understand your question, but here is an attempt at and answer.
    It place variables in the SOAP Header open the invoke popup, click on the Adapters tab and select the variable that you would like to add into the SOAP header.
    I really hope that helps.
    Chris

  • Web service with login soap action

    Hi !
    I would an explanation if the XI soap adapter can resolve the web service's flow below:
    1 - soap action login with the first wsdl;
    2 - reception of the session header;
    3 - when the soap action that needs be called to solve, the session header (cookie saved) must be written inside the http protocol header (from the cookie saved) and after that to send with the second wsdl.
    If there are another thing  to resolve, I would thank about.
    Thanks for your attention.

    Hi thanks for your input, but did you have to encode your binary data stream in say Base64 / utf-8 ? Also if you are transferring files in bulk(say 10 -100 files)  how does your web  service indicate end of one file or what is the best way so as to avoid performance problems.
    Regards,
    Aditya

  • Java Web Service with Java 1.4

    I had been using JAX-RPC (DII) and Dynamic Proxy to call Sharepoint web service. I can make it work with static web service but not dynamic web service.
    I am just seeking for other web service technology to work on dynamic web service. Do you think Axis2 or jax-ws works with ajava 1.4?
    Thanks.

    Cristian,
    Please post the question in relevant forum
    Thanks
    Bala Duvvuri

  • Java Web Service "clears" sop:Include/ from SOAP Body?

    I have a Java Web Service which processes SOAP Messages with MIME attachments. The references to the attachments are using XOP (XML-binary Optimized Packaging) specification.
    The XML Schema for the SOAP Body content imports the namespace "http://www.w3.org/2004/08/xop/include", but it is not its main target namespace. When I run the service and view the HTTP packet through HTTP Analyzer, the SOAP Envelope looks like this:
    <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xmlns:ns0="http://www.ACORD.org/Standards/AcordMsgSvc/1"
                  xmlns:xop="http://www.w3.org/2004/08/xop/include"
                  xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <env:Header>
        </env:Header>
        <env:Body>
            <ac:CallRq xmlns:ac="http://www.ACORD.org/Standards/AcordMsgSvc/1">
                <ac:WorkFolder>
                    <ac:MsgFile>
                        <ac:FileId>
    <sop:Include href="cid:93609df7-d718-4801-bab9-57e3fd9cc5b5"
    xmlns:sop="http://www.w3.org/2004/08/xop/include"
    xsi:schemaLocation="http://www.w3.org/2004/08/xop/include http://www.w3.org/2004/08/xop/include"/>
    </ac:FileId>
                        <ac:FileFormatCd>text/xml</ac:FileFormatCd>
                    </ac:MsgFile>
                </ac:WorkFolder>
            </ac:CallRq>
        </env:Body>
    </env:Envelope>But when I access the java.xml.soap.SOAPMessage object in handleRequest(MessageContext) method of the Web Service's handler I get the following:
    <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xmlns:ns0="http://www.ACORD.org/Standards/AcordMsgSvc/1"
                  xmlns:xop="http://www.w3.org/2004/08/xop/include"
                  xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <env:Header>
        </env:Header>
        <env:Body>
            <ac:CallRq xmlns:ac="http://www.ACORD.org/Standards/AcordMsgSvc/1">
                <ac:WorkFolder>
                    <ac:MsgFile>
                        <ac:FileId>
    </ac:FileId>
                        <ac:FileFormatCd>text/xml</ac:FileFormatCd>
                    </ac:MsgFile>
                </ac:WorkFolder>
            </ac:CallRq>
        </env:Body>
    </env:Envelope>As you can see, the <sop:Include/> element has disappeared.
    Does anyone has an idea why this happens?
    Thank you!
    Simeon

    Neither the simple "setter" methods work.. :(
    The php client side:
    $string="aladar";
    $client->setSample($string);
    $return = $client->getSample();
    The server side:
    public String sample;
    public String getSample() {
    return sample;
    public void setSample(String a_sample) {
    sample = a_sample;
    Any ideas?

  • Java Web Services Security with 10.1.2.1

    I have developed a Java Web Service with J Developer 10.1.2.1 which was deployed onto Oracle 10.1.2.1 application server. Now I have to implement Security for this Web Service (similar to ws-security etc.,), how I can achieve Security with 10.1.2.1?
    J Developer 10.1.3.1 seems to have the feature to implement Web Service Security, but a Java Web Service developed using J Developer 10 .1.3.1 with security enabled cannot be deployed onto Oracle 10.1.2.1 application server.
    Please help as how I can implement Java Web Service Security with 10.1.2.1?
    Email: [email protected]
    Thanks for the help in advance.

    You can use Oracle Web Services Manager to virtualize the end point and still implement WS-Security.
    Thanks
    Ram

  • Biztalk 2010 - Consume Web Service with Certificate

    Hi
    I have to consume a java web service with Biztalk that requires authentication via a client certificate. Until now I have not been able to consume any web service where any kind of authentication was needed. Simple web services without authentication are
    no problem. Also using SoapUI works perfectly fine.
    I am generating the XSDs and the port binding with the WCF wizard in VS2010. I've read several comments that it's not possible to consume web services with the WCF-WSHttp adapter when the message format should be SOAP 1.1. Therefore I'm trying with the WCF-BasicHttp
    and WCF-Custom adapters, but I did not suceed in receiving a positive response yet.
    The web service I want to consume uses a client certificate (with a private key) and two root certificates. When I use the BasicHttp adapter I choose either 'Transport' or 'TransportWithMessageCredential' but none of them work. I also have to supply a client
    and a service certificate. I always use the one with the private key for the client but I'm not sure which one I have to use for the service. Is there a possibility that I have to provide both root certificates and if so, how can I achieve this?
    Hope the question makes sense somehow... thanks for any input.
    Error message that I receive currently is that the server needs a client certificate. However I attached it in the send port properties under the tab "Security" => mode "TransportWithMessageCredential".

    Adapter: WCF-Custom
    Binding: customBinding
    Cannot send pictures (yet).
    <configuration>
    <enterpriseLibrary.ConfigurationSource selectedSource="ESB File Configuration Source" />
    <system.serviceModel>
    <client>
    <endpoint address="...." behaviorConfiguration="EndpointBehavior" binding="customBinding" bindingConfiguration="ReceiptBinding" contract="BizTalk" name="WebServicePort" />
    </client>
    <behaviors>
    <endpointBehaviors>
    <behavior name="EndpointBehavior">
    <clientCredentials>
    <clientCertificate findValue="..." x509FindType="FindByThumbprint" />
    <serviceCertificate>
    <defaultCertificate findValue="..." storeLocation="LocalMachine" storeName="AuthRoot" x509FindType="FindByThumbprint" />
    </serviceCertificate>
    </clientCredentials>
    </behavior>
    </endpointBehaviors>
    <serviceBehaviors>
    <behavior name="ServiceBehavior" />
    </serviceBehaviors>
    </behaviors>
    <bindings>
    <customBinding>
    <clear />
    <binding name="ReceiptBinding">
    <textMessageEncoding messageVersion="Soap11" />
    <security authenticationMode="MutualCertificate" />
    <httpsTransport proxyAuthenticationScheme="Basic" requireClientCertificate="true" />
    </binding>
    </customBinding>
    </bindings>
    </system.serviceModel>
    </configuration>

  • Using message-style web service by a Microsoft client

    Does anyone have a sample Microsoft client using message-style web service? BEA
    does not provide one. I found MS client does not receive messages published between
    2 calls to method "receive", while the sample Java client ConsumerClient.java
    does.
    ConsumerClient.java is like:
    while(true){
    Object result = method.invoke(null);
    sleep(20000); // not in sample, added for my test
    System.out.println(result);
    My VBScript code is like:
    Set SC = CreateObject("MSSOAP.SoapClient")
    SC.mssoapinit "http://localhost:7001/msg/Receiver/Receiver.wsdl", "", "", ""
    While TRUE
    Res = SC.receive
    WScript.echo "Res = " & Res     
    Res = ""
    ' do something that takes 20 seconds
    Wend
    I added 20 seconds between calls so I can publish a message between 2 calls. I
    found the Java client receives the message but the VBScript client doesn't. Has
    anyone else observed this?

    Hi Kevin,
    Thanks for your feedback.
    Header support is planed for the next major release.
    regards,
    -manoj
    Kevin Jiang wrote:
    Hi Manoj,
    Can you use SOAP header to pass session id accross instead of HTTP header? MS
    SOAP toolkit 2.0 support access to SOAP header.
    My app needs to use topic instead of queue. But as I said earlier, I can use MS
    XML toolkit to access HTTP header. So I have a work around.
    Thanks for all your responses with regard to this question!
    Kevin
    manoj cheenath <[email protected]> wrote:
    Hum! i thought you were not able to receive message at all. now
    i understood the problem. yes we are using http header to pass
    session id accross, in the case of web service client who wants
    to subscribe to JMS topics. I cant think of any other way to do
    this. if you have any suggestions, i very much like to hear it.
    for your application is it possible to use queues instead of topics?
    we do not use http session information in the case of JMS queues.
    -manoj
    Kevin Jiang wrote:
    Hi Manoj,
    Your sample code is basically same as mine. It would also lose messagespublished
    between calls to "receive" method.
    I figured out what's going on. Undocumented by BEA, the web servicesends JMS
    session ID in HTTP header along with first message. When client makessubsequent
    calls to "receive", this ID must be sent back. I found this by usinga SOAP trace
    tool.
    Unfortunately, MS SOAP toolkit doesn't support access to HTTP header.So one has
    to use MS XML toolkit to use message-style web service, when writingMS clients.
    manoj cheenath <[email protected]> wrote:
    an example of using message style web services with
    ms soap toolkit is attached. let me know if this works
    for you.
    regards,
    -manoj
    Kevin Jiang wrote:
    Hi Manoj,
    I just changed anyType to string and the problem still happens.
    Thanks,
    Kevin
    manoj cheenath <[email protected]> wrote:
    I have not tryed message style web services with MS soap toolkit.
    I think the problem is because the WSDL for the message style
    web service use xsd:anyType as the return type and MS soap is
    not able to understand it. can you pls modify the xsd:anyType to
    xsd:string (or someother base type) in the WSDL.
    SC.mssoapinit can load wsdl stored as a local file. so it should
    be easy to make this change.
    regards,
    -manoj
    Kevin Jiang wrote:
    Does anyone have a sample Microsoft client using message-style
    web
    service? BEA
    does not provide one. I found MS client does not receive messages
    published
    between
    2 calls to method "receive", while the sample Java client ConsumerClient.java
    does.
    ConsumerClient.java is like:
    while(true){
    Object result = method.invoke(null);
    sleep(20000); // not in sample, added for my test
    System.out.println(result);
    My VBScript code is like:
    Set SC = CreateObject("MSSOAP.SoapClient")
    SC.mssoapinit "http://localhost:7001/msg/Receiver/Receiver.wsdl",
    While TRUE
    Res = SC.receive
    WScript.echo "Res = " & Res
    Res = ""
    ' do something that takes 20 seconds
    Wend
    I added 20 seconds between calls so I can publish a message between2 calls. I
    found the Java client receives the message but the VBScript clientdoesn't. Has
    anyone else observed this?

  • Error when calling Java Web Services from ABAP.

    Hello experts:
        In my project, I will call Java Web Services with ABAP coding. With WSDL, I generated a proxy class and created a HTTP connection (t-code: SM59) and a logical port (t-code:lpconfig) for this proxy class. But when running, I would receive the folllowing errors:
       SOAP:1.023 SRT: Processing error in Internet Communication Framework: ("ICF Error when receiving the response: HTTP COMMUNICATION FAILURE")
       If I used HTTPS, there is no problem.
    Regards
    Bob

    Hi Bob,
    It might be the possibility that your java web server is configured to listen only on HTTPS.
    If your HTTPS is working fine, then first check with your JAVA server for HTTP connectivity, then try it calling through ABAP.
    Regards,
    Piyush

  • JAX-RPC Java Web Services

    In the tutorial
    Access J2EE 1.4 JAX-RPC Java Web Services from Web Clients
    http://www.oracle.com/technology/products/jdev/101/howtos/jaxrpc/java14_ws_web_clients.html#creating_web_service
    A MyWebService1SEI.java interface is also required to be added to generate a JAX-RPC Web service.

    The MyWebService1SEI.java interface does not get generated as indicated in the tutorial.
    If the Web service is generated with
    File>New>Business Tier>Java Web Service with the
    Autogenerate Service Endpoint Interface checkbox selected,
    the MyWebService1SEI.java interface does not get generated.
    The Autogenerate Service Endpoint Interface feature does not autogenerate java interface.

  • Using web service with our WP 8.1 app

    please i need help , for our graduation project we are making an app for tourism but in order to bring data we started to use web service with php and our professor told us to connect our app with something called json web service but I dunno how to do
    this i need any help any tutorial to do it a book or something please 

    I'd start with the documentation:
    How to connect to an HTTP server using Windows.Web.Http .

  • Using a Java Web Service in a BPEL Process

    Hello.
    I am newie with Oracle Soa Suite and BPEL process and i have problems. I have developed a Java Web Service, first developing the Java Class and then using the wizard to create a Java Web Service.
    Now i want to develope a BPEL Process that use this Java Web Service. I have tried it with the component Partnert Link from de palette and looking for the java web service wsdl file. I have tried it with the component Java Web Service from the palette. In both of them, it happens the same, it appears erros looking for the wsdl or looking for something that the wsdl use. If someone could try it. Its easy. Create a Java class with one simple method. Create A java web service with the wizard. Then create a BPEL process and try to use it with a partner link.
    I have been trying it one week...
    Thank you in advance.

    Hi
    You can use a java web service to publish a Web service from a Java class.
    A wizard creates the WSDL document and deployment files needed to publish your code as a Web service. After you select the class and methods you want to publish, the wizard generates deployment descriptors, a JAX-RPC mapping file, and a WSDL document that can be deployed to an application server.
    You can refer : \bpel\samples\tutorials\102.InvokingProcesses\ws sample to invoke a WS using JAX-RPC Call.
    Hope that helps!
    Cheers
    A

Maybe you are looking for

  • Logon Error while importing data

    Hello, I have "Countries" flat table in my repository containing 2 fields Name & ISO Code. I wanted to import data i.e. Name & ISO Code in this flat table via Import Manager. I have excel file containing Name & ISO Code data. While importing data, I

  • My Grandson has had his ipod touch stolen. The tracker device shows it in a front garden of another road - but it isn't. How accurate is the tracker device please?

    My Ipod touch has been stolen. The tracker shows it to be in a  front garden of a road nearby. But it is not there. How accurate is the tracker deviceand should I report it to the police please?

  • Help in copy command

    Hi Can i use parallel and append hint in while inserting data through copy command in sqlplus? My databse version is Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production PL/SQL Release 9.2.0.4.0 - Production CORE 9.2.0.3.0 Production TNS

  • Attach document to marketing and campaign in document tab

    Hi All, I hv the scenario like within marketing we have some sub departments, these sub depts will have to attached some documents to plan and send it to marketing manager for approval, this is the scenario. The mktg planner is heading by Mktg Mngr a

  • TOC Auto Collapse

    Hi, Anyone know how to change the code of the toc code to do the following: Click on Book A and it opens. Click on book B and B opens and A closes. I saw a post where you could create a button to get is to do it, is there an automatic way? Thanks for