• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

axis

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the WSDL is RPC/encoded there isn't much you can do about it.
 
Amy Saari
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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" />
<wsdl:operation name="sendRapidReprice">
<wsdlsoap:operation soapAction="sendRapidReprice" style="document" />
<wsdl:input>
<wsdlsoap:body use="literal" />
</wsdl:input>
<wsdl:output>
<wsdlsoap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, is there anything in the FareTypeCode element definition that might suggest why Axis would directly specify a type in the element?
 
Amy Saari
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic