Note that there are some explanatory texts on larger screens.

plurals
  1. POC# CompactFramework Dynamically access SOAP Webservice
    primarykey
    data
    text
    <p>I am trying to create a small application for Windows CE devices running on a scanner that supports the .Net CompactFramework 3.5. The problem I have is, that I have to connect to a webservice with several IP-Addresses. On default .Net Framework I can change the property URL-Behaviour of the WebReference created with wsdl.exe to "Dynamic" and then I should be able to reference to an IP-Address defined in an config file. But not so in CompactFramework. I have changed the property already to dynamic an modified the constructor of the WebReference to the following:</p> <pre><code>public partial class WS_SCAN_WSDL : System.Web.Services.Protocols.SoapHttpClientProtocol { public WS_SCAN_WSDL(String ls_webserviceLocation) { this.Url = ls_webserviceLocation+"/WS_SCAN_WSDL"; } [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://192.1.2.4:8085/MYSCAN/WS_SCAN/SearchItems", RequestNamespace = "http://192.1.2.4:8085/MYSCAN/WS_SCAN", ResponseNamespace = "http://192.1.2.4:8085/MYSCAN/WS_SCAN", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public System.Data.DataSet SearchItems([System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] string iXMLString, out int sqlcode) { object[] results = this.Invoke("SearchItems", new object[] { iXMLString}); sqlcode = ((int)(results[1])); return ((System.Data.DataSet)(results[0])); } [...] } </code></pre> <p>Now when calling the webservice like:</p> <pre><code>WS_SCAN_WSDL lsrv_myService = new WS_SCAN_WSDL("http://192.1.2.4:8085/MYSCAN"); </code></pre> <p>everything works fine. If I will call it like:</p> <pre><code>WS_SCAN_WSDL lsrv_myService = new WS_SCAN_WSDL("http://194.3.1.6:8082/MYSCAN"); </code></pre> <p>Nothing will work. The WebService is avaiable on both Locations but the second calling will raise an WebException and I cannot proceed.</p> <p>Is there any possibility to create a dynamical WebService Proxy for .Net CompactFramework?</p> <p>//Edit: Maybe I have localized the main problem, but I am not sure if so. The Webservice description says the following:</p> <pre><code>&lt;definitions name="MY_SCAN_WSDL" targetNamespace="http://192.1.2.4:8085/MYSCAN"&gt; &lt;types&gt; [...] </code></pre> <p>and the other Webservice-description says:</p> <pre><code>&lt;definitions name="MY_SCAN_WSDL" targetNamespace="http://194.3.1.6:8082/MYSCAN"&gt; &lt;types&gt; [...] </code></pre> <p>Is it possible that the problem caused on the different namespaces? Is it possible that both webservices will have the same namespace on different IPs? Or is it possible to change this during runtime?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload