File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Empty target  namespace with axis1.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Empty target  namespace with axis1.2" Watch "Empty target  namespace with axis1.2" New topic
Author

Empty target namespace with axis1.2

Suzi Cooper
Ranch Hand

Joined: Jul 23, 2005
Posts: 45
I am trying to write a web service client using axis 1.2
Here is the code:




The issue is it generates a request object with an empty namespace for the target and hence it get an invalid response. Here is the request object:



Here is the wsdl.It uses document/literal type formatting.
<?xml version="1.0" encoding="utf-8" ?>
- <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <wsdl:types>
- <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
- <s:element name="ValidateUser">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="GpassID" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="ValidateUserResponse">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="ValidateUserResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="SchemeDetails">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="SchemeToken" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="SchemeDetailsResponse">
- <s:complexType>
- <s:sequence>
- <s:element minOccurs="0" maxOccurs="1" name="SchemeDetailsResult">
- <s:complexType>
+ <s:sequence>
<s:element ref="s:schema" />
<s:any />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="SchemeList">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="SchemeToken" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="SchemeListResponse">
- <s:complexType>
- <s:sequence>
- <s:element minOccurs="0" maxOccurs="1" name="SchemeListResult">
- <s:complexType>
- <s:sequence>
<s:element ref="s:schema" />
<s:any />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
- <wsdl:message name="ValidateUserSoapIn">
<wsdl:part name="parameters" element="tns:ValidateUser" />
</wsdl:message>
- <wsdl:message name="ValidateUserSoapOut">
<wsdl:part name="parameters" element="tns:ValidateUserResponse" />
</wsdl:message>
- <wsdl:message name="SchemeDetailsSoapIn">
<wsdl:part name="parameters" element="tns:SchemeDetails" />
</wsdl:message>
- <wsdl:message name="SchemeDetailsSoapOut">
<wsdl:part name="parameters" element="tns:SchemeDetailsResponse" />
</wsdl:message>
- <wsdl:message name="SchemeListSoapIn">
<wsdl:part name="parameters" element="tns:SchemeList" />
</wsdl:message>
- <wsdl:message name="SchemeListSoapOut">
<wsdl:part name="parameters" element="tns:SchemeListResponse" />
</wsdl:message>
- <wsdl:portType name="FlexSimpleERPSoap">
- <wsdlperation name="ValidateUser">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Validates UserID passed in from eRewards Plus.</wsdl:documentation>
<wsdl:input message="tns:ValidateUserSoapIn" />
<wsdlutput message="tns:ValidateUserSoapOut" />
</wsdlperation>
- <wsdlperation name="SchemeDetails">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Current status and details of requested Flex Scheme for eRewards Plus.</wsdl:documentation>
<wsdl:input message="tns:SchemeDetailsSoapIn" />
<wsdlutput message="tns:SchemeDetailsSoapOut" />
</wsdlperation>
- <wsdlperation name="SchemeList">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">List of available Flex Schemes with status for requested user for eRewards Plus.</wsdl:documentation>
<wsdl:input message="tns:SchemeListSoapIn" />
<wsdlutput message="tns:SchemeListSoapOut" />
</wsdlperation>
</wsdl:portType>
- <wsdl:binding name="FlexSimpleERPSoap" type="tns:FlexSimpleERPSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdlperation name="ValidateUser">
<soapperation soapAction="http://tempuri.org/ValidateUser" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdlutput>
<soap:body use="literal" />
</wsdlutput>
</wsdlperation>
- <wsdlperation name="SchemeDetails">
<soapperation soapAction="http://tempuri.org/SchemeDetails" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdlutput>
<soap:body use="literal" />
</wsdlutput>
</wsdlperation>
- <wsdlperation name="SchemeList">
<soapperation soapAction="http://tempuri.org/SchemeList" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdlutput>
<soap:body use="literal" />
</wsdlutput>
</wsdlperation>
</wsdl:binding>
- <wsdl:binding name="FlexSimpleERPSoap12" type="tns:FlexSimpleERPSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdlperation name="ValidateUser">
<soap12peration soapAction="http://tempuri.org/ValidateUser" style="document" />
- <wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
- <wsdlutput>
<soap12:body use="literal" />
</wsdlutput>
</wsdlperation>
- <wsdlperation name="SchemeDetails">
<soap12peration soapAction="http://tempuri.org/SchemeDetails" style="document" />
- <wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
- <wsdlutput>
<soap12:body use="literal" />
</wsdlutput>
</wsdlperation>
- <wsdlperation name="SchemeList">
<soap12peration soapAction="http://tempuri.org/SchemeList" style="document" />
- <wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
- <wsdlutput>
<soap12:body use="literal" />
</wsdlutput>
</wsdlperation>
</wsdl:binding>
- <wsdl:service name="FlexSimpleERP">
- <wsdl:port name="FlexSimpleERPSoap" binding="tns:FlexSimpleERPSoap">
<soap:address location="http://flexsimple.garfield/ws/FlexSimpleERP.asmx" />
</wsdl:port>
- <wsdl:port name="FlexSimpleERPSoap12" binding="tns:FlexSimpleERPSoap12">
<soap12:address location="http://flexsimple.garfield/ws/FlexSimpleERP.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

Can someone give me pointers as what i am missing here??
[ December 04, 2008: Message edited by: Suzi Cooper ]
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Originally posted by Suzi Cooper:
I am trying to write a web service client using axis 1.2


If you use Axis 1.4 does it still happen? The described behavior is associated with the WS-I Basic Profile 1.0 and the RPC/literal messaging mode - but it seems to be exhibiting it here for Document/Literal - which makes me wonder if they fixed it in in Axis 1.4.

See Empty Namespace in SOAP (Axis 1.4)
Suzi Cooper
Ranch Hand

Joined: Jul 23, 2005
Posts: 45
I have tried upgrading to axis1.4 but I still get the same request object as above with empty namespace.

Anyone has any pointers on how to get around this?
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
... overlooked the code at the top of your post.

The request that Axis sent is entirely appropriate for that code.

Is there any particular reason that you aren't using WSDL2Java to generate a client stub and use that instead?
WSDL2Java: Building stubs, skeletons, and data types from WSDL
[ December 05, 2008: Message edited by: Peer Reynders ]
Suzi Cooper
Ranch Hand

Joined: Jul 23, 2005
Posts: 45
The web-service is written in .NET by a third party. I have to write the client for it. Being new to this arena of web-services, I was trying to write a very simplistic client.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42915
    
  68
You can use Axis' wsdl2java tool regardless of the implementation details (such as language) of the service involved. It's the easiest way to create a client.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Empty target namespace with axis1.2