How to make a WORKING J2ME Web Services client?

Hi everyone,
I'm trying to make my first J2ME client for web services (well, I need it for my degree thesis, so I'm a little bit DESPERATE) but I've got a lot of problem that I don't understand, even with samples downloaded from web tutorials and from xmethods.net.
The problem is with the generation of Stub classes:
if I try to make the Java Wireless TollKit 2.2 to generate them and then I run the midlet in the JWTK emulator there's no problem, but when I try to do the same thing with the Nokia Developer's Suite 3.0 I've got a lot of problems, first of all the java code generated for the stub is very different from the first one, it seem like a C# or J# code (and obviously Eclipse says that it's full of errors), so when I try to make the jar and jad files it doesn't work (because is not a right java code), so I made the stub classes using the JWTK2.2 Stub Generator and then I used the Nokia Dev's Suite 3.0 to build and package the midlet, but it says that it's not able to find the "class or resource javax/xml/rpc/Stub" even if the resource is present and used exactly as all the other packages, and it creates a jar file with just some of the classes but not all. At the end I tryed to run in the nokia emulators the midlet created by the JWTK 2.2, but it doesn't start, so I put the midlet on two diffent Nokia phones (6600 and 6630, because I need to make my client work on the 6630) but it seems to make the virtual machine to crash. I erased all the code lines invoking the stub classes and added them again one by one, until the midlet stoped again to work, and I understand that the problem seems to be with the invocation of the costructor of the stub class, but it doesen't make no sense, because the same code works properly on not-Nokia phones and emulators. I used many different wsdl files to create the stub classes for different web services, but there's always the same problems.
Help me please.

You will find some working code at :
http://ksoap.objectweb.org/software/downloads/index.html
It's code that use kSOAP and kXML implementations ....
If you will also find some useful information here :
http://developers.sun.com/techtopics/mobility/apis/articles/wsa/
http://www-106.ibm.com/developerworks/wireless/library/wi-jsr/
http://www-106.ibm.com/developerworks/wireless/library/wi-xmlparse/
Regards.

