You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Peter Kelley <pe...@moveit.com.au> on 2002/10/08 08:04:54 UTC

document service questions

I'm new to web services and I'm having a few issues trying to get a
document based service deployed using AXIS. 

1. I have the wsdd:

<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/" 
            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
    <service name="acidDoc" style="message">
        <parameter name="className"
value="au.com.moveit.webservices.messaging.Importer"/>
        <parameter name="allowedMethods" value="*"/>
    </service>
</deployment>

which produces WSDL (using the ?WSDL URL) that specifies (among other
things) the following:

<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>

Now I would have thought that the binding style would have been document
so now I am confused. Can anyone explain what I have to do to get a
document binding type (as required by our customer) ? 
 
2. As I want to get a hold of the XML being sent I have a method defined
as:

public Document importXML(Document data) throws MoveitException 

Is this the best way to do this ? I saw some discussion earlier about
the other forms:

public Element [] method(Element [] bodies);
public SOAPBodyElement [] method (SOAPBodyElement [] bodies);

being better or working or something. Does anyone have any experiences
to share ?

3. How do I call one of these things to test it ? The message sample
seems to be using a call object but the javadoc for that states that it
is for RPC style services. Is there a document equivalent ? I also
looked at the jaxm sample but that uses a completely different mechanism
to call the service. Are the two methods equivalent ?


Peter Kelley


Re: document service questions

Posted by Peter Kelley <pe...@moveit.com.au>.
OK I have:
 <service name="acidDoc" provider="java:MSG" style="document">
  <parameter name="allowedMethods" value="*"/>
  <parameter name="className"
value="au.com.moveit.webservices.messaging.Importer"/>
 </service>

in my server-config.wsdd after I deploy my service and 
http://localhost:8080/axis/services/acidDoc?wsdl includes:

  <wsdl:binding name="acidDocSoapBinding" type="impl:Importer">
    <wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="importXML">
      <wsdlsoap:operation soapAction=""/>
      <wsdl:input name="importXMLRequest">
        <wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://localhost:8080/axis/services/acidDoc" use="encoded"/>
      </wsdl:input>
      <wsdl:output name="importXMLResponse">
        <wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://localhost:8080/axis/services/acidDoc" use="encoded"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>

Which looks like an rpc binding. Perhaps I'll go digging in the source
tomorrow and see if I can figure out if this is a bug.

Peter Kelley

On Tue, 2002-10-08 at 18:32, Peter Kelley wrote:
> The only server-config.wsdd I can find in the distribution is in
> /samples/jms/server-config.wsdd so I must have either missed the docs
> that tell me how to create one or there wasn't one shipped with the
> distribution I have (1.0 deployed in subdirectory xml-axis-10).
> 
> Would it be possible to post a sample file here so that I can add it to
> the webapp ?
> 
> Thanks.
> 
> Peter Kelley
> 
> On Tue, 2002-10-08 at 18:01, Murray Spork wrote:
> > Peter Kelley wrote:
> > > Hmmmm,
> > > 
> > > I still get the WSDL that includes a binding style of rpc if I try that.
> > > Can you check your generated WSDL to see if yours is the same ? Our
> > > customer definitely wants to use document so even if it works I still
> > > have a problem.
> > 
> > Have a look at your wsdd file:
> > <tomcat>/webapps/axis/WEB-INF/server-config.wsdd
> > 
> > Make sure the service element includes the style="document" and 
> > provider="java:MSG" attributes:
> > 
> >   <service name="acidDoc" provider="java:MSG" style="document">
> > 
> > if not then manually add them - I don't know why but sometimes the 
> > deployment doesn't work the way it should so you have to manually fix 
> > the wsdd file.
> > 
> > hth.
> > -- 
> > Murray Spork
> > Centre for Information Technology Innovation (CITI)
> > The Redcone Project
> > Queensland University of Technology, Brisbane, Australia
> > Phone: +61-7-3864-9488
> > Email: m.spork@qut.edu.au
> > Web: http://redcone.gbst.com/
> > 
> 
> 



Re: document service questions

