Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Xamarin.Forms consum SOAP web service on android procect

$
0
0

Hi,
i want to consum a soap web service with xamarin forms on adroid. I use VS2019, .netstandard 2.0 and Xamarin 16.3.0.278. I generated a web reference and in created reference.cs the important code is:

[System.Web.Services.Protocols.SoapHeaderAttribute("Activation")]
[System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestElementName="report.bundle.operation", RequestNamespace="example.com/webService", ResponseElementName="report.bundle.operationResponse", ResponseNamespace="example.com/webService", Use=System.Web.Services.Description.SoapBindingUse.Literal)]
[return: System.Xml.Serialization.XmlElementAttribute("report.bundle.operationResponse")]
public reportbundleoperationResponseType reportbundleoperation([System.Xml.Serialization.XmlElementAttribute("report.bundle.operationRequest")] reportbundleoperationRequestType reportbundleoperationRequest) {
object[] results = this.Invoke("reportbundleoperation", new object[] {
reportbundleoperationRequest});
return ((reportbundleoperationResponseType)(results[0]));
}
The used wsdl file show me the follow code part for my funktion:

wsdl:operation name="report.bundle.operation"
wsdl:input message="bo:report.bundle.operationRequest"
wsdl:output message="bo:report.bundle.operationResponse"
wsdl:fault message="bo:Result" name="FaultName"
wsdl:operation
Then i call the method reportbundleoperation from my code. When i call the method from a windows forms project with .net 4.7 the web service works fine, but wenn i try to call the method from my xamarin forms project the service is connectet but i get an error "UnknownMethod: Method 'reportbundleoperation' is unknown in Object 'WebService' every time.

Then i watched the outgoing traffic with fiddler and it showed me follow:

soap:Body soap:encodingStyle="schemas.xmlsoap.org/soap/encoding
q1:reportbundleoperation xmlns:q1="example.com/webService"
reportbundleoperationRequest href="#id1"
q1:reportbundleoperation
The outgoing call try to call the method with name reportbundleoperation in place of report.bundle.operation

I think, the problem is the part [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestElementName="report.bundle.operation" .... .
I call the method with the name reportbundleoperation and in the web service the method named report.bundle.operation. I think the RequestElementName should transfer the name reportbundleoperation to report.bundle.operation .. isn't it?

Can sombody help me, can sombody tell me, if there is a bug in the .netstandard or in mono?

with best reguards

MH


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>