users@jax-rpc.java.net

RE: Axis and Java WSDP WebServices

From: Anne Thomas Manes <anne_at_manes.net>
Date: Tue, 24 Aug 2004 18:56:26 -0400

Marcus,

>> So in essence you say that Axis / nuSOAP does it wrong ? And you say
>> that there aint no way to specify a different TypeMapping ? Cause
>> these are the two major questions too me.

What I'm saying is that the response generated by Axis does not match the
WSDL definition.

The WSDL says that the message should be formatted like this:

<?xml version='1.0' encoding='utf-8' ?>
<SOAP-ENV:Envelope
 xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
 xmlns:env="http://www.w3.org/2003/05/soap-envelope"
 xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/">
 <SOAP-ENV:Body>
  <ns1:getJobStateResponse
   xmlns:ns1="http://localhost/dobbin4web"
   SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >
   <getJobStateReturn xsi:type="ns2:JobState"
xmlns:ns2="http://soapinterop.org/xsd">
    <state xsi:type="xsd:int">0</state>
    <message xsi:type="xsd:string">Noch nicht Implemementiert</message>
   </getJobStateReturn>
  </ns1:getJobStateResponse>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

(the child element of ns1:getJobStateResponse should be named
<getJobStateReturn> rather than <JobState>)

I have no evidence to say that NuSOAP does it "wrong", but obviously it is
more forgiving in the way it deals with the generated element names than
JWSDP is. Axis is definitely wrong in this case because its response doesn't
match the WSDL.

You might try redeploying the Axis service. (Perhaps you configured it
wrong?) Maybe the redeployment it will generate a WSDL document that matches
its response.

If that doesn't work, I suggest you manually modify the WSDL to match the
response. Change the message description to:

    <wsdl:message name="getJobStateResponse">
        <wsdl:part name="JobState" type="s:JobState"/>
    </wsdl:message>

Wscompile will then generate the appropriate typemapping for you.

Anne

-----Original Message-----
From: Marcus Tillmanns [mailto:m.tillmanns_at_cube-tec.de]
Sent: Tuesday, August 24, 2004 2:54 AM
To: users_at_jax-rpc.dev.java.net
Subject: Re: Axis and Java WSDP WebServices

Here is the types section:

-----------------------------------
    <wsdl:types>
        <schema
            targetNamespace="http://soapinterop.org/xsd"
            xmlns="http://www.w3.org/2001/XMLSchema">
            <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
            <complexType name="FeatureArray">
                <complexContent>
                    <restriction base="SOAP-ENC:Array">
                        <attribute ref="SOAP-ENC:arrayType"
wsdl:arrayType="s:featureInfo[]"/>
                    </restriction>
                </complexContent>
            </complexType>
            <complexType name="ProcessingArray">
                <complexContent>
                    <restriction base="SOAP-ENC:Array">
                        <attribute ref="SOAP-ENC:arrayType"
wsdl:arrayType="s:processingInfo[]"/>
                    </restriction>
                </complexContent>
            </complexType>
            <complexType name="FileArray">
                <complexContent>
                    <restriction base="SOAP-ENC:Array">
                        <attribute ref="SOAP-ENC:arrayType"
wsdl:arrayType="s:fileInfo[]"/>
                    </restriction>
                </complexContent>
            </complexType>
            <complexType name="jobheader">
                <all>
                    <!-- job id == uuid as string -->
                    <element name="jobid" type="xsd:string"/>
                    <element name="priority" type="int"/>
                    <element name="user" type="xsd:string"/>
                </all>
            </complexType>
            <complexType name="featureInfo">
                <all>
                    <element name="process" type="xsd:string"/>
                    <element name="chaining" type="boolean"/>
                </all>
            </complexType>
            <complexType name="processingInfo">
                <all>
                    <element name="processString" type="xsd:string"/>
                    <element name="setting" type="xsd:string"/>
                </all>
            </complexType>
            <complexType name="fileInfo">
                <all>
                    <!-- input/output/metadata as absolute unc path, file or
