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


Dec/Adac Corp. D4-10390 Rev 6 Model 1664ATTL Output Pulse Board 1983 (B16) picture

Dec/Adac Corp. D4-10390 Rev 6 Model 1664ATTL Output Pulse Board 1983 (B16)

$189.99



DEC DIGITAL VINTAGE RA8X Control Panel picture

DEC DIGITAL VINTAGE RA8X Control Panel

$30.00



Original New DEC Digital DCJ11-AE 57-19400-09 Vintage CPU x 1pc picture

Original New DEC Digital DCJ11-AE 57-19400-09 Vintage CPU x 1pc

$100.00



DEC / AMI 304E 21-15542-01 vintage ceramic IC - KTF11 Chip *NEW* 40278101  picture

DEC / AMI 304E 21-15542-01 vintage ceramic IC - KTF11 Chip *NEW* 40278101

$50.00



VINTAGE Bruker Board DEC W4P3042 for SpectroSpin 250 picture

VINTAGE Bruker Board DEC W4P3042 for SpectroSpin 250

$99.99



HSS 12pcs Valve Seat & Face Cutter 45dec 30dec 20dec for Vintage Car, Bikes ,Jee picture

HSS 12pcs Valve Seat & Face Cutter 45dec 30dec 20dec for Vintage Car, Bikes ,Jee

$235.94







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