Posted by Peter Kelley <pe...@moveit.com.au>.
The only server-config.wsdd I can find in the distribution is in
/samples/jms/server-config.wsdd so I must have either missed the docs
that tell me how to create one or there wasn't one shipped with the
distribution I have (1.0 deployed in subdirectory xml-axis-10).

Would it be possible to post a sample file here so that I can add it to
the webapp ?

Thanks.

Peter Kelley

On Tue, 2002-10-08 at 18:01, Murray Spork wrote:
> Peter Kelley wrote:
> > Hmmmm,
> > 
> > I still get the WSDL that includes a binding style of rpc if I try that.
> > Can you check your generated WSDL to see if yours is the same ? Our
> > customer definitely wants to use document so even if it works I still
> > have a problem.
> 
> Have a look at your wsdd file:
> <tomcat>/webapps/axis/WEB-INF/server-config.wsdd
> 
> Make sure the service element includes the style="document" and 
> provider="java:MSG" attributes:
> 
>   <service name="acidDoc" provider="java:MSG" style="document">
> 
> if not then manually add them - I don't know why but sometimes the 
> deployment doesn't work the way it should so you have to manually fix 
> the wsdd file.
> 
> hth.
> -- 
> Murray Spork
> Centre for Information Technology Innovation (CITI)
> The Redcone Project
> Queensland University of Technology, Brisbane, Australia
> Phone: +61-7-3864-9488
> Email: m.spork@qut.edu.au
> Web: http://redcone.gbst.com/
> 



Re: document service questions

Posted by Murray Spork <m....@qut.edu.au>.
Peter Kelley wrote:
> Hmmmm,
> 
> I still get the WSDL that includes a binding style of rpc if I try that.
> Can you check your generated WSDL to see if yours is the same ? Our
> customer definitely wants to use document so even if it works I still
> have a problem.

Have a look at your wsdd file:
<tomcat>/webapps/axis/WEB-INF/server-config.wsdd

Make sure the service element includes the style="document" and 
provider="java:MSG" attributes:

  <service name="acidDoc" provider="java:MSG" style="document">

if not then manually add them - I don't know why but sometimes the 
deployment doesn't work the way it should so you have to manually fix 
the wsdd file.

hth.
-- 
Murray Spork
Centre for Information Technology Innovation (CITI)
The Redcone Project
Queensland University of Technology, Brisbane, Australia
Phone: +61-7-3864-9488
Email: m.spork@qut.edu.au
Web: http://redcone.gbst.com/


Re: document service questions

Posted by Peter Kelley <pe...@moveit.com.au>.
Hmmmm,

I still get the WSDL that includes a binding style of rpc if I try that.
Can you check your generated WSDL to see if yours is the same ? Our
customer definitely wants to use document so even if it works I still
have a problem.

Complete WSDL is shown below:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
targetNamespace="http://localhost:8080/axis/services/acidDoc"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://localhost:8080/axis/services/acidDoc"
xmlns:intf="http://localhost:8080/axis/services/acidDoc"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns1="http://exception.common.moveit.com.au"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><wsdl:types/>
  <wsdl:message name="importXMLResponse">
    <wsdl:part name="importXMLReturn" type="xsd:anyType"/>
  </wsdl:message>
  <wsdl:message name="importXMLRequest">
  </wsdl:message>
  <wsdl:message name="MoveitException">
    <wsdl:part name="fault" type="xsd:anyType"/>
  </wsdl:message>
  <wsdl:portType name="Importer">
    <wsdl:operation name="importXML">
      <wsdl:input message="impl:importXMLRequest"
name="importXMLRequest"/>
      <wsdl:output message="impl:importXMLResponse"
name="importXMLResponse"/>
      <wsdl:fault message="impl:MoveitException"
name="MoveitException"/>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="acidDocSoapBinding" type="impl:Importer">
    <wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="importXML">
      <wsdlsoap:operation soapAction=""/>
      <wsdl:input name="importXMLRequest">
        <wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://localhost:8080/axis/services/acidDoc" use="encoded"/>
      </wsdl:input>
      <wsdl:output name="importXMLResponse">
        <wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://localhost:8080/axis/services/acidDoc" use="encoded"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="ImporterService">
    <wsdl:port binding="impl:acidDocSoapBinding" name="acidDoc">
      <wsdlsoap:address
