axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "SECRIST,MARK S (HP-FtCollins,ex1)" <mark.secr...@hp.com>
Subject FW: Odd behavior using SignedSOAPEnvelope (empty namespaces inser ted)
Date Thu, 22 May 2003 21:51:59 GMT
I sent this to axis-user, and axis-dev, but wasn't subscribed to axis-dev.
Before I submit this as a bug, I wanted to double check that this wasn't a
manifestation of 19001 as well as 10566, which I referenced below.

It should be noted that while I first stumbled on this through the above
mentioned SignedSOAPEnvelope class, I don't believe it has anything to do
with this directly.

Mark

-----Original Message-----
From: SECRIST,MARK S (HP-FtCollins,ex1) 
Sent: Thursday, May 22, 2003 1:56 PM
To: 'axis-user@ws.apache.org'; 'axis-dev@ws.apache.org'
Subject: RE: Odd behavior using SignedSOAPEnvelope (empty namespaces
inserted)


I ran into an issue that is documented in an earlier query sent to
axis-user.  Since then, I've been able to isolate the problem (or address
the symptom) with the ns="" problem.  I have just verified that it still
exists with the most recent 5/22 nightly build.  It seems to have to do with
the way I declare my schema.  If I follow the WS-I basic profile
recommendation, I declare my schema as follows:

  <xs:schema targetNamespace="uri:supplier.daredevil.atc.hp.com" 
             xmlns:xs="http://www.w3.org/2001/XMLSchema" 
             xmlns:sup="uri:supplier.daredevil.atc.hp.com" 
             elementFormDefault="qualified"
attributeFormDefault="unqualified">

The expected behavior is that the root element of my message will reference
the namespace as:
    <QuoteRequest xmlns="uri:supplier.daredevil.atc.hp.com">

and the child elements will inherit that namespace without explicitly
referencing it.  However, Axis seems to loose that part of the WSDL
definition when being deployed to the server.  As a result, the dynamic WSDL
document returned is missing the elementFormDefault and attributeFormDefault
attributes in the schema tag.  This can be compensated for by explicitly
adding form="unqualified" to the child elements of the root of the request
and response elements in the original WSDL file used to generate the server
deployment.  However, this seems like a bit of a hack, but it does make
things work.

I have the full WSDL file if someone is interested in having a look at it,
but it appears that Axis is still broken in this regard.  I can't say when,
but I believe this did work as expected once upon a time around the 1.1.
beta timeframe.

What I found is that the problem seems to manifest itself in the helper
classes that are generated.  The server side helper class for QuoteRequest
has the following static declaration for itself and its child elements:

    static {
        typeDesc.setXmlType(new
javax.xml.namespace.QName("uri:supplier.daredevil.atc.hp.com",
"QuoteRequestType"));
        org.apache.axis.description.ElementDesc elemField = new
org.apache.axis.description.ElementDesc();
        elemField.setFieldName("documentInfo");
        elemField.setXmlName(new
javax.xml.namespace.QName("uri:supplier.daredevil.atc.hp.com",
"DocumentInfo"));
        elemField.setXmlType(new
javax.xml.namespace.QName("uri:supplier.daredevil.atc.hp.com",
"DocumentInfoType"));
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("customerDetails");
        elemField.setXmlName(new
javax.xml.namespace.QName("uri:supplier.daredevil.atc.hp.com",
"CustomerDetails"));
        elemField.setXmlType(new
javax.xml.namespace.QName("uri:supplier.daredevil.atc.hp.com",
"OwnerDetails"));
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("partList");
        elemField.setXmlName(new
javax.xml.namespace.QName("uri:supplier.daredevil.atc.hp.com", "PartList"));
        elemField.setXmlType(new
javax.xml.namespace.QName("uri:supplier.daredevil.atc.hp.com",
"PartListType"));
        typeDesc.addFieldDesc(elemField);
    }

while the client helper class generated from the deployed service has the
following static declaration:

    static {
        typeDesc.setXmlType(new
javax.xml.namespace.QName("uri:supplier.daredevil.atc.hp.com",
"QuoteRequestType"));
        org.apache.axis.description.ElementDesc elemField = new
org.apache.axis.description.ElementDesc();
        elemField.setFieldName("documentInfo");
        elemField.setXmlName(new javax.xml.namespace.QName("",
"DocumentInfo"));
        elemField.setXmlType(new
javax.xml.namespace.QName("uri:supplier.daredevil.atc.hp.com",
"DocumentInfoType"));
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("customerDetails");
        elemField.setXmlName(new javax.xml.namespace.QName("",
"CustomerDetails"));
        elemField.setXmlType(new
javax.xml.namespace.QName("uri:supplier.daredevil.atc.hp.com",
"OwnerDetails"));
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("partList");
        elemField.setXmlName(new javax.xml.namespace.QName("", "PartList"));
        elemField.setXmlType(new
javax.xml.namespace.QName("uri:supplier.daredevil.atc.hp.com",
"PartListType"));
        typeDesc.addFieldDesc(elemField);
    }

