visual studio - cannot get xamarin andriod project to see portable class project classes in same solution -
environment - if need additional information, please let me know.
windows 10 developer laptop (latest service packs , updates)
visual studio 2017 15.3
.net - 4.7.02046 xamarin 4.6.0295
xamarin.android sdk 7.4.0.19 java 1.8
i have solution 4 projects
- portable class library
- android ui
- ios ui
- windows ui
i trying access class in portable class android ui. validateshoploginasync exists in portable class library. following android ui project , code.
boolean shopvalidated = validateshoploginasync("http://m.rometech.net/mwebservice/authenticateuser", globalshopid, globalshoplicense); the etechx namespace of portable class, yet not recognize in using. following android ui project , code.
using system; using etechx; using system.threading.tasks; using android.app; using android.text; using android.content; using android.runtime; using android.views; using android.widget; using android.os; i added reference android project portable class library.
here code in portable class library project , code snippet. task validateshoploginasync listed here.
using system; using system.collections.generic; using system.linq; using system.net.http; using system.text; using system.threading.tasks; using windows.web.http; using httpclient = system.net.http.httpclient; namespace etechx { class etechx { public async task<bool> validateshoploginasync(uri turi, string tshopidentification, string tshoplicense) { var soapstring = "<?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><authenticateuser xmlns='http://m.rometech.net/mwebservice'><shopidentification>" + tshopidentification + "</shopidentification><shoplicence>" + tshoplicense + "</shoplicence></authenticateuser></soap:body></soap:envelope>"; using (var client = new httpclient()) { client.defaultrequestheaders.add("soapaction", "http://m.rometech.net/mwebservice/authenticateuser"); var content = new stringcontent(soapstring, encoding.utf8, "text/xml"); var response = await client.postasync(turi, content); using (response) { var soapresponse = await response.content.readasstringasync(); return parsesoapresponse(soapresponse); } } } private bool parsesoapresponse(string soapresponse) { throw new notimplementedexception(); } } } everything have read says should work, must missing else, no 1 telling me in linking android project task in portable class library.
i scoured through 100's of comments on this. e-mail xamarin support. have yet respond have ever sent them. not sure if ever respond.
when working, solve ton of issues having right now. please assist.
Comments
Post a Comment