Search Results

Search found 22 results on 1 pages for 'ksoap'.

Page 1/1 | 1 

  • Ksoap in Eclips

    - by hussain
    HI i new to android. i want to use ksoap to connect to web service. i have seen a lot of example. but the bet which i am not able to figure out is how to install ksoap in eclips so that i can import the ksoap libs import org.ksoap2;

    Read the article

  • XML/SOAP attributes for a complextype in kSOAP

    - by Soumya
    Hi, I'm trying to parse a SOAP response that contains nested ComplexTypes using the kSOAP library on Android 2.1. <event att1="value1" att2="value2" att3="value3"> <tag2> ... </tag2> <tag3> ... </tag3> </event> I've implemented my own class Event that implements org.ksoap2.serialization.KvmSerializable to parse this response. It is not clear to me if and how I can parse the attributes (att1, att2 and att3) of the event node. Is it even possible with the current kSOAP implementation? Thanks.

    Read the article

  • :: Help Needed to parse ksoap response using J2ME ::

    - by Sachin
    Hi Guys, I am developing a mobile application using J2ME, LWUIT and KSOAP. The application makes .net webservice calls and fetches responses. I am able to successfully make calls and receive respone, but not able to parse the response, due to my limited knowledge in java. following is my WSDL file and j2me code snippet used to make calls. The WSDL file has complex and SIMPLETYPE elements, which needs to be mapped to JAVA classes. i request you guys to help me out with any pointers or sample code. WSDL file: <?xml version="1.0" encoding="utf-8"?> <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <wsdl:types> <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/"> <s:element name="Login"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="userLoginID" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" /> </s:sequence> </s:complexType> </s:element> <s:element name="LoginResponse"> <s:complexType> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="User" nillable="true" type="tns:UserBin" /> </s:sequence> </s:complexType> </s:element> <s:complexType name="UserBin" abstract="true"> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="CompanyCodeSeqId" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="Image" type="s:base64Binary" /> <s:element minOccurs="1" maxOccurs="1" name="DateOfBirth" type="s:dateTime" /> <s:element minOccurs="1" maxOccurs="1" name="UserSeqId" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="UserFirstName" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="UserLastName" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="PassWord" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="UserRole" type="tns:Roles" /> <s:element minOccurs="1" maxOccurs="1" name="UserSSN" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="EmailId" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="MobileNumber" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="CreatedDate" type="s:dateTime" /> <s:element minOccurs="1" maxOccurs="1" name="ModifiedDate" type="s:dateTime" /> <s:element minOccurs="1" maxOccurs="1" name="UserGroup" type="tns:UserGroups" /> <s:element minOccurs="1" maxOccurs="1" name="SecretQuestionID" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="SecretAnswer" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="WorkPhone" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="HomePhone" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="Company" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="PreviousLoginTime" type="s:dateTime" /> <s:element minOccurs="1" maxOccurs="1" name="LoginTime" type="s:dateTime" /> </s:sequence> </s:complexType> <s:simpleType name="Roles"> <s:restriction base="s:string"> <s:enumeration value="Guest" /> <s:enumeration value="Customer" /> <s:enumeration value="Driver" /> <s:enumeration value="Dispatcher" /> <s:enumeration value="CompanyCodeAdmin" /> </s:restriction> </s:simpleType> <s:simpleType name="UserGroups"> <s:restriction base="s:string"> <s:enumeration value="Invalid" /> <s:enumeration value="Customer" /> <s:enumeration value="Driver" /> <s:enumeration value="Dispatcher" /> </s:restriction> </s:simpleType> <s:complexType name="DriverBin"> <s:complexContent mixed="false"> <s:extension base="tns:UserBin"> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="DriverGroupId" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="DriverTypeId" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="HireDate" type="s:dateTime" /> <s:element minOccurs="0" maxOccurs="1" name="LicenceNumber" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="ExpiryDateForLicence" type="s:dateTime" /> <s:element minOccurs="0" maxOccurs="1" name="VehicleNumber" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="EmergencyName" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="EmergencyPhone" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="EmergencyAddress" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="EmergencyRelationship" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="DriverType" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="DriverGroupName" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="VehicleID" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="SocialSN" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="StreetAddress" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="City" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="State" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="Zip" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="EmergencyCity" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="EmergencyState" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="EmergencyZip" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="TerminationDate" type="s:dateTime" /> <s:element minOccurs="1" maxOccurs="1" name="HireAgainFlag" type="s:boolean" /> <s:element minOccurs="0" maxOccurs="1" name="TerminationReason" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="Notes" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="ImageName" type="s:string" /> </s:sequence> </s:extension> </s:complexContent> </s:complexType> <s:complexType name="CustomerBin"> <s:complexContent mixed="false"> <s:extension base="tns:UserBin"> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="PassengesDetails" type="tns:ArrayOfPassengerBin" /> <s:element minOccurs="0" maxOccurs="1" name="CompanyName" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="CreditCardDetailsArray" type="tns:ArrayOfCreditCardDetailsBin" /> <s:element minOccurs="0" maxOccurs="1" name="AddressArray" type="tns:ArrayOfAddressBin" /> <s:element minOccurs="1" maxOccurs="1" name="CustomerCompanyID" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="CustomerType" type="tns:CustomerType" /> <s:element minOccurs="0" maxOccurs="1" name="PassengerGradeName" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="PassengerGradeID" type="s:int" /> </s:sequence> </s:extension> </s:complexContent> </s:complexType> <s:complexType name="ArrayOfPassengerBin"> <s:sequence> <s:element minOccurs="0" maxOccurs="unbounded" name="PassengerBin" nillable="true" type="tns:PassengerBin" /> </s:sequence> </s:complexType> <s:complexType name="PassengerBin"> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="CustomerSeqID" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="EmailID" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="PhoneNumber" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="LastName" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="FirstName" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="PassengerSeqID" nillable="true" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="IsSelf" type="s:boolean" /> </s:sequence> </s:complexType> <s:complexType name="ArrayOfCreditCardDetailsBin"> <s:sequence> <s:element minOccurs="0" maxOccurs="unbounded" name="CreditCardDetailsBin" nillable="true" type="tns:CreditCardDetailsBin" /> </s:sequence> </s:complexType> <s:complexType name="CreditCardDetailsBin"> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="CardSeqID" nillable="true" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="ExpiryYear" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="ExpiryMonth" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="CardType" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="NickName" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="CVVNumber" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="CreditCardNumber" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="NameOnTheCard" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="ZipCode" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="IsPrimary" type="s:boolean" /> </s:sequence> </s:complexType> <s:complexType name="ArrayOfAddressBin"> <s:sequence> <s:element minOccurs="0" maxOccurs="unbounded" name="AddressBin" nillable="true" type="tns:AddressBin" /> </s:sequence> </s:complexType> <s:complexType name="AddressBin"> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="UserSeqID" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="AddressID" nillable="true" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="ZipCode" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="IsPrimary" type="s:boolean" /> <s:element minOccurs="0" maxOccurs="1" name="State" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="StateID" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="StateCode" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="City" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="CityID" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="StreetAddress" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="NickName" type="s:string" /> </s:sequence> </s:complexType> <s:simpleType name="CustomerType"> <s:restriction base="s:string"> <s:enumeration value="Individual" /> <s:enumeration value="Corporate" /> </s:restriction> </s:simpleType> <s:complexType name="DispatcherBin"> <s:complexContent mixed="false"> <s:extension base="tns:UserBin"> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="Address1" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="Address2" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="City" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="Province" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="ZipCode" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="IsActive" type="s:boolean" /> <s:element minOccurs="1" maxOccurs="1" name="DispatcherHireDate" type="s:dateTime" /> <s:element minOccurs="1" maxOccurs="1" name="DispatcherSSN" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="TerminationDate" type="s:dateTime" /> <s:element minOccurs="0" maxOccurs="1" name="ReasonForTermination" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="HireAgainFlag" type="s:boolean" /> <s:element minOccurs="0" maxOccurs="1" name="EmergencyContactName" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="EmergencyContactNumber" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="EmergencyContactAddress" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="EmergencyContactRelationship" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="HireDate" type="s:dateTime" /> </s:sequence> </s:extension> </s:complexContent> </s:complexType> <s:element name="Logout"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="userLoginID" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="userSeqID" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="validationKey" type="s:string" /> </s:sequence> </s:complexType> </s:element> <s:element name="LogoutResponse"> <s:complexType /> </s:element> </s:schema> </wsdl:types> <wsdl:message name="LoginSoapIn"> <wsdl:part name="parameters" element="tns:Login" /> </wsdl:message> <wsdl:message name="LoginSoapOut"> <wsdl:part name="parameters" element="tns:LoginResponse" /> </wsdl:message> <wsdl:message name="LogoutSoapIn"> <wsdl:part name="parameters" element="tns:Logout" /> </wsdl:message> <wsdl:message name="LogoutSoapOut"> <wsdl:part name="parameters" element="tns:LogoutResponse" /> </wsdl:message> <wsdl:portType name="AccountManagementSoap"> <wsdl:operation name="Login"> <wsdl:input message="tns:LoginSoapIn" /> <wsdl:output message="tns:LoginSoapOut" /> </wsdl:operation> <wsdl:operation name="Logout"> <wsdl:input message="tns:LogoutSoapIn" /> <wsdl:output message="tns:LogoutSoapOut" /> </wsdl:operation> </wsdl:portType> <wsdl:binding name="AccountManagementSoap" type="tns:AccountManagementSoap"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="Login"> <soap:operation soapAction="http://tempuri.org/Login" style="document" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> <wsdl:operation name="Logout"> <soap:operation soapAction="http://tempuri.org/Logout" style="document" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:binding name="AccountManagementSoap12" type="tns:AccountManagementSoap"> <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="Login"> <soap12:operation soapAction="http://tempuri.org/Login" style="document" /> <wsdl:input> <soap12:body use="literal" /> </wsdl:input> <wsdl:output> <soap12:body use="literal" /> </wsdl:output> </wsdl:operation> <wsdl:operation name="Logout"> <soap12:operation soapAction="http://tempuri.org/Logout" style="document" /> <wsdl:input> <soap12:body use="literal" /> </wsdl:input> <wsdl:output> <soap12:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="AccountManagement"> <wsdl:port name="AccountManagementSoap" binding="tns:AccountManagementSoap"> <soap:address location="http://webservice.mcubeit.com/trs_webservice/services/AccountManagement.asmx" /> </wsdl:port> <wsdl:port name="AccountManagementSoap12" binding="tns:AccountManagementSoap12"> <soap12:address location="http://webservice.mcubeit.com/trs_webservice/services/AccountManagement.asmx" /> </wsdl:port> </wsdl:service> </wsdl:definitions> J2ME Code Snippet: String uname = username.getText(); String pass = password.getText(); String serviceUrl = "http://xxx.xxx.xxx/webservice/services/AccountManagement.asmx"; String serviceNameSpace = "http://tempuri.org/"; String soapAction = "http://tempuri.org/Login"; String methodName = "Login"; SoapObject rpc = new SoapObject(serviceNameSpace, methodName); rpc.addProperty("userLoginID", uname.trim()); rpc.addProperty("password", pass.trim()); //rpc.addProperty("userSeqID", String.valueOf(192).toString()); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.bodyOut = rpc; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.ENC; HttpTransport ht = new HttpTransport(serviceUrl); ht.debug = true; ht.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); String result = null; try { ht.call(soapAction, envelope); result = (envelope.getResponse()).toString(); System.out.println("Result :" + result.toString()); } catch (org.xmlpull.v1.XmlPullParserException ex2) { System.out.println("XmlPullParserException :" + ex2.toString()); System.out.println("Request \n" + ht.requestDump); System.out.println("Response \n" + ht.responseDump); } catch (SoapFault sf) { System.out.println("SoapFault :" + sf.faultstring); System.out.println("Request \n" + ht.requestDump); System.out.println("Response \n" + ht.responseDump); } catch (IOException ioe) { System.out.println("IOException :" + ioe.toString()); System.out.println("Request \n" + ht.requestDump); System.out.println("Response \n" + ht.responseDump); } RESPONSE Result :CustomerBin{CompanyCodeSeqId=-1; Image=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==; DateOfBirth=1900-01-01T00:00:00; UserSeqId=192; UserFirstName=Sachin; UserLastName=Nevase; PassWord=anyType{}; UserRole=Customer; UserSSN=-2147483648; [email protected]; MobileNumber=804131244; CreatedDate=1900-01-01T00:00:00; ModifiedDate=1900-01-01T00:00:00; UserGroup=Customer; SecretQuestionID=-2147483648; SecretAnswer=anyType{}; WorkPhone=anyType{}; HomePhone=anyType{}; Company=anyType{}; PreviousLoginTime=2010-05-04T23:38:34; LoginTime=1900-01-01T00:00:00; PassengesDetails=anyType{PassengerBin=anyType{CustomerSeqID=192; [email protected]; PhoneNumber=0804131244; LastName=Nevase; FirstName=Sachin; PassengerSeqID=55; IsSelf=true; }; }; CustomerCompanyID=-1; CustomerType=Individual; PassengerGradeName=Grade1; PassengerGradeID=1; } Thanks, Sachin

    Read the article

  • Android using ksoap calling PHP SOAP webservice fails: 'procedure 'CheckLogin' not found

    - by AmazingDreams
    I'm trying to call a PHP SOAP webservice. I know my webservice functions correctly because I use it in a WPF project succesfully. I'm also building an app in android, using the same webservice. The WSDL file can be found here: http://www.wegotcha.nl/servicehandler/service.wsdl This is my code in the android app: String SOAP_ACTION = "http://www.wegotcha.nl/servicehandler/CheckLogin"; String NAMESPACE = "http://www.wegotcha.nl/servicehandler"; String METHOD_NAME = "CheckLogin"; String URL = "http://www.wegotcha.nl/servicehandler/servicehandler.php"; String resultData = ""; SoapSerializationEnvelope soapEnv = new SoapSerializationEnvelope(SoapEnvelope.VER11); SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); SoapObject UserCredentials = new SoapObject("Types", "UserCredentials6"); UserCredentials.addProperty("mail", params[0]); UserCredentials.addProperty("password", md5(params[1])); request.addSoapObject(UserCredentials); soapEnv.setOutputSoapObject(request); HttpTransportSE http = new HttpTransportSE(URL); http.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); http.debug = true; try { http.call(SOAP_ACTION, soapEnv); } catch (IOException e) { e.printStackTrace(); } catch (XmlPullParserException e) { e.printStackTrace(); } SoapObject results = null; results = (SoapObject)soapEnv.bodyOut; if(results != null) resultData = results.getProperty(0).toString(); return resultData; Using fiddler I got the following: Android request: <?xml version="1.0" encoding="utf-8"?> <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> <n0:CheckLogin id="o0" c:root="1" xmlns:n0="http://www.wegotcha.nl/servicehandler"> <n1:UserCredentials6 i:type="n1:UserCredentials6" xmlns:n1="Types"> <mail i:type="d:string">myemail</mail> <password i:type="d:string">myhashedpass</password> </n1:UserCredentials6> </n0:CheckLogin> </v:Body> </v:Envelope> Getting the following response: Procedure 'CheckLogin' not present My request produced by my WPF app looks completely different: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <UserCredentials6 xmlns="Types"> <mail>mymail</mail> <password>mypassword</password> </UserCredentials6> </s:Body> </s:Envelope> After googling my ass off I was not able to solve this problem by myself. It may be possible there are some weird things in my Java code because I changed a lot since. I hope you guys will be able to help me, thanks. EDIT: My webservice is of document/literal encoding style, after doing some research I found I should be able to use SoepEnvelope Instead of SoapSerializationEnvelope Though when I replace this I get an error before the try cache block, causing my app to crash. Error: 11-04 16:23:26.786: E/AndroidRuntime(26447): Caused by: java.lang.ClassCastException: org.ksoap2.serialization.SoapObject cannot be cast to org.kxml2.kdom.Node Which is caused by these lines: request.addSoapObject(UserCredentials); soapEnv.setOutputSoapObject(request); This may be a solution though, how do I go about this? I found nothing about using a SoapEnvelope instead of a SoapSerializationEnvelope except for this awesome tutorial: http://ksoap.objectweb.org/project/mailingLists/ksoap/msg00849.html

    Read the article

  • Call webservice from Android using KSoap simply returning "error" string

    - by w00tfest99
    I'm trying to use ksoap to call a simple webservice. I followed this video to try to get started. When I call "getResponse()" on the envelope I just get the string "Error". There's no exceptions thrown or any other detail. I've successfully connected to a simple webservice I just setup on my local machine. Could this potentially be related to being behind a proxy server here at work? My code is below: String SOAP_ACTION="http://tempuri.org/CelsiusToFahrenheit"; String METHOD_NAME = "CelsiusToFahrenheit"; String NAMESPACE = "http://tempuri.org"; String URL = "http://w3schools.com/webservices/tempconvert.asmx"; SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); PropertyInfo pi = new PropertyInfo(); pi.setName("Celsius"); pi.setValue("32"); request.addProperty(pi); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet = true; envelope.setOutputSoapObject(request); HttpTransportSE aht = new HttpTransportSE(URL); try { aht.call(SOAP_ACTION, envelope); SoapPrimitive results = (SoapPrimitive)envelope.getResponse(); } catch (Exception e) { e.printStackTrace(); }

    Read the article

  • Android ksoap nested soap objects in request gives error in response

    - by Smalesy
    I'm trying to do the following soap request on Android using KSOAP. It contains a list of nested soap objects. However, I must be doing something wrong as I get an error back. The request I am trying to generate is as follows: <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <SetAttendanceMarks xmlns="http://hostname.net/"> <strSessionToken>string</strSessionToken> <LessonMarks> <Count>int</Count> <LessonMarks> <LessonMark> <StudentId>int</StudentId> <EventInstanceId>int</EventInstanceId> <Mark>string</Mark> </LessonMark> <LessonMark> <StudentId>int</StudentId> <EventInstanceId>int</EventInstanceId> <Mark>string</Mark> </LessonMark> </LessonMarks> </LessonMarks> </SetAttendanceMarks> </soap12:Body> </soap12:Envelope> My code is as follows: public boolean setAttendanceMarks(List<Mark> list) throws Exception { boolean result = false; String methodName = "SetAttendanceMarks"; String soapAction = getHost() + "SetAttendanceMarks"; SoapObject lessMarksN = new SoapObject(getHost(), "LessonMarks"); for (Mark m : list) { PropertyInfo smProp =new PropertyInfo(); smProp.setName("LessonMark"); smProp.setValue(m); smProp.setType(Mark.class); lessMarksN.addProperty(smProp); } PropertyInfo cProp =new PropertyInfo(); cProp.setName("Count"); cProp.setValue(list.size()); cProp.setType(Integer.class); SoapObject lessMarks = new SoapObject(getHost(), "LessonMarks"); lessMarks.addProperty(cProp); lessMarks.addSoapObject(lessMarksN); PropertyInfo sProp =new PropertyInfo(); sProp.setName("strSessionToken"); sProp.setValue(mSession); sProp.setType(String.class); SoapObject request = new SoapObject(getHost(), methodName); request.addProperty(sProp); request.addSoapObject(lessMarks); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER12); envelope.dotNet = true; envelope.setOutputSoapObject(request); HttpTransportSE androidHttpTransport = new HttpTransportSE(getURL()); androidHttpTransport.debug = true; androidHttpTransport.call(soapAction, envelope); String a = androidHttpTransport.requestDump; String b = androidHttpTransport.responseDump; SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn; SoapObject res = (SoapObject) resultsRequestSOAP.getProperty(0); String resultStr = res.getPropertyAsString("Result"); if (resultStr.contentEquals("OK")) { result = true; } return result; } The error I get is as follows: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <soap:Fault> <soap:Code> <soap:Value>soap:Sender</soap:Value> </soap:Code> <soap:Reason> <soap:Text xml:lang="en">Server was unable to read request. ---&gt; There is an error in XML document (1, 383). ---&gt; The specified type was not recognized: name='LessonMarks', namespace='http://gsdregapp.net/', at &lt;LessonMarks xmlns='http://gsdregapp.net/'&gt;.</soap:Text> </soap:Reason> <soap:Detail /> </soap:Fault> </soap:Body> </soap:Envelope> Can anybody tell me what I am doing wrong? I will be most grateful for any assistance!

    Read the article

  • Having trouble binding a ksoap object to an ArrayList in Android

    - by Maskau
    I'm working on an app that calls a web service, then the webservice returns an array list. My problem is I am having trouble getting the data into the ArrayList and then displaying in a ListView. Any ideas what I am doing wrong? I know for a fact the web service returns an ArrayList. Everything seems to be working fine, just no data in the ListView or the ArrayList.....Thanks in advance! EDIT: So I added more code to the catch block of run() and now it's returning "org.ksoap2.serialization.SoapObject".....no more no less....and I am even more confused now... package com.maskau; import java.util.ArrayList; import org.ksoap2.SoapEnvelope; import org.ksoap2.serialization.PropertyInfo; import org.ksoap2.serialization.SoapObject; import org.ksoap2.serialization.SoapSerializationEnvelope; import org.ksoap2.transport.AndroidHttpTransport; import android.app.*; import android.os.*; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; import android.widget.TextView; import android.view.View; import android.view.View.OnClickListener; public class Home extends Activity implements Runnable{ /** Called when the activity is first created. */ public static final String SOAP_ACTION = "http://bb.mcrcog.com/GetArtist"; public static final String METHOD_NAME = "GetArtist"; public static final String NAMESPACE = "http://bb.mcrcog.com"; public static final String URL = "http://bb.mcrcog.com/karaoke/service.asmx"; String wt; public static ProgressDialog pd; TextView text1; ListView lv; static EditText myEditText; static Button but; private ArrayList<String> Artist_Result = new ArrayList<String>(); @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); myEditText = (EditText)findViewById(R.id.myEditText); text1 = (TextView)findViewById(R.id.text1); lv = (ListView)findViewById(R.id.lv); but = (Button)findViewById(R.id.but); but.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { wt = ("Searching for " + myEditText.getText().toString()); text1.setText(""); pd = ProgressDialog.show(Home.this, "Working...", wt , true, false); Thread thread = new Thread(Home.this); thread.start(); } } ); } public void run() { try { SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); PropertyInfo pi = new PropertyInfo(); pi.setName("ArtistQuery"); pi.setValue(Home.myEditText.getText().toString()); request.addProperty(pi); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet = true; envelope.setOutputSoapObject(request); AndroidHttpTransport at = new AndroidHttpTransport(URL); at.call(SOAP_ACTION, envelope); java.util.Vector<Object> rs = (java.util.Vector<Object>)envelope.getResponse(); if (rs != null) { for (Object cs : rs) { Artist_Result.add(cs.toString()); } } } catch (Exception e) { // Added this line, throws "org.ksoap2.serialization.SoapObject" when run Artist_Result.add(e.getMessage()); } handler.sendEmptyMessage(0); } private Handler handler = new Handler() { @Override public void handleMessage(Message msg) { ArrayAdapter<String> aa; aa = new ArrayAdapter<String>(Home.this, android.R.layout.simple_list_item_1, Artist_Result); lv.setAdapter(aa); try { if (Artist_Result.isEmpty()) { text1.setText("No Results"); } else { text1.setText("Complete"); myEditText.setText("Search Artist"); } } catch(Exception e) { text1.setText(e.getMessage()); } aa.notifyDataSetChanged(); pd.dismiss(); } }; }

    Read the article

  • Android to .NET - XML-RPC or KSoap?

    - by BenYL
    We are designing an internal system that will have a .NET PC base station and many Android mobiles, communicating over WiFi. Can't decide between SOAP or XML-RPC protocol. Primary concerns are maturity, compatibility, and the minimizing of coding/integration, in that order. Which is best? Ben

    Read the article

  • Return ArrayList from .net web service to android application using kSoap

    - by benjamin schultz
    My web service is returning quite a bit of data, so i'm storing it in an arraylist and returning that to my application. I don't know whether or not this is the preferred method or not. When the arraylist is returned and displayed in my application, it also displays the arraylists "anyType" section. I'm new to this whole process so i'm sure i'm missing something somewhere or going about this incorrectly. Can anyone point me in the right direction please?

    Read the article

  • NullPointerException when trying to connect to web service using kSoap method Android

    - by benjamin schultz
    My web service should be returning an integer, but every time i run the code i get the NullPointerException error. Any ideas or help would be very appreciated Here's my code: public class CGCountTest extends Activity { TextView testTV; private static final String NAMESPACE = "http://passport-america.com/webservices/"; private static final String URL = "http://localhost:11746/Service1.asmx"; private static final String SOAP_ACTION = "http://www.passport-america.com/webservices/getCGCount"; private static final String METHOD_NAME = "getCGCount"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.soap_test); SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet = true; envelope.setOutputSoapObject(request); HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); try { androidHttpTransport.call(SOAP_ACTION, envelope); java.lang.Integer result = (Integer)envelope.getResponse(); TextView testTV = (TextView)findViewById(R.id.testTV); result.toString(); testTV.setText(result); } catch(Exception e) { testTV.setText(e.getMessage()); } } here's the logcat 06-02 15:13:36.557: WARN/dalvikvm(326): threadid=3: thread exiting with uncaught exception (group=0x4001aa28) 06-02 15:13:36.557: ERROR/AndroidRuntime(326): Uncaught handler: thread main exiting due to uncaught exception 06-02 15:13:36.876: ERROR/AndroidRuntime(326): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pa.passammain/com.pa.passammain.CGCountTest}: java.lang.NullPointerException 06-02 15:13:36.876: ERROR/AndroidRuntime(326): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401) 06-02 15:13:36.876: ERROR/AndroidRuntime(326): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417) 06-02 15:13:36.876: ERROR/AndroidRuntime(326): at android.app.ActivityThread.access$2100(ActivityThread.java:116) 06-02 15:13:36.876: ERROR/AndroidRuntime(326): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) 06-02 15:13:36.876: ERROR/AndroidRuntime(326): at android.os.Handler.dispatchMessage(Handler.java:99) 06-02 15:13:36.876: ERROR/AndroidRuntime(326): at android.os.Looper.loop(Looper.java:123) 06-02 15:13:36.876: ERROR/AndroidRuntime(326): at android.app.ActivityThread.main(ActivityThread.java:4203) 06-02 15:13:36.876: ERROR/AndroidRuntime(326): at java.lang.reflect.Method.invokeNative(Native Method) 06-02 15:13:36.876: ERROR/AndroidRuntime(326): at java.lang.reflect.Method.invoke(Method.java:521) 06-02 15:13:36.876: ERROR/AndroidRuntime(326): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 06-02 15:13:36.876: ERROR/AndroidRuntime(326): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 06-02 15:13:36.876: ERROR/AndroidRuntime(326): at dalvik.system.NativeStart.main(Native Method) 06-02 15:13:36.876: ERROR/AndroidRuntime(326): Caused by: java.lang.NullPointerException 06-02 15:13:36.876: ERROR/AndroidRuntime(326): at com.pa.passammain.CGCountTest.onCreate(CGCountTest.java:46) 06-02 15:13:36.876: ERROR/AndroidRuntime(326): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123) 06-02 15:13:36.876: ERROR/AndroidRuntime(326): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364) 06-02 15:13:36.876: ERROR/AndroidRuntime(326): ... 11 more i think my url string may be the problem, but i've tried using my ip with no luck

    Read the article

  • Passing an object as parameter from Andriod to web service using ksoap

    - by user3718626
    I have an object called User which implements KvmSerializable. Would like to pass this object to the webservice. PropertyInfo pi = new PropertyInfo(); pi.setName("obj"); pi.setValue(user); pi.setType(user.getClass()); request.addProperty(pi); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.setOutputSoapObject(request); envelope.addMapping(NAMESPACE, "User",User.class); HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); I get the following error.... SoapFault - faultcode: 'soapenv:Server' faultstring: 'Unknow type {http://users.com}User' faultactor: 'null' detail: org.kxml2.kdom.Node@53263024 at org.ksoap2.serialization.SoapSerializationEnvelope.parseBody(SoapSerializationEnvelope.java:141) at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:140) at org.ksoap2.transport.Transport.parseResponse(Transport.java:118) at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:272) at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:118) at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:113) at com.compete.WebServiceCallTask.getQuestion(WebServiceCallTask.java:114) at com.compete.WebServiceCallTask.doInBackground(WebServiceCallTask.java:53) at com.compete.WebServiceCallTask.doInBackground(WebServiceCallTask.java:1) at android.os.AsyncTask$2.call(AsyncTask.java:287) at java.util.concurrent.FutureTask.run(FutureTask.java:234) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) at java.lang.Thread.run(Thread.java:856) Appreciate if any one can point me to an sample code or can direct me what is the issue. Thanks.

    Read the article

  • How to call a .NET Webservice from Android using KSOAP2?

    - by Rajapandian
    Hai to All,I have a problem while calling the webservice,i have a .NET web service in the server and i am using KSOAP2(ksoap2-j2se-full-2.1.2) in android.While running the program i got an runtime Exception like "org.ksoap2.serialization.SoapPrimitive". I dont know what to do.Here is my code. package projects.ksoap2sample; import org.ksoap2.SoapEnvelope; import org.ksoap2.serialization.SoapObject; import org.ksoap2.serialization.SoapSerializationEnvelope; import org.ksoap2.transport.HttpTransportSE; import android.app.*; import android.os.*; import android.widget.TextView; public class ksoap2sample extends Activity { /** Called when the activity is first created. */ private static final String SOAP_ACTION = "http://tempuri.org/HelloWorld"; private static final String METHOD_NAME = "HelloWorld"; private static final String NAMESPACE = "http://tempuri.org/"; private static final String URL = "http://192.168.1.19/TestWeb/WebService.asmx"; TextView tv; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); tv=(TextView)findViewById(R.id.text1); try { SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); //request.addProperty("prop1", "myprop"); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet=true; envelope.setOutputSoapObject(request); HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); androidHttpTransport.call(SOAP_ACTION, envelope); Object result = (Object)envelope.getResponse(); String[] results = (String[]) result; tv.setText( ""+results[0]); } catch (Exception e) { tv.setText(e.getMessage()); } } } May be my code is wrong.please help me. Regards Rajapandian

    Read the article

  • HttpTransportSE requestDump gives NullPointerException

    - by Chamila
    Hi, I'm trying to access a webservice in Android via Ksoap2 for android. The SoapObject is created ok, the S.o.p of the bodyOut outputs the desired strings. But when I do a requestDump of the HttpTransportSE object I create to make the call, a NullPointerException happens. In other words, the transport object is null. How can this happen? Web Service is at http://srilanka.lk:9080/services/CropServiceProxy?wsdl This service works very well with SoapUI. SoapUI Request <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:v1="http://schemas.icta.lk/xsd/crop/handler/v1/"> <soap:Header/> <soap:Body> <v1:getCropDataList> <v1:code>ABK</v1:code> </v1:getCropDataList> </soap:Body> </soap:Envelope> SoapUI Response <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"> <soapenv:Body> <ns1:getCropDataListResponse xmlns:ns1="http://schemas.icta.lk/xsd/crop/handler/v1/"> <ns1:cropInfo> <ns1:name>Ambul Kesel</ns1:name> <ns1:price>35.0</ns1:price> <ns1:location>Dambulla</ns1:location> </ns1:cropInfo> <ns1:cropInfo> <ns1:name>Ambul Kesel</ns1:name> <ns1:price>40.0</ns1:price> <ns1:location>Dambulla</ns1:location> </ns1:cropInfo> </ns1:getCropDataListResponse> </soapenv:Body> </soapenv:Envelope> Client Side Complex Type KvmSerializable implementation public class CropInfo implements KvmSerializable { private String name; private float price; private String location; @Override public Object getProperty(int arg0) { switch (arg0){ case 0: return name; case 1: return price; case 2: return location; default: return null; } } @Override public int getPropertyCount() { return 3; } @Override public void getPropertyInfo(int arg0, Hashtable arg1, PropertyInfo arg2) { switch (arg0){ case 0: arg2.type = PropertyInfo.STRING_CLASS; arg2.name = "Name"; break; case 1: arg2.type = Float.class; arg2.name = "Price"; break; case 2: arg2.type = PropertyInfo.STRING_CLASS; arg2.name = "Location"; break; default: break; } } @Override public void setProperty(int arg0, Object arg1) { switch(arg0){ case 0: name = arg1.toString(); break; case 1: price = Float.parseFloat(arg1.toString()); case 2: location = arg1.toString(); default: break; } } } Web Service Call public void btnOnClick(View v){ String NAMESPACE = "http://schemas.icta.lk/xsd/crop/handler/v1/"; String URL = "http://220.247.225.202:9080/services/CropServiceProxy.CropServiceProxyHttpSoap12Endpoint"; String method_name = "getCropDataList"; String SOAP_ACTION = "http://schemas.icta.lk/xsd/crop/handler/v1/getCropDataList"; SoapObject soap_request = new SoapObject(NAMESPACE, method_name); soap_request.addProperty("code", "ABK" ); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER12); envelope.setOutputSoapObject(soap_request); envelope.addMapping(NAMESPACE, "cropInfo", CropInfo.class); //envelope.dotNet=true; Marshal floatMarshal = new MarshalFloat(); floatMarshal.register(envelope); System.out.println("body out : " + envelope.bodyOut.toString()); //AndroidHttpTransport http_transport = new AndroidHttpTransport(URL); HttpTransportSE http_transport = new HttpTransportSE(URL); try { //NullPointerException HERE System.out.println(http_transport.requestDump); http_transport.call(SOAP_ACTION, envelope); //because we should expect a vector, two kinds of prices are given Vector<CropInfo> result_array = (Vector<CropInfo>)envelope.getResponse(); if(result_array != null){ for (CropInfo current_crop: result_array){ System.out.println(current_crop.getName()); System.out.println(Float.toString(current_crop.getPrice())); } } } catch (Exception e) { e.printStackTrace(); answer.setText("error caught"); //System.out.println(http_transport.responseDump); } // String result_string[] = (String[])result; //answer.setText("returned"); } Can anyone explain this?

    Read the article

  • Passing parameters from android to .Net Web Service

    - by benjamin schultz
    I have an Android application that uses kSoap in connecting to my web services. This particular one is passing in a string value as a parameter, then my web service will use that parameter to query my database via a stored procedure. Problem is, I know how to pass the parameter from android, but I don't know how to retrieve it in my .Net(vb) web service and use it. Anyone have any code examples or a link to a tutorial to help me out? Thanks!

    Read the article

  • Blackberry SOAP Webservice

    - by Krishnan
    Hi Friends, What is way to connect to SOAP based web service from Blackberry Application. Every one is using KSoap Library. Is there no native support in Blackeberry SDK to connect to webservice.?

    Read the article

  • some userful 3rd party API's for j2me

    - by Vivart
    Fixed Point Integer Math MathFP kSOAP is a SOAP web service client library for constrained Java environments such as Applets or J2ME applications (CLDC / CDC / MIDP). http://sourceforge.net/projects/ksoap2/ kXML is a lean Common XML API with namespace and WAP support that is intended to fit into the JAVA KVM for limited devices like the Palm Pilot. http://sourceforge.net/projects/kxml/ UI library https://lwuit.dev.java.net/ http://www.j2mepolish.org/cms/

    Read the article

  • KSoap2 list handling - is this the correct way?

    - by oozoo
    Hello, ksoap-newbie here I have a basic soap service running on glassfish, that returns List<String> like this <?xml version="1.0" encoding="UTF-8"?> <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:getNamesResponse xmlns:ns2="http://namespace/"> <return>Name1</return> <return>Name2</return> </ns2:getNamesResponse> </S:Body> </S:Envelope> now in ksoap2 (android) I have to iterate the soap-object properties to get my list back: SoapObject result = (SoapObject) envelope.bodyIn; for(int i=0;i<result.getPropertyCount();i++) { list.add(result.getProperty(i)); } is there a better way? I couldn't find any class mapper in my implementation. thanks in advance

    Read the article

  • FACING ERROR WHILE CALLING AXIS2 WEB SERVICE ...

    - by darshanv
    Hello , I am new to axis ,I have created a web servcie with couple of methods using axis2 and deployed it on tomcat.And am calling that web service from my android program with the help of ksoap.But wen i call a method which doesn't take any parameter am gettin fine reply from web service which i can able to see on my screen,But wen i call anothr method which takes a string argument am getting namespace exception on server WEB SERVICE CODE IS ..... package Guru; public class DarshanSays { public String getMsg(String h) { return h+" ..the power of change is eVolution..."; } public String getEmpty(String d)throws Exception { return "empty string from tomcattttttttttt"; } } //AND program is String soap_action="http://Guru/getEmpty"; String method_nm="getEmpty"; String nmspc="http://Guru/"; String url7="//192.168.10.182:8080/axis2/services/Friday";//http: SoapObject request = new SoapObject(url7,method_nm); /*sending method parameters with SoapObject */ request.newInstance(); request.addProperty("h","darshan.....");//sending a parameter to a method SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.bodyOut=request; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.XSD; Log.d("Step","3"); envelope.dotNet=true; /*setting outputsoap object sending request */ envelope.setOutputSoapObject(request); /*HttpTransportSE object creating sending it url */ androidHttpTransport = new HttpTransportSE(url7); //androidHttpTransport.setXmlVersionTag(""); Log.d("Step","4"); try{ androidHttpTransport.debug=true; androidHttpTransport.call(nmspc,envelope); } catch(Exception e) { Log.d("Transportcall",""+e); alert=new AlertDialog.Builder(this); alert.setMessage(""+e); alert.show(); } //exception is throw. Log.d("Step","5"); try { Log.d("giving...","resp"); SoapPrimitive sp=(SoapPrimitive)envelope.getResponse(); String hh=sp.toString(); Log.d("reply from web ser",".."+hh.toString()); //and erorr msg is SoapFault - faultcode:'soapenv:Server' faultstring: 'namespace mismatch require http://Guru found 192.168.10.182:8080/axis2/services/Friday' faultactor: 'null' detail: org.kxml2.kdom.Node@43d31390 ERROR IS coming only when am calling parameterized method. I am facing this issue only when am giving a call to parameterized method. Please Help.. thanks Darshan V

    Read the article

  • Is it possible to swap lines of xml code in soap

    - by John
    I wish to send a request like <v:Envelope xmlns:i="xxx"> <v:Header /> <v:Body> <sendTwoWaySmsMessage xmlns="xxx" id="o0" c:root="1"> <connectionId i:type="d:string">connectionId</connectionId> <twoWaySmsMessage> <message i:type="d:string">love it. It seems to work</message> <mobiles i:type="d:string">345</mobiles> <messageId i:type="d:string">123</messageId> </twoWaySmsMessage> </sendTwoWaySmsMessage> </v:Body> </v:Envelope> what i get is <v:Envelope xmlns:i="xxx"> <v:Header /> <v:Body> <sendTwoWaySmsMessage xmlns="xxx" id="o0" c:root="1"> <twoWaySmsMessage> <message i:type="d:string">love it. It seems to work</message> <mobiles i:type="d:string">345</mobiles> <messageId i:type="d:string">123</messageId> </twoWaySmsMessage> <connectionId i:type="d:string">connectionId</connectionId> </sendTwoWaySmsMessage> </v:Body> </v:Envelope> code is SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE, url); SoapObject message = new SoapObject("", "twoWaySmsMessage"); request.addProperty("connectionId", did); message.addProperty("message", "love it. It seems to work"); message.addProperty("mobiles", "435"); message.addProperty("messageId", "123"); request.addSoapObject(message); request.setProperty(0, "connectionId"); when i use SoapUI with the second with the "connectionId" swaped it seem to work can anyone help. of have ideas. I have looked at just about every ksoap question out there and cant seem to find an answer?

    Read the article

  • Parsing a JSON Response from a .Net webservice

    - by Maskau
    Just to get this out in the open I am new to JAVA, KSOAP, and JSON. So I'll try to explain this the best I can. A while ago I created a webservice to be consumed by Blackberry Apps that we're built using the plug in for Visual Studio. Now the project I am working on, I want to consume the same webservice for Android devices. For the most part I have the base code for the Android app done and working. Here's my problem: I can successfully call the webservice and get a response. I know from creating the webservice that it sends a JSON response. My problem is trying to parse through the JSON response. I have found a few examples that I have been suiting to my needs however I am hung up on one thing. In the JSON each element is preceeded by "anyType" which is forcing my code to return no results (Ultimately I am binding the data to an ArrayList) Here's what I get if I "getProperty(0).toString()... anyType{Artist=anyType{TrackName=Champagne Supernova;}; Here is the code I am using to parse the JSON Object.... SoapObject gr = (SoapObject)envelope.getResponse(); String ro = gr.getProperty(0).toString(); //Added just to see structure of response Artist_Result.add(gr.toString()); if (ro.startsWith("{")) { JSONObject JSONObj = new JSONObject(ro); Iterator<String> itr = JSONObj.keys(); while (itr.hasNext()) { String key = (String)itr.next(); String value = JSONObj.getString(key); //bundleResult.putString(key, value); Artist_Result.add(value); } } else if (ro.startsWith("[")) { JSONArr = new JSONArray(ro); for (int i = 0; i < JSONArr.length(); i++) { JSONObj = (JSONObject)JSONArr.get(i); //bundleResult.putString(String.valueOf(i), JSONObj.toString()); Artist_Result.add(JSONObj.toString()); } } WebService Code: [WebMethod] [return: System.Xml.Serialization.XmlArrayItemAttribute(typeof(Artist))] public Artist[] GetArtist(string ArtistQuery) { // All the SQL Stuff Here SqlDataReader sReader; sReader = cmd.ExecuteReader(); List<Artist> Artists = new List<Artist>(); while (sReader.Read()) { Artist result = new Artist(); result.TrackName = sReader.GetString(0); Artists.Add(result); } sReader.Close(); sqlConn.Close(); return Artists.ToArray(); } public class Artist { public string TrackName; } Sample of XML Output from a browser: <?xml version="1.0" encoding="utf-8" ?> - <ArrayOfArtist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://bb.mcrcog.com/"> - <Artist> <TrackName>Champagne Supernova</TrackName> </Artist> - <Artist> <TrackName>Don't Look Back In Anger</TrackName> </Artist> - <Artist> <TrackName>D'you Know What I Mean</TrackName> </Artist> - <Artist> <TrackName>Go Let It Out</TrackName> </Artist> I have a feeling I will need to implement a Class, and Getters/Setters on the Android side. I'm just not sure how to go about doing that. Any help would be greatly appreciated!

    Read the article

  • problems calling webservices through the https connection

    - by shivaji123
    i have done an application in BlackBerry which takes username & password with url link which is a link of server here i am calling some webservices but it is doing the connection in https so when i take the username password & url link & hit the login button it basically calls a webservice but then the application connecting to the webservice for ever & after some time i get the error massage something "unreported exception the application is not responding" .& then the application crashes out.Also i am using the SOAP client library . this is the piece of code synchronized (this) { try { _httpconn = (HttpConnection) Connector.open(url,Connector.READ_WRITE);//Connector.READ_WRITE //_httpconn =(StreamConnection)Connector.open(url); //System.out.println("-----------httpsconnection() PART--------------------"); _httpconn.setRequestMethod(HttpConnection.POST); //_httpconn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); //System.out.println("-----------httpsconnection() PART- **-------------------"); _httpconn.setRequestProperty("SOAPAction", Constants.EXIST_STR); //System.out.println("-----------httpsconnection() PART-REQUEST -------------------"); _httpconn.setRequestProperty("Content-Type", "text/soap+xml"); //System.out.println("-----------httpsconnection() PART- CONTENT-------------------"); _httpconn.setRequestProperty("User-Agent", "kSOAP/1.0"); //System.out.println("-----------httpsconnection() PART-USER Agent-------------------"); String clen = Integer.toBinaryString(input.length()); _httpconn.setRequestProperty("Content-Length", clen); //System.out.println("-----------httpsconnection() Content-Length--------------------"); _out = _httpconn.openDataOutputStream(); //System.out.println(input+"-----------input--------------------"+url); _out.write(input.getBytes()); _out.flush(); // may or may not be needed. //int rc = _httpconn.getResponseCode(); int rc = _httpconn.getResponseCode(); if(rc == HttpConnection.HTTP_OK) { isComplete = true; _in = _httpconn.openInputStream(); msg = new StringBuffer(); byte[] data = new byte[1024]; int len = 0; int size = 0; while ( -1 != (len = _in.read(data)) ) { msg.append(new String(data, 0, len)); size += len; } responsData = msg.toString(); System.out.println("-----------responsData "+responsData); } if(responsData!=null) isSuccessful = true; stop(); } catch (InterruptedIOException interrIO) { //errStr = "Network Connection hasn't succedded. "+ //"Please check APN setting."; UiApplication.getUiApplication().invokeLater(new Runnable() { public void run() { Status.show("Network Connection hasn't succedded. "+ "Please try again later."); } }); isComplete = true; System.out.println(interrIO); stop(); } catch (IOException interrIO) { System.out.println("-----------IO EXCEPTION--------- "+interrIO); //errStr = "Network Connection hasn't succedded. "+ //"Please check APN setting." ; UiApplication.getUiApplication().invokeLater(new Runnable() { public void run() { Status.show("Network Connection hasn't succedded. "+ "Please try again later." ); } }); isComplete = true; System.out.println(interrIO); stop(); } catch (Exception e) { System.out.println(e); //errStr = "Unable to connect to the internet at this time. "+ //"Please try again later."; UiApplication.getUiApplication().invokeLater(new Runnable() { public void run() { Status.show("Unable to connect to the internet at this time. "+ "Please try again later." ); } }); isComplete = true; stop(); } finally { try { if(_httpconn != null) { _httpconn.close(); _httpconn = null; } if(_in != null) { _in.close(); _in = null; } if(_out != null) { _out.close(); _out = null; } } catch(Exception e) { System.out.println(e); UiApplication.getUiApplication().invokeLater(new Runnable() { public void run() { Status.show("Unable to connect to the internet at this time. "+ "Please try again later." ); } }); } } } } can anybody help me out. Thanks in advance

    Read the article

  • XMLPULLPARSEREXCEPTION...in KSOAP2

    - by aka47
    iam using KSOAP2 for web services. my client is BlackBerry Phone and Server is KeyRingLabs.com. i am using php page for connection...i have taken this code form a Forum.and modified it according to my requirements...but I am having XMLPULLPARSER EXCEPTION...can any body help??? here is my code.... import net.rim.device.api.ui.; import net.rim.device.api.ui.component.; import net.rim.device.api.ui.container.; import net.rim.device.api.system.; import java.util.; import org.ksoap2.; import org.ksoap2.serialization.; import org.ksoap2.transport.; import java.io.IOException; import org.ksoap2.SoapEnvelope; import org.ksoap2.SoapFault; import org.ksoap2.serialization.SoapObject; import org.ksoap2.serialization.SoapSerializationEnvelope; import org.ksoap2.transport.HttpTransport; import org.xmlpull.v1.XmlPullParserException; final class StockQuoteDemo extends UiApplication { public static void main (String[] args) { StockQuoteDemo theApp = new StockQuoteDemo (); theApp.enterEventDispatcher (); } public StockQuoteDemo () { pushScreen (new StockQuoteScreen ()); //doSOAP(); } final class StockQuoteScreen extends MainScreen { public static final String action = "http://keyringlabs.com/Login"; public static final String namespaceRoot = "bbpointofsale.com"; //public static final String webroot = "http://192.168.1.2/bbpointofsale.com/"; public static final String webroot = "http://192.168.0.35/"; //public static final String webroot = "http://www.bbpointofsale.com"; public String errorMessage; public String key; public String transactionID; private HttpTransport transport; private SoapSerializationEnvelope envelope; public StockQuoteScreen () { //transport = new HttpTransport(webroot + "bb/service/index.php"); transport = new HttpTransport(webroot+"Disk/rashid11/index4.php"); transport.debug = true; envelope = new SoapSerializationEnvelope(SoapEnvelope.VER12); key = null; envelope.encodingStyle = SoapSerializationEnvelope.XSD1999; ProcessLogin("[email protected]","123456"); //Dialog.alert("GEN 1"); //Dialog.alert("Warr Gai Vai!!!"); } public boolean onClose () { Dialog.alert ("Goodbye!"); System.exit (0); return true; } public boolean ProcessLogin(String email, String password) { System.err.println("Starting The Process"); errorMessage = ""; String namespace = "urn:" + namespaceRoot + ":login"; //System.err.println("LINK:"+namespace); // SoapObject message = new SoapObject(namespace, "login"); SoapObject message = new SoapObject(namespaceRoot, "login"); message.addProperty("email", email); message.addProperty("password", password); envelope.bodyOut = message; // System.err.println("KSOAP:"+ envelope.toString()); //String soapAction = namespace + "#login"; String soapAction = "http://bbpointofsale.com/login"; // System.err.println("Action : "+soapAction); try { //transport.setXmlVersionTag(""); transport.call(soapAction, envelope); } catch (IOException e) { e.printStackTrace(); System.out.println("error: "+e.getMessage()); errorMessage = e.getMessage(); System.out.println("response1: "+transport.responseDump); return false; } catch (XmlPullParserException e) { e.printStackTrace(); errorMessage = e.getMessage(); System.out.println("request2: "+transport.requestDump); System.out.println("response2: "+transport.responseDump); return false; } try { SoapObject result = (SoapObject) ((SoapObject)envelope.getResponse()).getProperty(0); key = hackToGetResponse("serviceToken", result.toString()); if (key.length() > 0) { System.out.println("KEY:" + key); return true; } else { } } catch (SoapFault e) { errorMessage = e.getMessage(); System.out.println("response3: "+transport.responseDump); return false; } catch (Exception e) { errorMessage = e.getMessage(); System.err.println("response4: "+transport.responseDump); return false; } return false; } public String hackToGetResponse(String key, String response) { System.out.println("hackToGetResponse:" + response); String start = "anyType{key=" + key + "; value="; String end = "; }"; if (response.indexOf(start) == -1 || response.indexOf(end) == -1) return ""; System.out.println("hackToGetResponse:" + "response.substring(0, " + response.indexOf(start) + ").substring(0, " + response.indexOf(end) + ");"); response = response.substring(response.indexOf(start) + start.length()); response = response.substring(0, response.indexOf(end)); if (response.indexOf("anyType{}") != -1) return ""; return response; } } } //******************PHP FILE************************ $server = new SoapServer(null, array('uri' = "urn:keyringlabs.com")); //$server = new SoapServer(null, array('uri' = "urn: bbpointofsale.com")); $server-addFunction("login"); //$email='[email protected]'; //$pass='123456'; function login($email, $pass) { if (strlen($email) == 0) { return Array('serviceToken' => ''); } elseif (strlen($pass) == 0) { return Array('serviceToken' => ''); } else { $objMerchant = Merchant::LoadByEmailPassword($email, $pass); if ($objMerchant == null || $objMerchant->Id &lt==1) { return Array('serviceToken' => ''); } else { $key = uniqid(); $objSess = new Merchantsessions(); $objSess->MerchantID = $objMerchant->Id; $objSess->ServiceToken = $key; $objSess->Save(); } } $result = Array('serviceToken' => $key); //print $result; return $result; } ? ///**************************************** is there any need of an XML page or something..to run it perfectly...please help thank you for your time!

    Read the article

1