Announcement Announcement Module
Collapse
No announcement yet.
unnecessary namespace added in SOAP Request Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • unnecessary namespace added in SOAP Request

    Hi,
    I have three webservices, each webservice have 4 operations and all are deployed into one one webapplication.
    when i am access one operation of a particular webservice all the namespaces of other operations are also embedded as part of SOAP Request

    SOAP Request
    HTML Code:
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
       <SOAP-ENV:Header/>
       <SOAP-ENV:Body>
          <ns20:GetDivListRequest 
                  xmlns:ns2="http://www.xxx.com/interface/base"
    	xmlns:ns20="http://www.xxx.com/interface/getdivisionlist" 
                 xmlns:ns10="http://www.xxx.com/interface/copycat" 
    	xmlns:ns11="http://www.xxx.com/object/orderguide/cat" 
    	xmlns:ns12="http://www.xxx.com/interface/createcat" 
    	xmlns:ns13="http://www.xxx.com/interface/searchcat" 
    	xmlns:ns14="http://www.xxx.com/interface/retrievecat" 
    	xmlns:ns15="http://www.xxx.com/interface/deletemod" 
    	xmlns:ns16="http://www.xxx.com/object/orderguide/prod" 
    	xmlns:ns17="http://www.xxx.com/interface/deletecat" 
    	xmlns:ns18="urn:trace" 
    	xmlns:ns19="http://www.xxx.com/interface/listmod" 
    	xmlns:ns21="http://www.xxx.com/object/orderguide/base" 
    	xmlns:ns3="http://www.xxx.com/interface/retrievemod" 
    	xmlns:ns4="http://www.xxx.com/interface/searchmod" 
    	xmlns:ns5="http://www.xxx.com/object/orderguide/mod" 
    	xmlns:ns6="http://www.xxx.com/interface/createmod" 
    	xmlns:ns7="http://www.xxx.com/interface/copymod" 
    	xmlns:ns8="http://www.xxx.com/interface/updatemod" 
    	xmlns:ns9="http://www.xxx.com/interface/updatecat">                   
     <ns2:BaseRequest>
                <ns2:requestHeader>
                   <ns2:appId>OGM</ns2:appId>
                   <ns2:opId>OGM</ns2:opId>
                   <ns2:uId>username</ns2:uId>
                   <ns2:transactionId>1296731950743</ns2:transactionId>
                   <ns2:requestStartTime>2011-02-03T16:49:10.743+05:30</ns2:requestStartTime>
                </ns2:requestHeader>
             </ns2:BaseRequest>
          </ns20:GetDivListRequest>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    unnecessary namespaces are added in the above soap request

    Expected SOAP Request has to be like this
    HTML Code:
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
       <SOAP-ENV:Header/>
       <SOAP-ENV:Body>
          <ns20:GetDivListRequest 
            xmlns:ns2="http://www.xxx.com/interface/base"
    	    xmlns:ns20="http://www.xxx.com/interface/getdivisionlist">
            <ns2:BaseRequest>
                <ns2:requestHeader>
                   <ns2:appId>OGM</ns2:appId>
                   <ns2:opId>OGM</ns2:opId>
                   <ns2:uId>username</ns2:uId>
                   <ns2:transactionId>1296731950743</ns2:transactionId>
                   <ns2:requestStartTime>2011-02-03T16:49:10.743+05:30</ns2:requestStartTime>
                </ns2:requestHeader>
             </ns2:BaseRequest>
          </ns20:GetDivListRequest>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    i have used JAXB plugin to java classes from xsds
    Code:
    <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>jaxb2-maven-plugin</artifactId>
    <executions>
       <execution>
       <id>OGG</id>
       <goals>
           <goal>xjc</goal>
       </goals>
       <configuration>
                  <schemaDirectory>../Resources/schema</schemaDirectory>	<packageName>com.soa.contract</packageName>
                   <outputDirectory>${basedir}/src/main/java</outputDirectory>
       </configuration>
      </execution>
     </executions>
    </plugin>
    Marshalling configuration

    Code:
    <bean id="OServiceClientMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
     <property name="contextPaths">
         <list>
           <value>com.soa.contract</value>
         </list>
       </property>
    </bean>
    i am using same marshaller for all the webservices because when i am generating all java class in same package

    Please help me out to reduce the SOAP Request Size ....

    Thanks in Advance
    Mannu

  • #2
    please help me to solve this problem

    Comment


    • #3
      Could you post the XSD?

      Also, any particular reason why you are using so many different namespaces?
      Last edited by vithun; Feb 7th, 2011, 05:57 AM.

      Comment


      • #4
        Originally posted by vithun View Post
        Could you post the XSD?
        hi vithun,

        i have multiple xsds and each xsd represents one operation in a webservice.

        one of the webservice's xsd is as follows


        Code:
        <?xml version="1.0" encoding="UTF-8"?>
        <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.xxx.com/interface/orderguide/getdivisionlist" xmlns:base="http://www.xxx.com/interface/base" targetNamespace="http://www.xxx.com/interface/orderguide/getdivisionlist" elementFormDefault="qualified" attributeFormDefault="unqualified">
        	<xs:import namespace="http://www.xxx.com/interface/base" schemaLocation="../Base.xsd"/>
        	<xs:element name="GetDivisionListRequest" type="GetDivisionListRequestType">
        		<xs:annotation>
        			<xs:documentation>Comment describing your root element</xs:documentation>
        		</xs:annotation>
        	</xs:element>
        	<xs:element name="GetDivisionListResponse" type="GetDivisionListResponseType"/>
        	<xs:complexType name="GetDivisionListRequestType">
        		<xs:sequence>
        			<xs:element ref="base:BaseRequest"/>
        		</xs:sequence>
        	</xs:complexType>
        	<xs:complexType name="GetDivisionListResponseType">
        		<xs:sequence>
        			<xs:element ref="base:BaseResponse"/>
        			<xs:element name="Divisions" minOccurs="0">
        				<xs:complexType>
        					<xs:sequence>
        						<xs:element name="Division" minOccurs="0" maxOccurs="unbounded">
        							<xs:complexType>
        								<xs:sequence>
        									<xs:element name="divNumber" type="xs:int" minOccurs="0"/>
        									<xs:element name="divName" type="xs:normalizedString" minOccurs="0"/>
        									<xs:element name="divode" type="xs:normalizedString" minOccurs="0"/>
        									<xs:element name="node" type="xs:normalizedString" minOccurs="0"/>
        								</xs:sequence>
        							</xs:complexType>
        						</xs:element>
        					</xs:sequence>
        				</xs:complexType>
        			</xs:element>
        		</xs:sequence>
        	</xs:complexType>
        </xs:schema>
        Last edited by mannu4ll; Feb 7th, 2011, 08:43 AM.

        Comment


        • #5
          According to Google, in the first page of result with the query : jaxb multiple namespaces
          It's a bug of jaxb not spring :http://java.net/jira/browse/JAXB-103
          Last edited by mada; Feb 9th, 2011, 05:35 AM.

          Comment

          Working...
          X