OK folks, thanks for the interest in this matter.
I should mention that i use VS.NET 2005 Beta 1 - could it be something here
? I should also mention that as a java guy, I am fairly noob when it comes to
..NET. My .NET project is based on the walkthrough "Consuming an XML Web
service" found in the .NET documentation - and I thought it all went pretty
well until I tried to run the thing remote ;-)
The webservice consists of three methods. The one I am trying on now is
simply to return a harcoded string. The "main" method (on which I get the
reflection error) is a more complicated one: It takes an input object as a
parameter (which among other things has an object attribute which has an
object attribute that is an array - see the WSDL-file at the end of the post)
The method itself does a lot of database calls and builds a object which is
returned.
I have created a C# WinForm project, added a web reference, pointed to the
remote WSDL-file (which it found okay) and added some buttons to invoke the
service. Here is the code for the simple project:
#region Using directives
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
#endregion
namespace JavaWebServiceTestClient
{
partial class BlockType : Form
{
public BlockType()
{
InitializeComponent();
}
private void btnPing_Click(object sender, EventArgs e)
{
try
{
adonis.IpamService ws = new adonis.IpamService();
lblPing.Text = ws.ipamPing();
}
catch
{
lblPing.Text = "ipamPing failed miserably ...";
}
}
.... and the other simple method call.
The line:
adonis.IpamService ws = new adonis.IpamService();
is the one that gives the reflection error on the request object. I have not
tried to call the actual method yet, as you can see.
And here is the WSDL-file. It went through IBM WebSphere Application
Developers v 5.1.2 WS-I compliance test - for what that is worth ...
I aplolgize for the long answer - and for the formatting of the file ;-)
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:s0="http://dto.common.ipam.incatel.com"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:s3="http://exceptions.common.ipam.incatel.com"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="http://business.server.ipam.incatel.com"
xmlns:s1="http://common.ipam.incatel.com"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
targetNamespace="http://business.server.ipam.incatel.com"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema xmlns:sql_java="http://sql.java"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:dto="http://dto.common.ipam.incatel.com"
xmlns:impl="http://business.server.ipam.incatel.com"
xmlns:common="http://common.ipam.incatel.com"
xmlns:intf="http://business.server.ipam.incatel.com"
elementFormDefault="qualified"
targetNamespace="http://dto.common.ipam.incatel.com">
<xsd:complexType name="IpamRequestObject">
<xsd:sequence>
<xsd:element minOccurs="0" name="asgnRefId" nillable="true"
type="xsd:int" />
<xsd:element minOccurs="0" name="hostRefName2" nillable="true"
type="xsd:string" />
<xsd:element name="function" nillable="true" type="xsd:int" />
<xsd:element minOccurs="0" name="hostRefName1" nillable="true"
type="xsd:string" />
<xsd:element name="orderId" nillable="true" type="xsd:long" />
<xsd:element minOccurs="0" name="poolName" nillable="true"
type="xsd:string" />
<xsd:element minOccurs="0" name="preResRefId" nillable="true"
type="xsd:string" />
<xsd:element minOccurs="0" name="ipAddressQuantity"
nillable="true" type="xsd:int" />
<xsd:element minOccurs="0" name="resRefId" nillable="true"
type="xsd:int" />
<xsd:element minOccurs="0" name="startIpAddress" nillable="true"
type="xsd:string" />
<xsd:element minOccurs="0" name="endDate" nillable="true"
type="xsd:date" />
<xsd:element minOccurs="0" name="startDate" nillable="true"
type="xsd:date" />
<xsd:element name="systemId" nillable="true" type="xsd:int" />
<xsd:element minOccurs="0" name="poolMapping" nillable="true"
type="dto:PoolMapping" />
<xsd:element minOccurs="0" name="ipMaskLength" nillable="true"
type="xsd:int" />
<xsd:element minOccurs="0" name="blockType" nillable="true"
type="xsd:string" />
<xsd:element name="userRole" nillable="true" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="PoolMapping">
<xsd:complexContent mixed="false">
<xsd:extension base="common:IpamDomainObject">
<xsd:sequence>
<xsd:element ref="dto:extTypeList" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="extTypeList" nillable="true" type="dto:ExtTypeList"
/>
<xsd:complexType name="ExtTypeList">
<xsd:complexContent mixed="false">
<xsd:extension base="common:IpamDomainObject">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="10" ref="dto:extType" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="extType" nillable="true" type="dto:ExtType" />
<xsd:complexType name="ExtType">
<xsd:complexContent mixed="false">
<xsd:extension base="common:IpamDomainObject">
<xsd:sequence>
<xsd:element name="type" nillable="true" type="xsd:string" />
<xsd:element name="value" nillable="true" type="xsd:string" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="IpamResponseObject">
<xsd:sequence>
<xsd:element minOccurs="0" name="asgnRefId" nillable="true"
type="xsd:int" />
<xsd:element minOccurs="0" name="hostRefName2" nillable="true"
type="xsd:string" />
<xsd:element minOccurs="0" name="hostRefName1" nillable="true"
type="xsd:string" />
<xsd:element minOccurs="0" name="orderId" nillable="true"
type="xsd:long" />
<xsd:element minOccurs="0" name="poolName" nillable="true"
type="xsd:string" />
<xsd:element minOccurs="0" name="preResRefId" nillable="true"
type="xsd:string" />
<xsd:element minOccurs="0" name="ipAddressQuantity"
nillable="true" type="xsd:int" />
<xsd:element minOccurs="0" name="resRefId" nillable="true"
type="xsd:int" />
<xsd:element minOccurs="0" name="startIpAddress" nillable="true"
type="xsd:string" />
<xsd:element minOccurs="0" name="endDate" nillable="true"
type="xsd:date" />
<xsd:element minOccurs="0" name="startDate" nillable="true"
type="xsd:date" />
<xsd:element minOccurs="0" name="ipBlockMask" nillable="true"
type="xsd:string" />
<xsd:element minOccurs="0" name="blockType" nillable="true"
type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</s:schema>
<s:schema xmlns:common="http://common.ipam.incatel.com"
xmlns:sql_java="http://sql.java" xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:impl="http://business.server.ipam.incatel.com"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:intf="http://business.server.ipam.incatel.com"
elementFormDefault="qualified"
targetNamespace="http://common.ipam.incatel.com">
<xsd:complexType name="IpamDomainObject">
<xsd:complexContent mixed="false">
<xsd:extension base="common:IpamSuper">
<xsd:sequence>
<xsd:element name="timeStamp" nillable="true"
type="xsd:anyType" />
<xsd:element name="id" nillable="true" type="xsd:int" />
<xsd:element name="changedBy" nillable="true"
type="xsd:string" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="IpamSuper">
<xsd:sequence />
</xsd:complexType>
</s:schema>
<s:schema xmlns:dto="http://dto.common.ipam.incatel.com"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:impl="http://business.server.ipam.incatel.com"
xmlns:intf="http://business.server.ipam.incatel.com"
elementFormDefault="qualified"
targetNamespace="http://business.server.ipam.incatel.com">
<xsd:element name="ipamWebService">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="req" nillable="true"
type="dto:IpamRequestObject" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="ipamWebServiceResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ipamWebServiceReturn" nillable="true"
type="dto:IpamResponseObject" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="ipamDeepPing">
<xsd:complexType>
<xsd:sequence />
</xsd:complexType>
</xsd:element>
<xsd:element name="ipamDeepPingResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ipamDeepPingReturn" nillable="true"
type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="ipamPing">
<xsd:complexType>
<xsd:sequence />
</xsd:complexType>
</xsd:element>
<xsd:element name="ipamPingResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ipamPingReturn" nillable="true"
type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</s:schema>
<s:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:lang_java="http://lang.java" xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:impl="http://business.server.ipam.incatel.com"
xmlns:intf="http://business.server.ipam.incatel.com"
elementFormDefault="qualified"
targetNamespace="http://exceptions.common.ipam.incatel.com">
<xsd:complexType name="IpamWebServiceException">
<xsd:complexContent mixed="false">
<xsd:extension base="s3:IpamException">
<xsd:sequence>
<xsd:element name="code" nillable="true" type="xsd:string" />
<xsd:element name="detail" nillable="true" type="xsd:string" />
<xsd:element name="reason" nillable="true" type="xsd:string" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="IpamException" abstract="true">
<xsd:sequence>
<xsd:element name="errNo" type="xsd:int" />
<xsd:element name="details" nillable="true" type="xsd:string" />
<xsd:element name="message" nillable="true" type="xsd:string" />
<xsd:element name="severity" type="xsd:int" />
<xsd:element name="exceptionType" type="xsd:int" />
<xsd:element maxOccurs="unbounded" name="messageParameters"
nillable="true" type="xsd:string" />
<xsd:element name="causedBy" nillable="true" type="xsd:anyType" />
</xsd:sequence>
</xsd:complexType>
<xsd:element name="IpamWebServiceException"
type="s3:IpamWebServiceException" />
</s:schema>
</wsdl:types>
<wsdl:message name="ipamDeepPingRequest">
<wsdl:part name="parameters" element="tns:ipamDeepPing" />
</wsdl:message>
<wsdl:message name="ipamWebServiceRequest">
<wsdl:part name="parameters" element="tns:ipamWebService" />
</wsdl:message>
<wsdl:message name="ipamWebServiceResponse">
<wsdl:part name="parameters" element="tns:ipamWebServiceResponse" />
</wsdl:message>
<wsdl:message name="ipamPingRequest">
<wsdl:part name="parameters" element="tns:ipamPing" />
</wsdl:message>
<wsdl:message name="ipamDeepPingResponse">
<wsdl:part name="parameters" element="tns:ipamDeepPingResponse" />
</wsdl:message>
<wsdl:message name="IpamWebServiceException">
<wsdl:part name="fault" element="s3:IpamWebServiceException" />
</wsdl:message>
<wsdl:message name="ipamPingResponse">
<wsdl:part name="parameters" element="tns:ipamPingResponse" />
</wsdl:message>
<wsdl:portType name="Ipam">
<wsdl:operation name="ipamWebService">
<wsdl:input name="ipamWebServiceRequest"
message="tns:ipamWebServiceRequest" />
<wsdl:output name="ipamWebServiceResponse"
message="tns:ipamWebServiceResponse" />
<wsdl:fault name="IpamWebServiceException"
message="tns:IpamWebServiceException" />
</wsdl:operation>
<wsdl:operation name="ipamDeepPing">
<wsdl:input name="ipamDeepPingRequest"
message="tns:ipamDeepPingRequest" />
<wsdl:output name="ipamDeepPingResponse"
message="tns:ipamDeepPingResponse" />
<wsdl:fault name="IpamWebServiceException"
message="tns:IpamWebServiceException" />
</wsdl:operation>
<wsdl:operation name="ipamPing">
<wsdl:input name="ipamPingRequest" message="tns:ipamPingRequest" />
<wsdl:output name="ipamPingResponse" message="tns:ipamPingResponse" />
<wsdl:fault name="IpamWebServiceException"
message="tns:IpamWebServiceException" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="IpamSoapBinding" type="tns:Ipam">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
<wsdl:operation name="ipamWebService">
<soap:operation soapAction="" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
<wsdl:fault name="IpamWebServiceException">
<soap:fault use="literal" name="IpamWebServiceException"
namespace="" encodingStyle="http://schemas.xmlsoap.org/soap/encoding" />
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="ipamDeepPing">
<soap:operation soapAction="" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
<wsdl:fault name="IpamWebServiceException">
<soap:fault use="literal" name="IpamWebServiceException"
namespace="" encodingStyle="http://schemas.xmlsoap.org/soap/encoding" />
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="ipamPing">
<soap:operation soapAction="" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
<wsdl:fault name="IpamWebServiceException">
<soap:fault use="literal" name="IpamWebServiceException"
namespace="" encodingStyle="http://schemas.xmlsoap.org/soap/encoding" />
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="IpamService">
<wsdl:port name="Ipam" binding="tns:IpamSoapBinding">
<soap:address location="http://adonis:9080/IPAM/services/Ipam" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
"Creating the webservice" - means instantiating the proxy to the webservice?
calling the webservice? or something else?
I get a reflecting error, where the inner exception is:
"There was an error reflecting type
'JavaWebServiceTestClient.adonis.IpamRequestObject '."
System.Exception {System.InvalidOperationException}
The IpamRequestObject is our parameter object to the webservice. It seems
that VS.NET has trouble with this. What I don't understand is that this
works
when running on localhost ??? ("adonis" is the name on the remote machine)
yes, changing the host shouldn't introduce this error.
Can we see
- the WSDL, and any imported XSD's
- the code you use in VS.NET
??