I've found through experimentation that if I add the
"uri:supplier.daredevil.atc.hp.com" value to the client side static
declaration, that it works as expected.  So, somewhere along this
development, deployment route, something is breaking down.  This may be
related to bug 10566, which claims to have been fixed.

It isn't clear how these issues get submitted to the developer team.  I'm
going to try to send this also to the axis-dev mailing list in hopes that it
shows up there.

Any thoughts or similar experiences from folks out there?

Thanks,

Mark

____________________________________________
Mark Secrist, Senior Software Consultant
HP Developer Resources Organization (DRO) 
AppDev Advanced Technology Center
mark.secrist@hp.com  Tel: (970) 898-7490  


-----Original Message-----
From: SECRIST,MARK S (HP-FtCollins,ex1) [mailto:mark.secrist@hp.com]
Sent: Tuesday, May 20, 2003 5:12 PM
To: 'axis-user@ws.apache.org'
Subject: Odd behavior using SignedSOAPEnvelope (empty namespaces
inserted)


I seem to have a problem with the getSOAPEnvelopeAsDocument method of the
SignedSOAPEnvelop sample class associated with the Axis samples.  I've built
a document style web service in which I want to simply sign the body and
send it on.  Using the ClientSigningHandler and the SignedSOAPEnvelope
classes were very helpful.  I notices after moving to versions of Axis 1.1
that this now breaks my document being sent.  I start with a simple document
as follows:
 
 <soapenv:Body>
  <QuoteRequest xmlns="uri:supplier.daredevil.atc.hp.com">
   <DocumentInfo Date="05/19/2003"/>
   <CustomerDetails ContactEmail="buyer@hp.com" Name="Hewlett-Packard"
Id="12345-56789"/>
   <PartList>
    <PartItem QuotedPrice="0.0" SupplierPartSKU="SKU-1" PartDescription="1.7
Ghz CPU Box, 80GB HD" Quantity="5"/>
    <PartItem QuotedPrice="0.0" SupplierPartSKU="SKU-2" PartDescription="17
inch Monitor" Quantity="5"/>
    <PartItem QuotedPrice="0.0" SupplierPartSKU="SKU-3"
PartDescription="Really Fancy Printer" Quantity="5"/>
   </PartList>
  </QuoteRequest>
 </soapenv:Body>

When passed through the getSOAPEnvelopeAsDocument method, I get empty
namespaces in many of my subordinate elements as follows:

 <soapenv:Body>
  <QuoteRequest xsi:type="ns1:QuoteRequestType"
xmlns="uri:supplier.daredevil.atc.hp.com"
xmlns:ns1="uri:supplier.daredevil.atc.hp.com">
   <DocumentInfo Date="05/19/2003" xsi:type="ns1:DocumentInfoType"
xmlns=""/>
   <CustomerDetails ContactEmail="buyer@hp.com" Id="12345-56789"
Name="Hewlett-Packard" xsi:type="ns1:OwnerDetails" xmlns=""/>
   <PartList xsi:type="ns1:PartListType" xmlns="">
    <PartItem PartDescription="1.7 Ghz CPU Box, 80GB HD" Quantity="5"
QuotedPrice="0.0" SupplierPartSKU="SKU-1" xsi:type="ns1:PartItemType"/>
    <PartItem PartDescription="17 inch Monitor" Quantity="5"
QuotedPrice="0.0" SupplierPartSKU="SKU-2" xsi:type="ns1:PartItemType"/>
    <PartItem PartDescription="Really Fancy Printer" Quantity="5"
QuotedPrice="0.0" SupplierPartSKU="SKU-3" xsi:type="ns1:PartItemType"/>
   </PartList>
  </QuoteRequest>
 </soapenv:Body>

Does anyone have ideas as to what causes this and what I can do to eliminate
the problem?

I've also noticed that when I generate the server deployment from a static
WSDL and then try to generate a client from the deployed dynamic WSDL file
that I have the same problem.  Is this in fact an Axis problem or am I not
being specific enough in the WSDL schema definition?

Thanks,

Mark
____________________________________________
Mark Secrist, Senior Software Consultant
HP Developer Resources Organization (DRO) 
AppDev Advanced Technology Center
mark.secrist@hp.com  Tel: (970) 898-7490  

Mime
View raw message