Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Posts: 28
Registered: ‎04-08-2010
My Device: 9300
My Carrier: developer

Parameters in webservice

Hello, I am trying to pass two parameters to a c# webservice project, but they are empty when they arrive.

 

SoapObject rpc = new SoapObject(NAMESPACE, METHOD_NAME);
		
PropertyInfo p1 = new PropertyInfo();   
p1.name="email";
p1.type=PropertyInfo.STRING_CLASS;
        
PropertyInfo p2 = new PropertyInfo();
p2.name="pass";
p2.type=PropertyInfo.STRING_CLASS;
 
rpc.addProperty(p1, user);
rpc.addProperty(p2, pass);

        
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.bodyOut = rpc;
envelope.dotNet = true;
envelope.setOutputSoapObject(rpc);
envelope.encodingStyle = SoapSerializationEnvelope.XSD;

HttpTransport ht = new HttpTransport(URL);        

 

<?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>
    <DoLogin xmlns="URL_WEBSERVICE">
      <email>string</email>
      <pass>string</pass>
    </DoLogin>
  </soap:Body>
</soap:Envelope>

 In c# project:

[WebMethod]
public void DoLogin(string email, string pass)
{
}

 

Developer
Posts: 209
Registered: ‎04-30-2011
My Device: BlackBerry Z10
My Carrier: Airtel

Re: Parameters in webservice

Hi

R u not able to send the string on server?

Pawan

Developer
Posts: 17,011
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Parameters in webservice

i would suggest to use tcpmon to check the actually sent content.
to test webservices i usually use JUnit for J2SE (and HttpTransportSE from the ksoap package), makes it much faster.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter