BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 10-19-2008, 10:29 PM   #1
PymbleSoftware
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: internal
Posts: 15
Default kSoap 2nd request gives no response back.

Please Login to Remove!

Hi there Gurus of BB development,

I make a SOAP call with kSoap2, it throws an exception because my code is bad, then I fix my code, I call envelope.getResponse() or envelope.getResult() and it works... I get the data back that I am expecting.

So I modify the code I copy and paste the working code into another method, change the web method to call.

I have been assured that this web method works fine in other languages on other platforms other than Blackberry.

I have one method that calls each of the methods that make SOAP calls.
The original method still works and the new method throws no exception, returns no data. I just get anyType{} from envelope.getResponse()...
I want to blame the web service but a response of "anyType{}" doesn't give me much to work with.

Do I need to reset anything between calls...?
It is wierd that I don't get an exception but then I get nothing back also...


Edit: Perhaps ignore this... The network people mentioned something about host protection system swallowing connections, preventing buffer overflow attacks, mumble, mumble, mumble, preventing denial of service, ....


Meanwhile I've been pulling my hair out...


RR.
__________________
www.pymblesoftware.com
P.O. Box 121,
Pymble,
NSW 2073
AUSTRALIA. +61 2 99830308

Last edited by PymbleSoftware; 10-20-2008 at 12:58 AM..
Offline  
Old 10-20-2008, 10:02 AM   #2
ArthurKnight
New Member
 
Join Date: Oct 2008
Model: 8100
PIN: N/A
Carrier: TELCEL
Posts: 11
Default

Hi,

Can you post a code fragment? Maybe it helps.

Regards
Offline  
Old 10-20-2008, 10:33 AM   #3
goulamass
Talking BlackBerry Encyclopedia
 
Join Date: Jan 2008
Location: France
Model: 8310
PIN: N/A
Carrier: Vodafone
Posts: 217
Default

Hum your Web service is in?? .Net?? Java??...

Because some times there is comptability problem

Post the call you make and the wsdl of your web service if you want we look at.
Offline  
Old 10-20-2008, 08:08 PM   #4
PymbleSoftware
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: internal
Posts: 15
Default

Quote:
Originally Posted by ArthurKnight View Post
Hi,

Can you post a code fragment? Maybe it helps.

Regards
Quote:
The following errors occurred when this message was submitted:

1.
To be able to post links or images your post count must be 10 or greater. You currently have 3 posts.

Please remove links from your message, then you will be able to submit your post.


Event handler routine....
SessionID = getSession();
LogOnmessage = SomeSysLogon( SessionID, username, password, 6 );




private String getSession()
{
String Session = new String("Session ID=");

SoapObject stamp= new SoapObject(" URL ","GenerateSession");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

envelope.bodyOut = stamp;
envelope.dotNet = true;
envelope.encodingStyle = SoapSerializationEnvelope.XSD;

HttpTransport transport = new HttpTransport("OUR URL HERE ");

try
{
transport.call(" URL ",envelope);
}
catch( Exception e )
{
add(new RichTextField("Call Exception:" + e.toString(), Field.NON_FOCUSABLE));
}

try
{
Object obj = envelope.getResponse();
Session = obj.toString();
}
catch( Exception e )
{
add(new RichTextField("get response Exception:" + e.toString(), Field.NON_FOCUSABLE));
}

return Session;
}


private String SomeSysLogon( String SessionID, String UserName, String Password, int SystemID )
{
String Message = new String( "" );

SoapObject stamp= new SoapObject("OUR URL HERE","LogonUser");
stamp.newInstance();

SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

Integer i = new Integer( SystemID );

stamp.addProperty("Username", UserName);
stamp.addProperty("Password", Password);
stamp.addProperty("SystemID", i);
stamp.addProperty("SessionID", SessionID);

envelope.setOutputSoapObject(stamp);
envelope.bodyOut = stamp;
envelope.dotNet = true;
envelope.encodingStyle = SoapSerializationEnvelope.XSD;

HttpTransport transport = new HttpTransport(" OUR URL HERE");

try
{
transport.call(" URL ",envelope);
}
catch( Exception e )
{
add(new RichTextField("Call Exception:" + e.toString(), Field.NON_FOCUSABLE));
}

try
{
// Object obj = envelope.getResult();
// Object obj = envelope.getResponse();
// String temp = obj.toString();
String temp = new String();
temp = temp + ", body: " + envelope.bodyIn + " ... " + envelope.bodyOut + " : " + envelope.getResponse();
// Message = "Login." + obj.toString();
Message = temp;
}
catch( Exception e )
{
add(new RichTextField("get response Exception:" + e.toString(), Field.NON_FOCUSABLE));
}

return Message;
}


Here envelope.getResponse(); gives me anyType{}.....

Quote:
Originally Posted by goulamass
Hum your Web service is in?? .Net?? Java??...

Because some times there is comptability problem

