On Thu, 2005-07-21 at 08:54 -0400, Anne Thomas Manes wrote: > Generate your Java service from the .NET WSDL.
Thank you for your response, Anne!
Unfortunately, this is not the thing i really want to do.
I want to write the java-ws first (as a kind of 'dummy-ws', the
'real' ws will later be implemented by another company using .net).
Then the stubs generated from the java-ws shall be used to
invoke the .net-ws, simply by changing the configured port-address.
But your tip brought me some steps further, i did exactly what you
said, so now i'm able to see which structures i need to create in java.
Then i tried to simulate the real process:
- wrote the java-ws and java-classes (not using the generated ones with
serialization info)
- ran wsdl2java against this ws
- ran java-client using the generated stubs against this java-ws
-> success
- ran java-client using the generated stubs against the .net-ws
-> failure, i get exceptions like:
org.xml.sax.SAXException: Invalid element in
org.comp.AuftragsStatusUpdate - MaxModificationDate
The generated stubs have serialization info like
elemField.setXmlName(new javax.xml.namespace.QName("http://some.ns/",
"maxModificationDate"));
When i change "maxModificationDate" to "MaxModificationDate" and
uppercase all other elements, too, then the invokation of both
java-ws and .net-ws is successful.
The uppercased elements in the .net-wsdl occur, as a property in
c# is implemented like this:
private DateTime _maxModificationDate;
public DateTime MaxModificationDate {
get {
return _maxModificationDate;
}
set {
_maxModificationDate = value;
}
}
Is there a solution for this problem?
Thanx for your help,
cheers,
Martin
>
> On 7/21/05, Martin Grotzke <[EMAIL PROTECTED]> wrote:
> > hi,
> >
> > i'm currently trying to write a webservice in java as temporary
> > replacement for a .net-webservice.
> > the ws-client (using wsdl2java-stubs) shall be run against one or the
> > other webservice, without any redeployment.
> >
> > now i have the problem, that wsdl2java produces different stubs for
> > arrays in .net and arrays in java.
> > i don't know if this is the problem of differences in both wsdls,
> > or what the real problem is.
> >
> > so i'll describe the implementation, parts of the wsdls are attached.
> >
> >
> > the java-webservice provides the following method:
> >
> > public AuftragsStatusUpdate getAuftragsStatusUpdate(
> > Calendar minModificationDate ) {
> > // dummy implementation
> > return _dummyResult;
> > }
> >
> > where the AuftragsStatusUpdate has the following properties
> > with corresponding setters and getters:
> >
> > private Calendar _maxModificationDate;
> > private AuftragsStatusUpdateLine[] _auftragsStatusUpdateLines;
> >
> >
> > the .net webservice is implemented in the same manner (in c#).
> >
> > when i run wsdl2java against the java-webservice, i get stubs with the
> > same structure. in .net, there's an additional class
> > ArrayOfAuftragsStatusUpdateLine
> > generated, that is associated by the AuftragsStatusUpdate and itself
> > associates the array of AuftragsStatusUpdateLine.
> >
> >
> > the essential parts of wsdls:
> >
> > the java-wsdl has the following types:
> >
> > <complexType name="AuftragsStatusUpdateLine">
> > <sequence>
> > <element name="auftragsNummer" nillable="true" type="xsd:long"/>
> > <element name="status" nillable="true" type="xsd:string"/>
> > </sequence>
> > </complexType>
> > <complexType name="ArrayOfAuftragsStatusUpdateLine">
> > <sequence>
> > <element maxOccurs="unbounded" minOccurs="0" name="item"
> > type="impl:AuftragsStatusUpdateLine"/>
> > </sequence>
> > </complexType>
> > <complexType name="AuftragsStatusUpdate">
> > <sequence>
> > <element name="auftragsStatusUpdateLines" nillable="true"
> > type="impl:ArrayOfAuftragsStatusUpdateLine"/>
> > <element name="maxModificationDate" nillable="true"
> > type="xsd:dateTime"/>
> > </sequence>
> > </complexType>
> >
> > the .net-wsdl:
> >
> > <s:complexType name="AuftragsStatusUpdate">
> > <s:sequence>
> > <s:element minOccurs="1" maxOccurs="1"
> > name="MaxModificationDate" type="s:dateTime" />
> > <s:element minOccurs="0" maxOccurs="1"
> > name="ArrayOfAuftragsStatusUpdateLines"
> > type="s0:ArrayOfAuftragsStatusUpdateLine" />
> > </s:sequence>
> > </s:complexType>
> > <s:complexType name="ArrayOfAuftragsStatusUpdateLine">
> > <s:sequence>
> > <s:element minOccurs="0" maxOccurs="unbounded"
> > name="AuftragsStatusUpdateLine" nillable="true"
> > type="s0:AuftragsStatusUpdateLine" />
> > </s:sequence>
> > </s:complexType>
> > <s:complexType name="AuftragsStatusUpdateLine">
> > <s:sequence>
> > <s:element minOccurs="1" maxOccurs="1" name="AuftragsNummer"
> > type="s:long" />
> > <s:element minOccurs="0" maxOccurs="1" name="Status"
> > type="s:string" />
> > </s:sequence>
> > </s:complexType>
> >
> >
> > can anybody say what the problem here is?
> > do i have to change anything in .net or in java?
> >
> > i don't if it's important, i'm using beehive (1.0m1) for writing
> > the java webservice, axis is 1.2.1.
> >
> >
> > thx in advance,
> > cheers,
> > martin
> >
> >
> >
> > --
> >
> >
> >
> > BodyID:137458952.2.n.logpart (stored separately)
> >
> >
>
--
Martin Grotzke
Hohenesch 38, 22765 Hamburg
Tel. +49 (0) 40.39905668
Mobil +49 (0) 170.9365656
E-Mail [EMAIL PROTECTED]
Online http://www.javakaffee.de
signature.asc
Description: This is a digitally signed message part
