axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alastair FETTES" <afet...@mdacorporation.com>
Subject RE: How best to transform a XML file into a message.
Date Thu, 02 Apr 2009 17:08:03 GMT
Mike.

> Thanks, I'll look at that but couldn't I just use subversion for that?
> If I find a new wsdl file, I can just copy if over a local svn check 
> out, commit the new one, and then go back and play around if needed.

That's true you can do that.  I would only suggest going that route if
you only move forward and will never need to support a previous version.
For our project we get a new version of the WSDL file every few months.
Thus we use the Archiva method for management of these artifacts as not
all client operations of our service update to the latest immediately so
we end up supporting multiple versions of a single WSDL.  This in itself
is it's own task especially when dealing with generated code and
namespaces...

> I hate to ask but does the XML file actually relate to your WSDL or 
> is it unrelated DATA, intended for a local XML parser to examine?
> You may be just asking a question like, " how do I send a JPEG or 
> PDF file in a SOAP response?" 

I prefer to think of web services as a combination of
operations/signatures and payloads.  The XML is the payload and is
defined by the XML Schema which is generally referenced from or embedded
in the WSDL.  The operation signature is defined by the WSDL with
wsdl:operation and wsdl:message.

Example:

    <!-- Message payload -->
    <wsdl:types>
        <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msg="http://www.mycompany.com">
            <xs:element name="MyOperationRequestElement"
type="xs:string"/>
            <xs:element name="MyOperationResponseElement"
type="xs:string"/>
        </xs:schema>
    </wsdl:types>

    <!-- binding the operation input/output to the payload -->
    <wsdl:message name="MyOperationRequest">
        <wsdl:part name="body" element="msg:MyOperationRequestElement"/>
    </wsdl:message>
    <wsdl:message name="MyOperationResponse">
        <wsdl:part name="body"
element="msg:MyOperationResponseElement"/>
    </wsdl:message>

    <!-- defining the operations -->
    <wsdl:portType name="MyPortType">
        <wsdl:operation name="MyOperation">
            <wsdl:input message="tns:MyOperationRequest"/>
            <wsdl:output message="tns:MyOperationResponse"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="MyPortBinding" type="tns:MyPortType">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
        <wsdl:operation name="MyOperation">
            <soap:operation soapAction="MyOperation"/>
            <wsdl:input>
                <soap:body parts="body" use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body parts="body" use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>

It's fine to have the WSDL but you need a schema definition to go along
with it.  It ends up looking something like this:

Request message:
<soap:envelope>
    <soap:body>
 
<msg:MyOperationRequestElement>foo</msg:MyOperationRequestElement>
    </soap:body>
</soap:envelope>

Response message:
<soap:envelope>
    <soap:body>
 
<msg:MyOperationResponseElement>foo</msg:MyOperationResponseElement>
    </soap:body>
</soap:envelope>

There's a quick and dirty intro to WSDL.  This is why I was asking if
the XML Schema was changing or just the operation signatures...  

Disclaimer: I did this off the top of my head!

Alastair

This e-mail and any attachments are intended solely for the use of the
intended recipient(s) and may contain legally privileged, proprietary
and/or confidential information.  Any use, disclosure, dissemination,
distribution or copying of this e-mail and any attachments for any
purposes that have not been specifically authorized by the sender is
strictly prohibited.  If you are not the intended recipient, please
immediately notify the sender by reply e-mail and permanently delete all
copies and attachments.

The entire content of this e-mail is for "information purposes" only and
should not be relied upon by the recipient in any way unless otherwise
confirmed in writing by way of letter or facsimile. 

-----Original Message-----
From: Mike Marchywka [mailto:marchywka@hotmail.com] 
Sent: Thursday, April 02, 2009 9:40 AM
To: axis-c-user@ws.apache.org
Subject: RE: How best to transform a XML file into a message.



----------------------------------------
> Subject: RE: How best to transform a XML file into a message.
> Date: Thu, 2 Apr 2009 09:32:47 -0700
> From: spam haven CT
> To: axis-c-user@ws.apache.org
>
> Hi Mike.
>
> The Java route for different versions of the WSDL is a very good 
> solution. Especially if you couple this with Maven2 and the use of an 
> artifact repository such as Archiva (http://archiva.apache.org/). 
> Then, you can construct an individual, versioned JAR file for each 
> version of the WSDL. In your Java code the run the application you can

> then simply configure it to use the appropriate version as necessary. 
> This would remove the need to "update your classpath" - you'd simply 
> let Maven2 manage the dependencies.
>

Thanks, I'll look at that but couldn't I just use subversion for that?
If I find a new wsdl file, I can just copy if over a local svn check
out, commit the new one, and then go back and play around if needed.



> Another follow on question to your previous email: Are they changing 
> the WSDL or the Schema of the web services?
>

I hate to ask but does the XML file actually relate to your WSDL or is
it unrelated DATA, intended for a local XML parser to examine?
You may be just asking a question like, " how do I send a JPEG or PDF
file in a SOAP response?" 


> Alastair


_________________________________________________________________
Windows Live(tm): Keep your life in sync.
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_allup_1a_explore_042009

Mime
View raw message