Post the call you make and the wsdl of your web service if you want we look at.
Various web services called by this application, .NET (C#) and PERL on Linux.. Note the envelope.dotNet = true; ...

The WSDL is larger than can be posted here.



Cheers,


RR.
__________________
www.pymblesoftware.com
P.O. Box 121,
Pymble,
NSW 2073
AUSTRALIA. +61 2 99830308
Offline  
Old 10-21-2008, 02:31 AM   #5
goulamass
Talking BlackBerry Encyclopedia
 
Join Date: Jan 2008
Location: France
Model: 8310
PIN: N/A
Carrier: Vodafone
Posts: 217
Default

If you want to debug you may look on the transport to see what is your request and what is the answer you get.

Put this after the call :

System.out.println("Request \n" + transport.requestDump); System.out.println("Response \n" + transport.responseDump);
Offline  
Old 10-21-2008, 05:55 PM   #6
PymbleSoftware
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: internal
Posts: 15
Default

Quote:
Originally Posted by goulamass View Post
If you want to debug you may look on the transport to see what is your request and what is the answer you get.

Put this after the call :

System.out.println("Request \n" + transport.requestDump); System.out.println("Response \n" + transport.responseDump);
I am debugging on the device.
I changed teh System.out.println() to Dialog.alert() and got null in both cases.

I still suspect that there is a network issue involved somewhere.
We have pretty extreme security.

RR.
__________________
www.pymblesoftware.com
P.O. Box 121,
Pymble,
NSW 2073
AUSTRALIA. +61 2 99830308
Offline  
Old 10-22-2008, 03:03 AM   #7
goulamass
Talking BlackBerry Encyclopedia
 
Join Date: Jan 2008
Location: France
Model: 8310
PIN: N/A
Carrier: Vodafone
Posts: 217
Default

So in the try catch wrote in the catch :

catch(Exception exception)
{
System.out.println("... itz throwing exception..." + exception);
System.out.println("Request \n" + transport.requestDump);
System.out.println("Response \n" + transport.responseDump);
}

So you will see what is the exception throw
Offline  
Old 10-22-2008, 09:32 AM   #8
sickned
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: Unknow
Posts: 42
Default

http://www.blackberryforums.com/deve...-tutorial.html
Offline  
Old 10-22-2008, 05:47 PM   #9
PymbleSoftware
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: internal
Posts: 15
Default

Quote:
Originally Posted by goulamass View Post
So in the try catch wrote in the catch :

catch(Exception exception)
{
System.out.println("... itz throwing exception..." + exception);
System.out.println("Request \n" + transport.requestDump);
System.out.println("Response \n" + transport.responseDump);
}

So you will see what is the exception throw
There is no exception thrown
That is what has been pissing me off all along.
No exception thrown and no repsonse, and I just get null or anytype{} back.

Whats more, the first call is effectively the same code with another method of the same serviced called. First call succeeds, the second call doesn't throw an exception but returns nothing... And the web service has been around for a long time and is supposed to work fully on other platforms.


RR.
__________________
www.pymblesoftware.com
P.O. Box 121,
Pymble,
NSW 2073
AUSTRALIA. +61 2 99830308

Last edited by PymbleSoftware; 10-22-2008 at 06:04 PM..
Offline  
Old 10-23-2008, 02:33 AM   #10
goulamass
Talking BlackBerry Encyclopedia
 
Join Date: Jan 2008
Location: France
Model: 8310
PIN: N/A
Carrier: Vodafone
Posts: 217
Default

Hum so the problem comes probably from the WS.

Check it from anothers platforms.

Or modify it that it sends back data you send to see if it receives the good data
Offline  
Old 10-26-2008, 09:08 PM   #11
PymbleSoftware
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: internal
Posts: 15
Default

Code:
Here are SOAP request/response for the LogonUser call:

 

Request:

<?xml version="1.0" encoding="utf-16"?>

<soap:Envelope xmlns:soap=" URL " xmlns:xsi=" URL " xmlns:xsd=" URL ">

  <soap:Body>

    <LogonUser xmlns=" URL ">

      <Username> #####  </Username>

      <Password> ##### </Password>

      <SystemID>6</SystemID>

      <SessionID>7767358e3e684ea689b5d39a3d8592ba633607050626718922</SessionID>

    </LogonUser>

  </soap:Body>

</soap:Envelope>

 

Response:

Cache-Control:private, max-age=0

Content-Type:text/xml; charset=utf-8

Date:Mon, 27 Oct 2008 00:51:58 GMT

Server:Microsoft-IIS/6.0

X-AspNet-Version:2.0.50727

X-Powered-By:ASP.NET

 

<?xml version="1.0" encoding="utf-16"?>

<soap:Envelope xmlns:soap=" URL " xmlns:xsi=" URL " xmlns:xsd=" URL ">

  <soap:Body>

    <LogonUserResponse xmlns=" URL ">

      <LogonUserResult>0c8efd5ab4e54a729a5215ddcd3567c8633607051187428986</LogonUserResult>

    </LogonUserResponse>

  </soap:Body>

</soap:Envelope>

Works from C#...

"Or modify it that it sends back data you send to see if it receives the good data"


Oh, and I can not modify the Web service for what it is sending back. I am testing against a production machine with tens of thousands of users logged in.


RR.
__________________
www.pymblesoftware.com
P.O. Box 121,
Pymble,
NSW 2073
AUSTRALIA. +61 2 99830308

Last edited by PymbleSoftware; 10-26-2008 at 09:16 PM..
Offline  
Old 10-27-2008, 03:45 AM   #12
goulamass
Talking BlackBerry Encyclopedia
 
Join Date: Jan 2008
Location: France
Model: 8310
PIN: N/A
Carrier: Vodafone
Posts: 217
Default

Just create a new function in your web service.

For example :

String helloWord(String a)
{
return a;
}

Can you simply add it??
Offline  
Old 10-27-2008, 05:21 PM   #13
PymbleSoftware
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: internal
Posts: 15
Default

Quote:
Originally Posted by goulamass View Post
Just create a new function in your web service.

For example :

String helloWord(String a)
{
return a;
}

Can you simply add it??
On a live prodcution machine with tens of thousand of users logged in where I don't have access to the machine or even know which machine the load balancer connects me with? No, I'd be shocked if anyone would give me approval and anyway the 1st call always works. There is no effective QA environment and there is no signed SSL certificates on the test servers.



RR
__________________
www.pymblesoftware.com
P.O. Box 121,
Pymble,
NSW 2073
AUSTRALIA. +61 2 99830308
Offline  
Old 10-27-2008, 10:05 PM   #14
PymbleSoftware
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: internal
Posts: 15
Default

A new signed cert appeared on the QA test servers..

Someone inspected what was going over the wire with tcpdump, Wireshark or ethereal or whatever and the difference between C# calls and the Blackberry calls is that the Blackberry code has: <Username i:type="d:string"> and the C# code merely has <Username>

Somehow, the WS barfs on that type info.. :roll:

Solved, I hope.
Now to figure out how to turn that off with the Blackberry.

RR.
__________________
www.pymblesoftware.com
P.O. Box 121,
Pymble,
NSW 2073
AUSTRALIA. +61 2 99830308
Offline  
Old 10-28-2008, 05:02 PM   #15
PymbleSoftware
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: internal
Posts: 15
Default

bump...

I tried every option I could find on the SOAP objects and envelopes and stuff and I can not seem to be able to turn that off... i.e. Make <Username d:type i:string> just simply <Username>

Ideas anyone, it is due tommorow and I am not a SOAP expert.

RR.
__________________
www.pymblesoftware.com
P.O. Box 121,
Pymble,
NSW 2073
AUSTRALIA. +61 2 99830308
Offline  
Old 10-29-2008, 12:16 AM   #16
PymbleSoftware
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: internal
Posts: 15
Default

I posted in a general Java forum. Looks like I am not the only one who has problems with kSoap2.

Problems with a complex datatype in a webservice - Java Forums

I think I have to parse the body string and take out teh typeinfo before sending it.
Anyone done this...?

Other solutions..?


RR.
__________________
www.pymblesoftware.com
P.O. Box 121,
Pymble,
NSW 2073
AUSTRALIA. +61 2 99830308
Offline  
Old 10-30-2008, 12:17 AM   #17
PymbleSoftware
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: internal
Posts: 15
Default

bump
__________________
www.pymblesoftware.com
P.O. Box 121,
Pymble,
NSW 2073
AUSTRALIA. +61 2 99830308
Offline  
Closed Thread



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Bissell 3-in-1 Lightweight Corded Stick Vacuum 2030 picture

Bissell 3-in-1 Lightweight Corded Stick Vacuum 2030

$28.88



BISSELL 3-in-1 Turbo Lightweight Stick Vacuum, 2610 (Black) picture

BISSELL 3-in-1 Turbo Lightweight Stick Vacuum, 2610 (Black)

$37.96



Watts 1 Inch Pressure Vacuum Breaker 800M4-QT picture

Watts 1 Inch Pressure Vacuum Breaker 800M4-QT

$120.00



Dirt Devil Scorpion Plus Corded Handheld Vacuum Cleaner SD30025VB Red NEW picture

Dirt Devil Scorpion Plus Corded Handheld Vacuum Cleaner SD30025VB Red NEW

$35.00



3 CFM Air Vacuum Pump HVAC Manifold Gauge Set AC A/C Refrigeration Kit picture

3 CFM Air Vacuum Pump HVAC Manifold Gauge Set AC A/C Refrigeration Kit

$46.03



VEVOR 5 Gallon Vacuum Chamber with 5CFM Vacuum Pump Kit 1/3HP Single Stage 110V picture

VEVOR 5 Gallon Vacuum Chamber with 5CFM Vacuum Pump Kit 1/3HP Single Stage 110V

$104.99







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