.NET connecting to AXIS Service. Methods don't have params or Datatypes
I got a few problems using the AXIS Service Reference from my .NET Project. I simply added the reference today int VS2010, but the provided Method do all have no return Type or Params. I just looked at the generated WSDL which looks like this : ( Shorted this Schema, maybe there are missing some message elements, but lets focus on the parameter thing )
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:intf="urn:api.broadmail.de/soap11/RpcSession" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns2="http://lang.java" xmlns:impl="urn:api.broadmail.de/soap11/RpcSession" targetNamespace="urn:api.broadmail.de/soap11/RpcSession" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:api.broadmail.de/soap11/RpcSession">
<xsd:import namespace="http://lang.java" />
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
<xsd:complexType name="WebserviceException">
<xsd:sequence>
<xsd:element name="cause" nillable="true" type="xsd:anyType" />
<xsd:element name="message" nillable="true" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="loginRequest">
<wsdl:part name="in0" type="xsd:long" />
<wsdl:part name="in1" type="xsd:string" />
<wsdl:part name="in2" type="xsd:string" />
</wsdl:message>
<wsdl:portType name="SessionWebservice">
<wsdl:operation name="login" parameterOrder="in0 in1 in2">
<wsdl:input name="loginRequest" message="impl:loginRequest" />
<wsdl:output name="loginResponse" message="impl:loginResponse" />
<wsdl:fault name="WebserviceException" message="impl:WebserviceException" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="RpcSessionSoapBinding" type="impl:SessionWebservice">
<wsdlsoap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" />
<wsdl:operation name="login">
<wsdlsoap:operation soapAction="" />
<wsdl:input name="loginRequest">
<wsdlsoap:body use="encoded" namespace="urn:api.broadmail.de/soap11/RpcSession" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:output name="loginResponse">
<wsdlsoap:body use="encoded" namespace="urn:api.broadmail.de/soap11/RpcSession" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:output>
<wsdl:fault name="WebserviceException">
<wsdlsoap:fault use="encoded" name="WebserviceException" namespace="urn:api.broadmail.de/soap11/RpcSession" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="SessionWebserviceService">
<wsdl:port name="RpcSession" binding="impl:RpcSessionSoapBinding">
<wsdlsoap:address location="https://api.broadmail.de/soap11/RpcSession" />
</wsdl:port>
</wsdl:service>
&l开发者_如何学Pythont;/wsdl:definitions>
Afterwards I looked at my generated proxy class "reference.cs", notifying that there are no params in the methods.
namespace OptivoInterfaceApp.broadmailSession {
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Namespace="urn:api.broadmail.de/soap11/RpcSession", ConfigurationName="broadmailSession.SessionWebservice")]
public interface SessionWebservice {
[System.ServiceModel.OperationContractAttribute()]
void login();
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public interface SessionWebserviceChannel : OptivoInterfaceApp.broadmailSession.SessionWebservice, System.ServiceModel.IClientChannel {
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class SessionWebserviceClient : System.ServiceModel.ClientBase<OptivoInterfaceApp.broadmailSession.SessionWebservice>, OptivoInterfaceApp.broadmailSession.SessionWebservice {
public SessionWebserviceClient() {
}
public SessionWebserviceClient(string endpointConfigurationName) :
base(endpointConfigurationName) {
}
public SessionWebserviceClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress) {
}
public SessionWebserviceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress) {
}
public SessionWebserviceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress) {
}
public void login() {
base.Channel.login();
}
}
}
Do I have to add the params manually to my proxy class or am I doin something else wrong ? I just tried to add the params manually but on the methodcall I only get an exception.
Any Hints for me ?
Maybe you should use WRAPPED style.
More info: http://axis.apache.org/axis/java/user-guide.html#ServiceStylesRPCDocumentWrappedAndMessage
精彩评论