BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 11-27-2007, 10:43 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Oct 2007
Model: 8700g
PIN: N/A
Carrier: T-Mobile
Posts: 21
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default KSOAP2 and .NET web service

Please Login to Remove!

Hi

i am trying to use the ksoap2 with .NET web service.
it was to get to it but i am in a situation that i am getting a response that the server cannot read the soap header

"Server did not recognize the value of HTTP Header SOAPAction:"

checking the HttpTransport request shows that the soap message looks like the following:

<v:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
xmlns:d="http://www.w3.org/2001/XMLSchema"
xmlns:c="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:v="http://schemas.xmlsoap.org/soap/envelope/">
<v:Header />
<v:Body>
<HW1 xmlns="www.qpay123.org" id="o0" c:root="1" />
</v:Body>
</v:Envelope>


i believe that the error message that refer to the empty header tag i have in the soap request but i cannot find the way to change it, the code that creates the soap message and the call is as follow:

SoapObject rpc = new SoapObject (NAMESPACE, METHOD);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.bodyOut = rpc;

envelope.encodingStyle = SoapSerializationEnvelope.XSD;

ht = new HttpTransport (URL);
ht.debug = true;
ht.call(METHOD,envelope);


in the last few days i read so many ksoap example which non of them really worked.

can anyone show me the light?

thanks in advance,
__________________
eyal
Offline  
Old 11-27-2007, 12:09 PM   #2 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

METHOD is used to create the SoapObject (correct in your code as far as i can see).
The call-method does not use METHOD.
Try
Code:
ht.call("urn:anonOutInOp", envelope);
instead.
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 11-27-2007, 01:46 PM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Oct 2007
Model: 8700g
PIN: N/A
Carrier: T-Mobile
Posts: 21
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

thanks for the quick response.
i try what you said and i am still getting the same error message.

i still believe the reason is in the empty header tag that is added to the soap message, i have no clue how to remove it.

thanks,
__________________
eyal
Offline  
Old 11-28-2007, 11:18 AM   #4 (permalink)
Thumbs Must Hurt
 
Join Date: Aug 2007
Model: 8100
PIN: N/A
Carrier: Rogers
Posts: 140
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Have you checked your SOAP encoding? are you using 1.0, 1.1 or 1.2 that might be source.
Offline  
Old 11-28-2007, 03:14 PM   #5 (permalink)
Knows Where the Search Button Is
 
Join Date: Oct 2007
Model: 8700g
PIN: N/A
Carrier: T-Mobile
Posts: 21
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi and thanks again,

i actually solved it based on your previous post.

i will code something more generic and post a complete example here maybe next week. so everyone can have an example to follow.

thanks for all your help.
__________________
eyal
Offline  
Old 01-16-2009, 02:51 AM   #6 (permalink)
Thumbs Must Hurt
 
Join Date: Oct 2008
Model: 8800
PIN: N/A
Carrier: Globe
Posts: 52
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Question

hi,

i am using the HttpTransportBasicAuth class instead of the normal HttpTransport because my web service is secure.

i was wondering, when i pass the username and password in this class for authentication, where will they be placed? are they included in the SOAP header? if so, how can i verify its contents?
Offline  
Old 02-17-2009, 01:44 AM   #7 (permalink)
New Member
 
Join Date: Feb 2009
Model: 8700
PIN: N/A
Carrier: Vodafone
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by eyalo View Post
Hi and thanks again,

i actually solved it based on your previous post.

i will code something more generic and post a complete example here maybe next week. so everyone can have an example to follow.

thanks for all your help.
can u plz p[ost the complete example ASAP
Offline  




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