aspose file tools*
The moose likes Web Services and the fly likes axis Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "axis " Watch "axis " New topic
Author

axis

Amy Saari
Greenhorn

Joined: Sep 13, 2007
Posts: 29
Hi All

I'm using Axis 1.4 to generate the client from the wsdl. The soap message contains

<FareTypeCode xsi:type="xsd:string">SR</FareTypeCode>

I don't want the xsi:type="xsd:string" sent to the web service. The org.apache.axis.encoding.SerializationContextImpl has a flag:

shouldSendXSIType()
Get whether or not to write xsi:type attributes.

which is true by default ---- I can't figure out to set this value to false. My service locator extends org.apache.axis.client.Service --- can anyone tell me how/where to set the send xsi type starting from the service object?

Thanks for any help.

Amy
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
If the WSDL is RPC/encoded there isn't much you can do about it.


"Don't succumb to the false authority of a tool or model. There is no substitute for thinking."
Andy Hunt, Pragmatic Thinking & Learning: Refactor Your Wetware p.41
Amy Saari
Greenhorn

Joined: Sep 13, 2007
Posts: 29
Hi Peer

It looks like it's document/literal (disclaimer - this is the first time I've worked with Axis or web services).

What then?
Thanks,
Amy

<wsdl:binding name="RapidRepriceSOAPBinding" type="intf:RapidRepricePortType">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<wsdlperation name="sendRapidReprice">
<wsdlsoapperation soapAction="sendRapidReprice" style="document" />
<wsdl:input>
<wsdlsoap:body use="literal" />
</wsdl:input>
<wsdlutput>
<wsdlsoap:body use="literal" />
</wsdlutput>
</wsdlperation>
</wsdl:binding>
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
Well, is there anything in the FareTypeCode element definition that might suggest why Axis would directly specify a type in the element?
Amy Saari
Greenhorn

Joined: Sep 13, 2007
Posts: 29
Not that I can see. FareTypeCode is unbounded - so I assume that's why I get

String[] for it.

<xs:complexType>
<xs:sequence>
<xs:element ref="Options" minOccurs="0" />
<xs:element ref="FareTypeCode" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="SecurateInd" minOccurs="0" />
<xs:element ref="TicketRecordInd" minOccurs="0" />
<xs:element ref="TicketNumber" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="AccountCodeInd" minOccurs="0" />
<xs:element ref="AgreementNumber" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="AccountCode" minOccurs="0" maxOccurs="5" />
<xs:element ref="TicketDesignator" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="CustomDiscountInfo" minOccurs="0" />
<xs:element ref="WithholdTaxCode" minOccurs="0" maxOccurs="20" />
<xs:element ref="OverrideCurrency" minOccurs="0" />
</xs:sequence>
</xs:complexType>
--snip--
<xs:element name="FareTypeCode">
<xs:annotation>
<xs:documentation>Fare Type Code (e.g. FSR) or Fare Restriction Code (e.g. FNA). Only supply the last 2 characters of the fare type code in the message as the F is implied. (Optional for Host or non host processing)</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="2" />
</xs:restriction>
</xs:simpleType>
</xs:element>

Interesting that CityCode doesn't have maxOccurs="unbounded"
and so it's a String not a String[]

<xs:element ref="CityCode" minOccurs="0" />

<xs:element name="CityCode">
<xs:annotation>
<xs:documentation>Originator City Code</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="3" />
</xs:restriction>
</xs:simpleType>
</xs:element>

The soap is

<FareTypeCode xsi:type="xsd:string">SR</FareTypeCode>
and
<CityCode>MSP</CityCode>

respectively. The service rejects the xsi:type with the error msg

<faultstring>Dispatcher:RapidRepriceRequest: Error on line 3: UndeclaredPrefix: Cannot resolve 'xsd:string' as a QName: the prefix 'xsd' is not declared.</faultstring>

I'm stuck - unless there's something different in the binding between the service and the wsdl the gave me to generate the client from.

Amy
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
Axis might be stumbling on this



try modifying it to



Make a copy of the WSDL and any referenced schemas. Make the modifications (including the altered schema locations). And then generate the stubs from that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: axis
 
Similar Threads
AXIS 1.4 Response XML Help-Urgent
Encoding and .net/Axis Interoperability
Conversion of Raw Soap Response Into HTML
problem with String [] in axis 1.3 and .net client
how to xsi:type attribute for elements in soap message