BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 08-16-2011, 05:36 PM   #1 (permalink)
New Member
 
Join Date: Aug 2011
Model: 8520
PIN: N/A
Carrier: Vodafone
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Problem using a java stub to consume a webservice

Please Login to Remove!

I'm trying to develop a javaME client for blackberry that consumes a web service.

I'm using blackberry plugin 1.3 for eclipse 3.6 (Helios) for the development. I've been provided a WSDL file for the WS and its URL. I've followed the steps described at a tutorial (Blackberry Application Development Part 2 (Stub Generator & Introduction to Eclipse)) and the guidelines of the article from Sun website about JavaME and WebServices.

So:

1. I used the JWT 2.5.2_01 with the wsdl file as an input and so created the stub files.

2. Imported the .java files to an eclipse blackberry project

3. Started developing my client application:
-basic ui app
-basic screens
-Istantiate the stub
-Check http availabillity

All good till that step. When i invoke a stub method for the first time (i.e. the one that implements a login operation) i catch an exception with the following message:

java.rmi.MarshalException : The end tag of either SOAP envelope or SOAP body is missing


Notes:

i) I'm using Blackberry JRE 4.5 to build the project and 1.3 compiler compliance. Tested with run configurations with BB JRE 4.5 , 6.0 , 7.0. BB 9900 or BB 9800 simulator with MDS on. Haven't tested on real device.

ii) Because the WSDL file had some xs:datetime elements wich are not supported by the JavaME API i've been guided to manually change them in the WSDL file to xs:string and generate the stub with this version of the WSDL file.

Questions:
(a) Is it possible that Note (ii) is the cause of this exception?
(b) If yes, is there a more "proper" workaround for the xs:datetime neing not supported by JavaME?
(c) If not, what else can be possibly causing this exception?

Thanks in advance
Offline  
Old 08-16-2011, 05:40 PM   #2 (permalink)
New Member
 
Join Date: Aug 2011
Model: 8520
PIN: N/A
Carrier: Vodafone
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Problem using a java stub to consume a webservice

The message traced by tcpmon looks like this:

Quote:
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlnssi="" xmlnssd="" xmlns:soapenv="" xmlns:tns="">
<soapenv:Body>
<tns:MobServices___MobLoginUser>
<tns:sUsername>testmob</tns:sUsername>
<tns:sPassword>1234</tns:sPassword>
<tns:sToken> </tns:sToken>
</tns:MobServices___MobLoginUser>
</soapenv:Body>
</soapenv:Envelope>
which seems fine and the response of the server:

Quote:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlnssd="" xmlnssi="" xmlns:HNS="" xmlns:v1="">
<SOAP-ENV:Header>
<ROClientIDHeader xmlns="urn:MobCompassLibrary" SOAP-ENV:mustUnderstand="0">
<ID>{7BDD717F-C90E-4055-B04C-641330A9E54A}</ID>
</ROClientIDHeader>
</SOAP-ENV:Header>
<SOAP-ENV:Body xmlns:ro="">
<v1:MobServices___MobLoginUserResponse>
<v1:Result>
<v1:bLogged>true</v1:bLogged>
<v1:LoginMessage/>
<v1:userID>69</v1:userID>
<v1:userName>Test</v1:userName>
<v1:userNameFirst>Mobile</v1:userNameFirst>
<v1:userInits>SS </v1:userInits>
<v1:UserToken>MOB-9472797549D4461282251E70C5B1F8ED</v1:UserToken>
<v1:bAdministrator>false</v1:bAdministrator>
<v1:MainDepartmentID>18</v1:MainDepartmentID>
<v1:UsedLicences>6</v1:UsedLicences>
<v1:TotalLicences>80</v1:TotalLicences>
<v1:Sessions>
<v1:TExistingSession>
<v1:idRow>16129</v1:idRow>
<v1:UserToken>MOB-D0EF9302967240658FCFD54316C4A596</v1:UserToken>
<v1ateStart>2011-08-08T14:59:06.897</v1ateStart>
<v1:ReferenceCount>1</v1:ReferenceCount>
<v1:ToBeKilled>false</v1:ToBeKilled>
</v1:TExistingSession>
<v1:TExistingSession>
<v1:idRow>16130</v1:idRow>
<v1:UserToken>MOB-B46FF60735F5457EA72D9C7A2136DA83</v1:UserToken>
<v1ateStart>2011-08-08T15:04:11.35</v1ateStart>
<v1:ReferenceCount>1</v1:ReferenceCount>
<v1:ToBeKilled>false</v1:ToBeKilled>
</v1:TExistingSession>
</v1:Sessions>
<v1romptForSessionKilling>true</v1romptForSessionKilling>
<v1:bCorrectCredentials>true</v1:bCorrectCredentials>
</v1:Result>
</v1:MobServices___MobLoginUserResponse>
</SOAP-ENV:Body></SOAP-ENV:Envelope>
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads for: Problem using a java stub to consume a webservice
Thread Thread Starter Forum Replies Last Post
Help! Fourth replacement blackberry, same random shut-off problem! CurveDependant General 8300 Series Discussion - Curve 56 06-22-2009 03:38 AM
Live Messenger strange problem, Urgency Andy2008 General 8300 Series Discussion - Curve 6 03-31-2009 02:46 PM
VPN access through PAM problem SPRINT 8703e stimmer6253472 General Legacy Device Discussion 0 12-12-2007 05:42 PM
Java Problem Indy General Legacy Device Discussion 4 01-02-2006 12:53 PM
Java Problem with 7100V colirius General BlackBerry Discussion 3 06-21-2005 10:27 PM

Samsung Falcon iDCS 8D 8-Button Black Display Phones w/ Bases Handsets LOT A
$59.95
Samsung Falcon iDCS 8D 8-Button Black Display Phones w/ Bases Handsets LOT A pictureSamsung NX_PWR220 NXPWR220 AC Power Unit
$109.0
Samsung NX_PWR220 NXPWR220 AC Power Unit  picture2700 PCS SAMSUNG CL21C561JBANNNC CAPACITORS
$3.99
2700 PCS SAMSUNG CL21C561JBANNNC  CAPACITORS pictureSAMSUNG SLB-5 LIGHTBOX Light Box for SVP-5000 SVP-5200 SAM700915 VIDEO PRESENTER
$59.99
SAMSUNG SLB-5 LIGHTBOX Light Box for SVP-5000 SVP-5200 SAM700915 VIDEO PRESENTER pictureSamsung SCD67 Digital Camcorder 500x Digital Zoom
$30.79
Samsung SCD67 Digital Camcorder 500x Digital Zoom picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.