BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 08-09-2006, 09:50 AM   #1
nipismylastnamehonest
New Member
 
Join Date: Oct 2005
Model: 8830
Carrier: Telus
Posts: 4
Default kSoap and .net parameters

Please Login to Remove!

Hi,

I'm having problems consuming a .net ws using kSoap. It seems I cannot pass parameters into the web service. I have read that I should add the following property above my web service method:

[System.Web.Services.Protocols.SoapRpcMethod]

However, when I do this I get the following error:

Server was unable to read request. --> There is an error in XML document (4, 4). --> <GetUserDetails xmlns="HTTP/tempuri" > was not expected.

I also try adding the following property to my webservice class:

[SoapDocumentService(SoapBindingUse.Encoded, SoapParameterStyle.Wrapped)]


But this results in the same error. If I take properties out, I can invoke the web service, but cannot pass parameter values to the webservice.

Here is my code:

Soap Server:

[WebMethod]
//[System.Web.Services.Protocols.SoapRpcMethod]

public peopleDetails GetUserDetails( string as_GPN )
{
//as_GPN = "CA012403529";
string ls_StoredProc = "usp_UserDetails_Get";
object[] lo_QueryParms = { as_GPN };

DataSet lo_DataSet = lo_DatabaseEYMobilePhoneBook.ExecuteDataSet( ls_StoredProc, lo_QueryParms );

return this.ReturnPeopleDetails( lo_DataSet.Tables[0] , as_GPN );
}


Client Code:

SoapObject EYPS = new SoapObject("HTTP/tempuri", "GetUserDetails" );
EYPS.addProperty( "as_GPN", "CA012403529" );

serverResponse = new HttpTransport( phoneServiceUrl, "HTTP/tempuri.org/GetUserDetails" ).call(EYPS);



Soap Request Template (as provided by the .net webservice):

POST /bbservice1/service1.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "HTTP/tempuri.org/GetUserDetails"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlnssi="2001/XMLSchema-instance" xmlnssd="w3.org/2001/XMLSchema" xmlns:soapenc="xmlsoap/soap/encoding/" xmlns:tns="HTTP/tempuri/" xmlns:types="HTTP/tempuri/encodedTypes" xmlns:soap="HTTP/schemas.xmlsoap/soap/envelope/">
<soap:Body soap:encodingStyle="xmlsoap/soap/encoding/">
<tns:GetUserDetails xsi:type="tns:GetUserDetails">
<as_GPN xsi:type="xsd:string">string</as_GPN>
</tns:GetUserDetails>
</soap:Body>
</soap:Envelope>


Any help would be much appreciated.

Please note that I could not paste URLs so HTTP/ = http: //

Thanks,
Matt
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


OEM Dell XPS 8910 8920 8930 Alienware Aurora R5 R6 R7 Front Cooling Fan 7M0F5 picture

OEM Dell XPS 8910 8920 8930 Alienware Aurora R5 R6 R7 Front Cooling Fan 7M0F5

$13.81



DELL 330-6581 3306581 725-10229 OEM LAMP FOR 1510X 1610HD 1610X  - Made By DELL picture

DELL 330-6581 3306581 725-10229 OEM LAMP FOR 1510X 1610HD 1610X - Made By DELL

$39.98



NEW VESA ADAPTER PLATE FOR DELL E-SERIES MONITORS - OEM picture

NEW VESA ADAPTER PLATE FOR DELL E-SERIES MONITORS - OEM

$6.00



Dell OEM Latitude Rugged Extreme 7404 Left and Right Mouse Buttons 00008 picture

Dell OEM Latitude Rugged Extreme 7404 Left and Right Mouse Buttons 00008

$5.95



NEW DELL OEM REPLACEMENT PROJECTOR LAMP FOR 4220 4320 GENUINE ORIGINAL  picture

NEW DELL OEM REPLACEMENT PROJECTOR LAMP FOR 4220 4320 GENUINE ORIGINAL

$198.22



Genuine OEM Dell 2375 B2375dnf B2375dfw 110V Fuser fixing N41P2 sku 724-BBCI picture

Genuine OEM Dell 2375 B2375dnf B2375dfw 110V Fuser fixing N41P2 sku 724-BBCI

$94.99







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