ksoap v2 connect to WCF Webservice

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

ksoap v2 connect to WCF Webservice

Postby sh33p » Mon Oct 15, 2012 12:39 pm

Hi Guys,

i am trying now for 4 days to solve this problem. I'm using the ksoap v2 Library to connect to a WCF Webservice. But there is no response from the server. I don't get any result. Here is my client code:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.  try{
  3.        
  4.         String NAMESPACE = "http://tempuri.org/";
  5.         String METHOD_NAME = "getFeedback";
  6.         String SOAP_ACTION = "http://tempuri.org/IFeedbackService/getFeedback/";
  7.         String URL= "xxxx/Post/FeedbackService.svc";
  8.  
  9.         SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
  10.  
  11.        
  12.        
  13.      
  14.  
  15.        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
  16.                 SoapEnvelope.VER12);
  17.        envelope.dotNet = true;
  18.         envelope.setOutputSoapObject(request);
  19.        
  20.        
  21.         HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
  22.  
  23.        
  24.         androidHttpTransport.call(SOAP_ACTION, envelope);
  25.        
  26.         SoapPrimitive result = (SoapPrimitive) envelope.getResponse();
  27.         ergebnis.setText(result.toString());
  28.        
  29.        }
  30.        
  31.        catch(Exception e){
  32.            
  33.            e.printStackTrace();
  34.        }
  35.  
  36.  
  37.     }
  38.  
  39.  
Parsed in 0.034 seconds, using GeSHi 1.0.8.4


String URL= "xxxx/Post/FeedbackService.svc"; i'm not posting the ip-address ;)

And here is my WSDL:

<?xml version="1.0" encoding="utf-8" ?>
- <wsdl:definitions name="FeedbackService" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">
- <wsdl:types>
- <xsd:schema targetNamespace="http://tempuri.org/Imports">
<xsd:import schemaLocation="http://localhost:3158/Post/FeedbackService.svc?xsd=xsd0" namespace="http://tempuri.org/" />
<xsd:import schemaLocation="http://localhost:3158/Post/FeedbackService.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
</xsd:schema>
</wsdl:types>
- <wsdl:message name="IFeedbackService_getFeedback_InputMessage">
<wsdl:part name="parameters" element="tns:getFeedback" />
</wsdl:message>
- <wsdl:message name="IFeedbackService_getFeedback_OutputMessage">
<wsdl:part name="parameters" element="tns:getFeedbackResponse" />
</wsdl:message>
- <wsdl:portType name="IFeedbackService">
- <wsdl:operation name="getFeedback">
<wsdl:input wsaw:Action="http://tempuri.org/IFeedbackService/getFeedback" message="tns:IFeedbackService_getFeedback_InputMessage" />
<wsdl:output wsaw:Action="http://tempuri.org/IFeedbackService/getFeedbackResponse" message="tns:IFeedbackService_getFeedback_OutputMessage" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="BasicHttpBinding_IFeedbackService" type="tns:IFeedbackService">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="getFeedback">
<soap:operation soapAction="http://tempuri.org/IFeedbackService/getFeedback" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="FeedbackService">
- <wsdl:port name="BasicHttpBinding_IFeedbackService" binding="tns:BasicHttpBinding_IFeedbackService">
<soap:address location="http://localhost:3158/Post/FeedbackService.svc" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

Can someone find something wrong?
thx 4 help.
sh33p
Once Poster
Once Poster
 
Posts: 1
Joined: Mon Oct 15, 2012 12:35 pm

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: No registered users and 3 guests