BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 04-14-2008, 01:50 PM   #1
SilverSkeleton
New Member
 
Join Date: Apr 2008
Model: 8120
PIN: N/A
Carrier: NONE
Posts: 3
Talking (JDE) - Soap Request to a .NET web service.

Please Login to Remove!

hi, i have this code on mi BB app..i know is not perfect code but is all i have understand so far...im triying just to do a connection whit ...and send 2 parameters ass well as cathc them back.(im just starting whit JDE pls dont laugh).This is mi closes aproach..can some help me alittle any comment or sugestion will be appreciate thx in advance..

:bb:
String soapAction = "http://tempuri.org/Login";
String serviceUrl = "http://myHost.com/webservice/webservice.asmx";
String serviceNamespace = "http://tempuri.org/";

HttpTransport transport = null;
SoapObject soap1 = new SoapObject(serviceNamespace,"Login");
transport = new HttpTransport(serviceUrl,soapAction);
transport.debug = true;
Object result = transport.call(soap1);

StringItem item = new StringItem(result.toString());

--------------------------------------------------------------------------
SOAP 1.1
POST /webservice/webservice.asmx HTTP/1.1
Host: netarriba.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/Login"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Login xmlns="http://tempuri.org/">
<user>string</user>
<pwd>string</pwd>
</Login>
</soap:Body>
</soap:Envelope>
--------------------------------------------------------------------------
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<LoginResponse xmlns="http://tempuri.org/">
<LoginResult>
<string>string</string>
<string>string</string>
</LoginResult>
</LoginResponse>
</soap:Body>
</soap:Envelope>

Last edited by SilverSkeleton; 04-15-2008 at 12:06 PM..
Offline  
Old 04-15-2008, 09:12 AM   #2
goulamass
Talking BlackBerry Encyclopedia
 
Join Date: Jan 2008
Location: France
Model: 8310
PIN: N/A
Carrier: Vodafone
Posts: 217
Default

Try :

SoapObject requestMessage = new SoapObject("http://tempuri.org/", "Login");
requestMessage.addProperty("user",the_value_of_the _user);
requestMessage.addProperty("pwd",the_value_of_the_ password);
Object obj = transport.call(requestMessage);
String Result = obj.toString();
Offline  
Old 04-15-2008, 11:00 AM   #3
SilverSkeleton
New Member
 
Join Date: Apr 2008
Model: 8120
PIN: N/A
Carrier: NONE
Posts: 3
Default

Thx alot for your reply "goulamass". (Im cheking this right now) I forgot tell im using Ksoap library.
I get a syntax error in this two lines of code:

try{
String soapAction = "http://tempuri.org/Login";
String serviceUrl = "http://www.xxxxxxxxxx.com/ws/webservice.asmx";
String serviceNamespace = "http://tempuri.org/";

SoapObject requestMessage = new SoapObject(serviceNamespace, "Login");
requestMessage.addProperty("user",the_value_of_the _user); <----What would be my value of "user"
requestMessage.addProperty("pwd",the_value_of_the_ password); <----What would be my value of "pass"
HttpTransport transport = null;
transport = new HttpTransport(serviceUrl,soapAction);
Object obj = transport.call(requestMessage);
String Result = obj.toString();

}catch(IOException ioe){}



"Imagination is more important than knowledge." Albert Einstein

Last edited by SilverSkeleton; 04-15-2008 at 05:42 PM.. Reason: Final code.
Offline  
Old 04-15-2008, 12:35 PM   #4
SilverSkeleton
New Member
 
Join Date: Apr 2008
Model: 8120
PIN: N/A
Carrier: NONE
Posts: 3
Default SoapObject.addProperty

I took this from KSOAP API Documentation:

SoapObject addProperty(java.lang.String name, java.lang.Object value)

Adds a property (parameter) to the object. This is essentially a sub element.
Parameters:
name - The name of the property.
value - the value of the property.

My question is: what would be my "java.lang.Object value" ? of my example.
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


1747-M13/A ABoriginal packaging   SLC EEPROM Memory module 1747M13  Brand new GN picture

1747-M13/A ABoriginal packaging SLC EEPROM Memory module 1747M13 Brand new GN

$309.99



1PC USED   FX-EEPROM-4 picture

1PC USED FX-EEPROM-4

$23.93



1PC New In Box PLC Memory Card  FX-EEPROM-16  picture

1PC New In Box PLC Memory Card FX-EEPROM-16

$142.50



CH341A 24 25 Series EEPROM Flash BIOS USB Programmer Module + SOIC8 Test Clip picture

CH341A 24 25 Series EEPROM Flash BIOS USB Programmer Module + SOIC8 Test Clip

$5.88



10PCS W27C512-45Z W27C512 DIP IC EEPROM 512KBIT 45NS Winbond EEPROMs USA picture

10PCS W27C512-45Z W27C512 DIP IC EEPROM 512KBIT 45NS Winbond EEPROMs USA

$16.90



10PCS W27C512-45Z W27C512 DIP IC EEPROM 512KBIT 45NS Winbond EEPROMs US picture

10PCS W27C512-45Z W27C512 DIP IC EEPROM 512KBIT 45NS Winbond EEPROMs US

$19.59







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