Similar Messages

  • NetBeans 5.5 j2me web service client...how to?

    Hi,
    I am new to web services and j2me, so this question might be very simple.
    I have created a project (simple web service) and tested it and all work ok...
    I try to create a midlet to consume this web service so I do the following:
    (1) Create a mobile->Mobile Application project
    (2) Add a new file-> j2me web service client
    (3) On running web service I insert the url of the wsdl of the previous web service
    (4) Press retrieve WSDL (everything seem to work ok up to this point)
    (5) I keep the check box Create Simple midlet checked
    A packet with two files is created: blablah.wsclient, blablablah.wsdl
    No midlet is created and when I try to create my own nothing I dont know how to access the web services methods...
    Is it a bug of netbeans 5.5?
    Can someone provide a link for a simple tutorial or at least make clear how to access the method of the web service?
    Thanx in advance!

    I'm facing the same problem with NetBeans 5.5.1 while I had no trouble with NetBeans 5.5 (I wonder why I updated :-( )
    I hope someone can help us.
    Best regards
    edit:
    It should be due JDK 1.6; I will try and I'll let you have my results.
    Rread this:
    http://www.netbeans.org/issues/show_bug.cgi?id=90112
    Edited by: NikJ2ME on Oct 13, 2007 5:05 AM

  • Problem creating J2ME web service client

    Hi,
    I am using netbeans (5 and 5.5 beta 2). I have created a web service which works fine. I also created a regular web service client as a standalone application which also works fine and connects to my web service with no problem.
    BUT, when I want to create a J2ME web service client (under a J2ME application) I have to locate my WSDL file. but the wizard shows me the error "WSDL file does not contain port information".
    By looking at the WSDL file I can see that port is created - or maybe I'm wrong.
    piece from WSDL file:
    <service name="myServiceName">
    <port name="myServiceSPort" binding="tns:TranslatorWSPortBinding">
    <soap:address location="myURLLocation"/>
    </port>
    </service>
    Please note that I have replaced the actual values in above piece
    I tried to use wsgen manually but it didn't help.
    Can anyone help me in generating the correct WSDL format as J2ME web service client expects?
    Thanks a lot,
    S.

    well stubs are generated separately using WTK 2.5 stub generator but the problem is with the WSDL at this point.
    S.

  • BigInteger in J2ME web service client

    I have a problem about sending parameter of BigInteger in J2ME web service client.
    To send a BigInteger as parameter web service, i change into array of byte then i change again into HexString.
    After that, the String value send to web service.
    The String value change into array of byte again then i build new object BigInteger.
    I think the way i try is correct, but in J2ME as web service client the value of BigInteger that i send has change.
    I tried in J2SE as web service client with the same way, then the value of BigInteger didn't changed.
    Is it the class BigInteger in library lcrypto-j2me (BouncyCastle) cannot apply into BigInteger in java?
    Or i've missing something???
    Thanks a lot for the answer...
    Best regards,
    Meis

    I have a problem about sending parameter of BigInteger in J2ME web service client.
    To send a BigInteger as parameter web service, i change into array of byte then i change again into HexString.
    After that, the String value send to web service.
    The String value change into array of byte again then i build new object BigInteger.
    I think the way i try is correct, but in J2ME as web service client the value of BigInteger that i send has change.
    I tried in J2SE as web service client with the same way, then the value of BigInteger didn't changed.
    Is it the class BigInteger in library lcrypto-j2me (BouncyCastle) cannot apply into BigInteger in java?
    Or i've missing something???
    Thanks a lot for the answer...
    Best regards,
    Meis

  • How do Flash Charts Work? Web Service?

    I am guessing that Flash Charts work by sending data to a macromedia web service, which takes the labels, values, and other input and returns the xhtml necessary to render the chart in the ApEx page. Can someone confirm this?
    Thanks,
    Gregory

    Gregory,
    Actually Apex uses AnyChart for flash charts:
    http://www.anychart.com/home/
    The basic idea is correct though, Apex generates XML that AnyChart then uses to render the chart.
    With Apex 4.0 we will get better looking charts via a newer version of AnyChart. However, if you don't want to wait, check this out:
    http://www.anychart.com/blog/2008/11/18/apex-evangelists-anychart-5-integration-kit-for-apex/
    Regards,
    Dan
    http://danielmcghan.us
    http://www.skillbuilders.com
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • How to make use of a web service using ABAP to transfer data to portal?

    Hello Experts,
    I've a requirement to call/use a web service from a user exit, and need to transfer/update some data to the ESS portal.
    Kindly let me know what are the steps involved?
    Thanks & Regards,
    Mallik

    Hi John,
    I did searched te forums and got some information on this.
    But I didnot understand it completely. I'm looking for a step by step process.
    Kindly let me know if you have anything useful for me.
    Thanks & Regards,
    Mallik

  • How to make WS-I compliant Web Services

    What is Oracle's recommended way to develop Web Services that fully conform to the WS-I standards using PRODUCTION RELEASES of Oracle's software (JDeveloper 10G and OracleAS 10G)?
    This is for a production site and it needs to be supported from Oracle. I assume that using "Developers Preview" versions of Oracle's software is not a solution.
    I was asked by Oracle Norway to put this question on this forum. I hope to have an answer before the end of the week.

    This is only my recommendation - not necessary Oracle's one.
    If you are using 10.1.2, your only option is to use the document-literal message format. The support for this is very limited in JDeveloper for building the server side: there is no wizard, and you will have to write it yourself as a POJA (Plain Old J2EE Application). Check my public blog after the weekend and you should find more info there.
    Your other option are: a) to look at BPEL Process Connect, which should be production very soon - They have good support for literal encoding, in general. b) to look at our current DP3 and double check your GoLive requirement - There is really a lot more available to build complex applications in the JAX-RPC stack.
    Hope this helps.
    Eric
    ps. Even so Rpc-Literal is part of WS-I, it'snot an option if you want to interop with .NET framework 1.1. Microsoft has such support in 2.0 beta with their GoLive license or in Indigo.

  • How many are J2me Web service programming masters?

    I have created demo web service successfully and checked in browser..
    when i tried to implement in j2me then :
    exception on invoking this line :
    resultObj = op.invoke(inputObject);
    exceptiuon is like this :
    Error : java.rmi.ServerException:
    [String: JAXRPC.TIE.04: Internal Server Error (JAXRPCTIE01: caught exception while handling request: java.lang.ClassCastException: com.sun.xml.messaging.saaj.soap.impl.TextImpl)]
    why this exception occur...
    note that this is my first j2me web service application..
    all the ideas releted this always welcome
    premal                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    hi,
    you can "borrow" the source code from [Yambo a free soft open source presentation engine (AKA XML microbrowser Xlet )|http://www.cineca.tv/labs/mhplab/index-en.html] both local and on a http remote connection.
    hope it helps..
    bye
    andrea

  • How to prevent downloading wsdl in weblogic web service client

    Hi,
    I get a problem regarding weblogic web service client. My working environment:
    weblogic server 8.1
    Windows XP SP2
    JDK 1.4
    I use the weblogic tool to generate the client jar file from the wsdl file.
         <target name="generate-client">
              <clientgen wsdl="ACCESS.wsdl"
                   packageName="xxxxxx.client"
                   clientJar="${client}/${AccessClient_jar_file}"
                   keepGenerated="true"
                   saveWSDL="true"
              />
              <javac srcdir="${source}"
              destdir="${client}"
              includes="**/AccessClient.java">
              <classpath>
              <pathelement path="${client}/${AccessClient_jar_file}"/>
              </classpath>
              </javac>
         </target>
    After that, I create a client java file to invoke the service deploy in the server.
    public static void main(String[] argv)
    throws Exception
         int transactionId = 100;
         int id = 1000;
    // Setup the global JAXM message factory
    System.setProperty("javax.xml.soap.MessageFactory", "weblogic.webservice.core.soap.MessageFactoryImpl");
    // Setup the global JAX-RPC service factory
    System.setProperty( "javax.xml.rpc.ServiceFactory", "weblogic.webservice.core.rpc.ServiceFactoryImpl");
    AccessServicePorts ws = new AccessServicePorts_Impl(argv[0]);
    AccessService port = ws.getAccessService();
    // Resource - create
    Resource resource = new Resource();
    resource.setRES_CD("Create ResCo");
    resource.setCODE_CODE("code_cod");
    resource.setRES_TYPE("Resource typ");
    resource.setCOMMON_FIELD(common);
    AccessDefaultResult resultItems = port.createResource(resource);
    System.out.println("createResource : " + resultItems);
    I find that this web service client always issue 2 http requests to invoke an web service method deployed in server.
    1st http reqeust:
    GET /AccessEpol/EpolServiceSoap?WSDL HTTP/1.1
    User-Agent: Java/1.4.2_08
    Host: 127.0.0.1:8001
    Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    Connection: keep-alive
    the return result is the wsdl downloaded from the server.
    2nd http request is the real web service request.
    The question is how could I eliminate the 1st http request because it's really unnecessary. I use other web service client like Axis 1.x, Axis client never has the http request to download the wsdl from the server.
    I read through weblogic web service document. It do mentions that put saveWSDL="true" in the clientgen ant task. the default value for saveWSDL is true already. I did try saveWSDL="false" also. None of them can eliminate the 1st http request.
    appreciate for any answer my question?

    Hi David,
    thanks for the reply.
    More or less I agree some points you mentioned above.
    I did use Axis 1.x to test the inter-operability. The web service was developed in Weblogic 8.1 and is a part of an existing web application. It will be merged to existing application deployed in weblogic 8.1.
    I also program the web service client to test the web service.
    The implementation of the server and client will be handed over the project team and training for supporting or continuous development have to be conducted by me. So I don't like to use two types of technologies which will make thing complex.
    I found this issue when I tried to protected the web service endpoint, eg http://localhost:7001/epol/service, using the web application Basic mechanism. The wsdl URL http://localhost:7001/epol/service?WSDL is also protected in this case. Unfortunately the username/password pair is not sent to the server when the weblogic client download the WSDL from the server. In this case, the client failed and throw exception.

  • How to deploy and debug java web service in eclipes or using any other soft

    Hai,
    can any one tell me how to deploy and debug java web service in eclipes or using any other software.
    i have used tomcat web server and jdk1.4.0 to develop web service.
    we have used web service to interact with MS outlook .
    bye
    sudhakar.m

    Hi Sudhakar,
    If you are used to working with ant then you can very well use eclipse to deploy your web service.
    You would usually have the ant script in the source root working directory. From eclipse if you select the build file from the navigator view and right click you will see a run ant option in the pop up menu.
    Select that option and you would be able to see each targets with a checkbox select option. So define each target maybe one for wsdl2java conversion, one for compilation and one for deploying your web services. You can either make all of them run by having depends option on or you can run them individually as it takes your fancy.
    I am not sure about debugging a web service yet.
    Hope this helps
    Aviroop
    The truth is out there? Does anyone know the URL?

  • Getting J2ME Web Services Going

    Hi,
    I am having trouble getting web services support going. I have downloaded the Wireless Toolkit and the test I am doing to see if it is working is trying to:
    import javax.microedition.xml.rpc;
    import javax.xml.namespace;
    import javax.xml.rpc;
    import java.rmi;
    and building the application, but I've been getting errors on these. I have tried adding some jars that I have downloaded (I've really been doing a bit of trial and error here) to my classpath, but I have been so far unsuccessful. Could anyone give me some advice on how to (or where I can find information on) getting the web services API's going?
    cheers and thanks in advance
    Jay

    Hi ,
    My basic things are not cleared about j2me-web services.
    Please Can you tell me, If we want to send custom/std object like StringBuffer/Calender using kSOAP, Do we need to serialize it?
    I am sending StringBuffer object as a part of "Vector", "Vector" is synchronized so I have put StringBuffer object in Vector. So Do I need to serialize StringBuffer object also?
    Please, give your valuable suggestions?
    Thanks
    Regards
    vikas khengare

  • Working with Web Service Security

    Hi... forum
    I really need your help.
    I created a web service client. with JDEV 10.1.3, when i crearted a function call i got this error
    javax.xml.rpc.soap.SOAPFaultException: SoapException
    at oracle.j2ee.ws.client.StreamingSender._raiseFault(StreamingSender.java:540)
    at oracle.j2ee.ws.client.StreamingSender._sendImpl(StreamingSender.java:390)
    at oracle.j2ee.ws.client.StreamingSender._send(StreamingSender.java:111)
    at com.ws.runtime.POSSoap_Stub.comprar(POSSoap_Stub.java:659)
    at com.ws.POSSoapClient.comprar(POSSoapClient.java:55)
    at com.ws.POSSoapClient.main(POSSoapClient.java:40)
    I debug the application and then get down in this line:
    send((String) getProperty(ENDPOINT_ADDRESS_PROPERTY), _state);
    i also using web Secure Proxy
    and i have another methor called ping and this work fine, but one method that needs webservice security doesn´t work.
    some body has work with Webservice Security ?
    How can i view the message that is sending ?
    i don´t know what´s happenning ?
    Can help me, please?
    thnks
    Josue

    HI Frank, thank you for your help...
    I run the HTTP analyzer and see the error.. the usernametoken doesn´t was put it...
    My proxy i put it like secure proxy and i check the option username token. but the service. doesn´t put me this tag.
    this the message send it.
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="urn:schemas-orbitel-com-co:pos">
    <env:Body>
    <ns0:SolicitudCompra>
    <ns0:IdTransaccion>123</ns0:IdTransaccion>
    <ns0:TipoTarjeta>Orbitel Europa</ns0:TipoTarjeta>
    <ns0:Localizacion>Colombia</ns0:Localizacion>
    <ns0:Valor>0</ns0:Valor>
    <ns0:ZonaHoraria>0</ns0:ZonaHoraria>
    </ns0:SolicitudCompra>
    </env:Body>
    </env:Envelope>
    And the error message is..:
    <soap:Fault>
    <faultcode>soap:Server</faultcode>
    <faultstring>SoapException</faultstring>
    <faultactor>urn:schemas-orbitel-com-co:pos</faultactor>
    <detail>
    <Error xmlns="urn:schemas-orbitel-com-co:pos">
    <Codigo>POS006</Codigo>
    <Descripcion>El UsernameToken no fue suministrado</Descripcion>
    </Error>
    </detail>
    </soap:Fault>
    Frank, what can i do. to put the usernametoken into the send message.. ?
    thnks four your help...
    thnks.
    Joshua

  • How can I call a SAPME web service from MII such as PlaceFutureHold?

    Dears,
    How can I call a SAPME web service from MII such as PlaceFutureHold?
    By using MII, I would like to develop some logic to check some values which query from SAPME database, if the value is out of spec, it needs to send a emal to inform user ans also hold the SFC.
    Thanks!

    With Web service action block you can view all ME available services
    in I.E
    https://sapme:5000/manufacturing-services/ProductionServiceService?wsdl  you could see your FutureHold service
    To do that in MII, you need Web Service action block. Have you work with MII transaction before?
    (saw your post in MII)

  • How to install and consume GroupWise Web Service (SOAP)

    Hello! I'm Razvan, programmer from Romnia, and I am new to GroupWise development.
    I am asking if anyone could help me with a C# Visual Studio 2010 example of how to install and consume GroupWise Web Service (SOAP).
    The documentation from novell site didn't help me, i didn't understant much of it.
    All I need is either a link to a documented GroupWise C# developer step-by-step tutorial, or some code examples.
    Can you please show me some code examples in C# with:
    1)loging in using a username and a password,
    2)retrieving contact list,
    3)retrieving appointment list,
    4)sending a mail,
    5)setting an appointment
    I don't know how to use "groupwise.wsdl" and customise it so that it points to our GroupWise server.
    Please, I really need this because I am working at a project right now which involves GroupWise integration.
    I hope I haven't disturbed anyone with my simple question.
    I know this might be a very simple question given the complexity of the other posts here, but that's why I really hope I will get an answer soon.
    Thank you very much!
    Signature:
    How old is the Orthodox faith?
    How old is the orthodox faith?

    Just a comment.
    The value for the version element should be "1.02"
    not "1.2".
    Preston
    >>> On Tuesday, March 01, 2011 at 8:06 AM,
    TheRomanian<[email protected]> wrote:
    > I have great news! After strong documentation yesterday and today, I've
    > just made a successfull example that actually connects to our GroupWise
    > server.
    >
    > I made it in PHP.
    >
    > I need an ASP.NET + C# application, but now is very simple to convert
    > it. I post the PHP code here for other people who in future might be
    > interested in finding out.
    >
    > So a simple PHP GroupWise Login code using "groupwise.wsdl" web
    > service:
    >
    >
    > require_once('./GWService/GroupwiseService.php');
    > require_once('FB.class.php');
    >
    > $classmap = array(
    > 'Authenication' => 'Authenication',
    > 'PlainText' => 'PlainText',
    > 'loginRequest' => 'loginRequest',
    > 'loginResponse' => 'loginResponse',
    > 'logoutRequest' => 'logoutRequest',
    > 'logoutResponse' => 'logoutResponse',
    > 'UserInfo' => 'UserInfo',
    > );
    >
    > $gwservice = new GroupwiseService(
    > "./WSDL/groupwise.wsdl",
    > array(
    > "location" => "http://11.150.40.78:8756/soap",
    > *Your GroupWise server IP:
    > and PORT*
    > "classmap" => $classmap,
    > "trace" => true)
    > );
    >
    > // do login
    > $pt = new PlainText();
    > $pt‑>username = *"YOUR GROUPWISE USERNAME"*;
    > $pt‑>password = *"YOUR GROUPWISE PASSWORD"*;
    >
    > $lr = new loginRequest();
    > $lr‑>auth = $pt;
    > $lr‑>language = "en";
    > $lr‑>version = "1.2";
    > $lr‑>application = "phpClient";
    >
    > $lres = $gwservice‑>loginRequest($lr);
    > //print_r($lres);
    >
    >
    > I Hope this will help others.
    >
    > ‑‑
    > Signature:
    >
    > How old is the Orthodox Faith?
    > 'How old is the orthodox faith?'
    > (http://www.orthodoxphotos.com/history.shtml)

  • Help me!    How to use it as a web service from third party application?

    After using JDeveloper to develop BSSV object e.g. JP550010, how to use it as a web service from third party application?
    TKS!

    Obviously the OP is working on a project for the Bead Society of Southeastern Virginia http://www.bssv.org. Oh, wait, maybe he's researching the Blueberry Shoestring Plant Virus http://abbreviations.yourdictionary.com/bssv
    :D
    John

Maybe you are looking for

  • ITunes Store Apps (etc) Page Numbers, Wish List For My iTunes Account

    Why doesn't the iTunes Store have page numbers under each page of the items (songs, e-books, apps, etc), because with over 200000 apps I will be damned if I am going to go back to the start of each apps category (for example) clicking in increments o

  • Validation on section code for FB60

    I want to apply a validation check on the section code field, which appears on the first screen on transaction -FB60 Program name - SAPMF05A Screen number- 1100. Have tried using a field exit, but does not help. Kindly suggest any userexit or any oth

  • Control Movement in JSplitPane

    Hi, I am building a application in JApplet, where in I have some data panel with fixed width on left side and corresponding Graph on right side which can also scroll horizontally , so I have two JScrollPanes and then add them to the JSplitPane, but n

  • HOW TO MAKE IMAGE TRANSPERANT

    Hello All, I have two images one as background and another one is to place on background image. Upper one I need transperant. How to write code to make image transperant? CAN ANY ONE HELP? Sharmila.

  • Killer sudoku has a fault because No 9 fills in the puzzle, any suggestions

    the app - killer sudoku has worked perfectly for months but now there is a fault on the number pad.  There is a double number 9 and when a use the number it completes the puzzle. Has anyone else had this problem and if so what did you do about it.  I