folder -->
                    <element name="input" type="xsd:string"/>
                    <element name="metadata" type="xsd:string"/>
                    <element name="output" type="xsd:string"/>
                </all>
            </complexType>
            <complexType name="JobDescriptor">
                <all>
                    <element name="header" type="s:jobheader"/>
                    <element name="processing" type="s:ProcessingArray"/>
                    <element name="files" type="s:FileArray"/>
                </all>
            </complexType>
            <complexType name="FeatureDescriptor">
                <all>
                    <element name="feature" type="s:FeatureArray"/>
                </all>
            </complexType>
            <complexType name="JobState">
                <all>
                    <element name="state" type="int"/>
                    <element name="message" type="xsd:string"/>
                </all>
            </complexType>
        </schema>
    </wsdl:types>
----------------------------------------
        <soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>

----------------------------------------
(use="encoded")
----------------------------------------

So in essence you say that Axis / nuSOAP does it wrong ? And you say that
there aint no way to specify a different TypeMapping ? Cause these are the
two major questions too me.

Thx again,
Marcus



----- Original Message -----
From: "Anne Thomas Manes" <anne_at_manes.net>
To: <users_at_jax-rpc.dev.java.net>
Sent: Monday, August 23, 2004 7:04 PM
Subject: RE: Axis and Java WSDP WebServices


