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


Fluke Networks Versiv Modular Mainframe AS IS picture

Fluke Networks Versiv Modular Mainframe AS IS

$1500.00



Chroma 6312 DC Electronic Load Mainframe  picture

Chroma 6312 DC Electronic Load Mainframe

$239.96



Agilent HP Keysight 16902B Modular Logic Analysis System Mainframe picture

Agilent HP Keysight 16902B Modular Logic Analysis System Mainframe

$1469.24



Agilent E1301B Mainframe  9-slots with multimeter, totalizer, and relay muxes picture

Agilent E1301B Mainframe 9-slots with multimeter, totalizer, and relay muxes

$200.00



SHC SYSTEM 6 MAINFRAME + Mixed Modules 6-562,6-201,6-402. picture

SHC SYSTEM 6 MAINFRAME + Mixed Modules 6-562,6-201,6-402.

$99.99



USED 100%Tested NI PXI-1033 Mainframe Offers pxi 1033  picture

USED 100%Tested NI PXI-1033 Mainframe Offers pxi 1033

$780.90







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