location="http://localhost:8080/axis/services/acidDoc"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

On Tue, 2002-10-08 at 16:32, Murray Spork wrote:
> Peter Kelley wrote:
> > I'm new to web services and I'm having a few issues trying to get a
> > document based service deployed using AXIS. 
> > 
> > 1. I have the wsdd:
> > 
> > <?xml version="1.0" encoding="UTF-8"?>
> > <deployment xmlns="http://xml.apache.org/axis/wsdd/" 
> >             xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
> >     <service name="acidDoc" style="message">
> >         <parameter name="className"
> > value="au.com.moveit.webservices.messaging.Importer"/>
> >         <parameter name="allowedMethods" value="*"/>
> >     </service>
> > </deployment>
> 
> This is the way I've done the service element in the past:
> 
> <service name="MyService" provider="java:MSG" style="document">
> 
> [...]
> 
> 
> > 2. As I want to get a hold of the XML being sent I have a method defined
> > as:
> > 
> > public Document importXML(Document data) throws MoveitException 
> > 
> > Is this the best way to do this ? I saw some discussion earlier about
> > the other forms:
> > 
> > public Element [] method(Element [] bodies);
> > public SOAPBodyElement [] method (SOAPBodyElement [] bodies);
> > 
> > being better or working or something. Does anyone have any experiences
> > to share ?
> 
> If you figure out how to get the first signature working I'd be 
> interested to know how (i.e. see some sample source)
> I've got the 2nd one working before - see
> http://marc.theaimsgroup.com/?l=axis-user&m=102308386012021&w=2
> http://marc.theaimsgroup.com/?l=axis-user&m=102312986516078&w=2
> 
> (warning - this code worked with Axis rc2 but I haven't tested it with 1.0)
> 
> cheers,
> 
> -- 
> Murray Spork
> Centre for Information Technology Innovation (CITI)
> The Redcone Project
> Queensland University of Technology, Brisbane, Australia
> Phone: +61-7-3864-9488
> Email: m.spork@qut.edu.au
> Web: http://redcone.gbst.com/
> 

Peter Kelley


Re: document service questions

Posted by Murray Spork <m....@qut.edu.au>.
Peter Kelley wrote:
> I'm new to web services and I'm having a few issues trying to get a
> document based service deployed using AXIS. 
> 
> 1. I have the wsdd:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <deployment xmlns="http://xml.apache.org/axis/wsdd/" 
>             xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
>     <service name="acidDoc" style="message">
>         <parameter name="className"
> value="au.com.moveit.webservices.messaging.Importer"/>
>         <parameter name="allowedMethods" value="*"/>
>     </service>
> </deployment>

This is the way I've done the service element in the past:

<service name="MyService" provider="java:MSG" style="document">

[...]


> 2. As I want to get a hold of the XML being sent I have a method defined
> as:
> 
> public Document importXML(Document data) throws MoveitException 
> 
> Is this the best way to do this ? I saw some discussion earlier about
> the other forms:
> 
> public Element [] method(Element [] bodies);
> public SOAPBodyElement [] method (SOAPBodyElement [] bodies);
> 
> being better or working or something. Does anyone have any experiences
> to share ?

If you figure out how to get the first signature working I'd be 
interested to know how (i.e. see some sample source)
I've got the 2nd one working before - see
http://marc.theaimsgroup.com/?l=axis-user&m=102308386012021&w=2
http://marc.theaimsgroup.com/?l=axis-user&m=102312986516078&w=2

(warning - this code worked with Axis rc2 but I haven't tested it with 1.0)

cheers,

-- 
Murray Spork
Centre for Information Technology Innovation (CITI)
The Redcone Project
Queensland University of Technology, Brisbane, Australia
Phone: +61-7-3864-9488
Email: m.spork@qut.edu.au
Web: http://redcone.gbst.com/