> Please provide the <types> section of your WSDL document. Also, please
> verify that your <soap:binding> element does say style="rpc".
>
> Now that I look at it again, the WSDL part name for the response element
> does say that the parameter element should be called getJobStateReturn.
>
> If you are using rpc/encoded, then that's the name that your element
should
> have.
>
> Anne
>
>
>
> -----Original Message-----
> From: Marcus Tillmanns [mailto:m.tillmanns_at_cube-tec.de]
> Sent: Monday, August 23, 2004 7:34 AM
> To: users_at_jax-rpc.dev.java.net
> Subject: Re: Axis and Java WSDP WebServices
>
> Good Point, Ill check that out now.
>
> But the error Message from Java sais:
> java.rmi.RemoteException: Runtime exception; nested exception is:
> unexpected element name: expected=getJobStateReturn, actual=JobState
> at
>
com.sun.xml.rpc.client.StreamingSender._handleRuntimeExceptionInSend(Streami
> ngSender.java:248)
> at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:230)
> at
>
DobbinStub.Dobbin4Web_PortType_Stub.getJobState(Dobbin4Web_PortType_Stub.jav
> a:120)
> (....)
>
> Thx,
> Marcus
>
>
> ----- Original Message -----
> From: "Anne Thomas Manes" <anne_at_manes.net>
> To: <users_at_jax-rpc.dev.java.net>
> Sent: Monday, August 23, 2004 1:27 PM
> Subject: RE: Axis and Java WSDP WebServices
>
>
> > The namespace in the response message doesn't match the WSDL definition.
> > This is probably what's causing your problem.
> >
> > The WSDL says it should be "http://localhost/axis/Dobbin4Web", but the
> > response message uses "http://localhost/Dobbin4Web".
> >
> > I'm assuming that JWSDP is giving you an error that it doesn't
understand
> > how to parse {http://localhost/Dobbin4Web}getJobStateResponse?
> >
> > The problem isn't with the wrapper element's local name
> (getJobStateResponse
> > versus getJobStateReturn -- the local name doesn't matter); it's with
the
> > namespace qualifier.
> >
> > There must be something wrong with the way you configured the service,
> > because the service response doesn't correspond to the published WSDL.
> >
> > Anne
> >
> > -----Original Message-----
> > From: Marcus Tillmanns [mailto:m.tillmanns_at_cube-tec.de]
> > Sent: Monday, August 23, 2004 4:00 AM
> > To: users_at_jax-rpc.dev.java.net
> > Subject: Re: Axis and Java WSDP WebServices
> >
> > Sure,
> >
> > Im not sure if its all copliant, But I somehow expect Axis to be a
little
> > compliant :) Anyway, here is the request (not from Java but php nuSoap,
I
> > don't think that matter greatly, cause request works always):
> >
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > <SOAP-ENV:Envelope
> > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
> > xmlns:si="http://soapinterop.org/xsd"
> > xmlns:nu="http://dobbin/axis/Dobbin4Web">
> > <SOAP-ENV:Body>
> > <nu:getJobState xmlns:nu="http://dobbin/axis/Dobbin4Web">
> > <jobid xsi:type="xsd:string">TestJob</jobid>
> > </nu:getJobState>
> > </SOAP-ENV:Body>
> > </SOAP-ENV:Envelope>
> >
> > and the response
> >
> > <?xml version='1.0' encoding='utf-8' ?>
> > <SOAP-ENV:Envelope
> > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
> > xmlns:env="http://www.w3.org/2003/05/soap-envelope"
> > xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/">
> > <SOAP-ENV:Body>
> > <ns1:getJobStateResponse
> > xmlns:ns1="http://localhost/dobbin4web"
> > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >
> > <JobState xsi:type="ns2:JobState"
> xmlns:ns2="http://soapinterop.org/xsd">
> > <state xsi:type="xsd:int">0</state>
> > <message xsi:type="xsd:string">Noch nicht Implemementiert</message>
> > </JobState>
> > </ns1:getJobStateResponse>
> > </SOAP-ENV:Body>
> > </SOAP-ENV:Envelope>
> >
> > The wsdl part looks like this:
> >
> > <wsdl:message name="getJobStateRequest">
> > <wsdl:part name="jobid" type="xsd:string"/>
> > </wsdl:message>
> >
> > <wsdl:message name="getJobStateResponse">
> > <wsdl:part name="getJobStateReturn" type="s:JobState"/>
> > </wsdl:message>
> >
> > <wsdl:operation name="getJobState" parameterOrder="jobid">
> > <wsdl:input message="tns:getJobStateRequest"
> > name="getJobStateRequest"/>
> > <wsdl:output message="tns:getJobStateResponse"
> > name="getJobStateResponse"/>
> > </wsdl:operation>
> >
> > <wsdl:operation name="getJobState">
> > <soap:operation soapAction="Dobbin4Web#getJobState"/>
> > <wsdl:input name="getJobStateRequest">
> > <soap:body
> >
> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > namespace="http://localhost/axis/Dobbin4Web"
> > use="encoded"/>
> > </wsdl:input>
> > <wsdl:output name="getJobStateResponse">
> > <soap:body
> >
> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > namespace="http://localhost/axis/Dobbin4Web"
> > use="encoded"/>
> > </wsdl:output>
> > </wsdl:operation>
> >
> > I already thought that its an Axis failure, not generating a compliant
> > response, but since php nuSoap understands the response, I thought that
at
> > least the SOAP Implementation should be able to handle this. And a guy
> from
> > Sun told me that there is a place to configure how the response shall be
> > formatted, but didn't said where this could be done.
> >
> > Thx for your time,
> > Marcus
> >
> >
> >
> >
> > ----- Original Message -----
> > From: "Doug Kohlert" <Doug.Kohlert_at_Sun.COM>
> > To: <users_at_jax-rpc.dev.java.net>
> > Sent: Friday, August 20, 2004 8:50 PM
> > Subject: Re: Axis and Java WSDP WebServices
> >
> >
> > > Marcus,
> > > Wscompile generates stubs based on what is in the WSDL file. Are you
> > > sure that the return message is formatted in compliance with
> > > the WSDL? Can you include the WSDL and the response SOAP message you
> > > are getting?
> > >
> > > Marcus Tillmanns wrote:
> > >
> > > >Hi guys,
> > > >
> > > >Im new to java and WSDP, I normaly worked with C++ and Axis. I have
> > written
> > > >a WebService using Axis C++ wich works fine with Axis Clients. But
now
> I
> > (or
> > > >the customer) wan't to call this Service via Jwsdp / j2ee. The
problem
> is
> > > >that Axis doens't encloses its response Messages as the jwsdpstubs
> think
> > (
> > > >it omits the funcNameReturn MessageName ). I was told that I can
alter
> > the
> > > >Typemapping wscompile uses, but I can't find where I should do it and
> how
> > to
> > > >tell wscompile to use this alternate typemapping. Could you point me
> > towards
> > > >the right location for this kind of stuff ?
> > > >
> > > >Thx in advance
> > > >Marcus Tillmanns
> > > >
> > > >
> > > >---------------------------------------------------------------------
> > > >To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
> > > >For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
> > > >
> > > >
> > > >
> > > >
> > >
> > > --
> > > -------------------------------
> > > Doug Kohlert
> > > Sun MicroSystems, Inc.
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
> > > For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
> > For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
> > For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
> For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
> For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net