Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3756058
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T09:47:37+00:00 2026-05-19T09:47:37+00:00

Hi I am using Spring web service Here is how my xsd looks <?xml

  • 0

Hi I am using Spring web service Here is how my xsd looks

 <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns="http://www.test-software.co.uk/abcportal/schema/abcportaltokendetailsws"
        targetNamespace="http://www.test-software.co.uk/abcportal/schema/abcportaltokendetailsws"  
        elementFormDefault="qualified" attributeFormDefault="unqualified">


        <xs:element name="abcPortalTokenDetailsRequest">
            <xs:complexType>
                <xs:annotation>
                        <xs:documentation>The data structure required to get token details</xs:documentation>
                </xs:annotation>
                <xs:sequence>
                    <xs:element name="token" type="token3rdParty"/>                 
                </xs:sequence>
            </xs:complexType>
        </xs:element>

        <xs:element name="abcPortalTokenDetailsResponse">
            <xs:complexType>
                <xs:sequence>
                    <xs:element name="tokenDetails" type="TokenDetailsType" />
                    <xs:element name="result" type="resultStructure"/>
                </xs:sequence>
            </xs:complexType>
        </xs:element>

        <xs:simpleType name="token3rdParty">
            <xs:restriction base="xs:token">
            <xs:minLength value="1"></xs:minLength>
            <xs:maxLength value="60"></xs:maxLength>
            <xs:pattern value="([A-Za-z0-9]+)" />
            </xs:restriction>
        </xs:simpleType>


        <xs:complexType name="TokenDetailsType">
            <xs:annotation>
                <xs:documentation>token details</xs:documentation>
            </xs:annotation>
            <xs:sequence>   
                <xs:element name="sNumber" type="SNumberType"/>
                <xs:element name="sId" type="SIdType"/>
                <xs:element name="sName" type="SNameType"/>                     
            </xs:sequence>
        </xs:complexType>

        <xs:simpleType name="SNumberType">
            <xs:restriction base="xs:string">
            <xs:minLength value="1"></xs:minLength>
            <xs:maxLength value="60"></xs:maxLength>
            <xs:pattern value="([A-Za-z0-9]+)" />
            </xs:restriction>
        </xs:simpleType>

        <xs:simpleType name="SIdType">
            <xs:restriction base="xs:string">
            <xs:minLength value="1"></xs:minLength>
            <xs:maxLength value="2"></xs:maxLength>
            <xs:pattern value="([A-Za-z]+)" />
            </xs:restriction>
        </xs:simpleType>    

        <xs:simpleType name="SNameType">
            <xs:restriction base="xs:string">
            <xs:minLength value="1"></xs:minLength>
            <xs:maxLength value="128"></xs:maxLength>
            <xs:pattern value="([A-Za-z0-9]+)" />
            </xs:restriction>
        </xs:simpleType>         

        <xs:complexType name="resultStructure">
            <xs:sequence>
                <xs:element name="resultCode" minOccurs="1" maxOccurs="1">
                    <xs:annotation>
                        <xs:documentation>The result code indicates the outcome of the available list for request.</xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                        <xs:restriction base="xs:string">
                            <xs:enumeration value="OK"/>
                            <xs:enumeration value="INVALID"/>
                            <xs:enumeration value="ERROR"/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:element>
                <xs:element name="resultMessage" minOccurs="1" maxOccurs="1">
                    <xs:annotation>
                        <xs:documentation>The associated message for this result</xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                        <xs:restriction base="xs:string">
                            <xs:maxLength value="255"/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>

    </xs:schema>

Here is the Endpoint

@Endpoint
public class abcPortalTokenDetailsEndpoint {

    private IabcPortalManager abcPortalManager;

    private static final Logger logger = Logger.getLogger(abcPortalTokenDetailsEndpoint.class);

        public void setAbcPortalManager(IabcPortalManager abcPortalManager) {
        this.abcPortalManager = abcPortalManager;
    }

    @PayloadRoot(localPart= "AbcPortalTokenDetailsRequest", namespace="http://www.test-software.co.uk/abcportal/schema/abcportaltokendetailsws")
    public abcPortalTokenDetailsResponse doit(abcPortalTokenDetailsRequest request){

        abcPortalTokenDetailsResponse response = new abcPortalTokenDetailsResponse();       
        // check that the token is currently valid
        String token = request.getToken().trim();       
        String resultCode = "ERROR", resultMessage = "Internal error occured - valid response could not be generated";
        boolean okResult = true, valid = false;          
        TAuth tp = null;
        Integer sId = 0;
        String sName = "";
        String errorMsg = null;

        try {
            //validate token             
            if (token != null) {                
                resultCode = "OK";
                resultMessage = "Valid session";
            } else {
                resultCode = "INVALID";
                resultMessage = "No record of user being logged in";
                okResult = false;
            }

        } catch (DataAccessException ex) {              
            String fmtStr = "Could not determine whether end user token (%s) is valid.\n %s"; 
            String errMsg = String.format(fmtStr, token, ex.getMessage());
            okResult = false;
            logger.error(errMsg);           
            assert(false) : errMsg;
        }

         if(okResult){
            if(logger.isDebugEnabled()){
                logger.debug("abcPortalTokenDetailsResponse Authenticate user" );
            }
            tp = abcPortalManager.getTpAuth(token);

            if(logger.isDebugEnabled()){
                if(tp != null){

                    if (tp.getSId()!= null){
                    sName = "ct"; abcPortalManager.getSName(tp.getSId());
                    }               
                } else {
                    logger.debug("abcPortalTokenDetailsResponse tparty details not found"); 
                }
            }
            valid = true;
        }


        TokenDetailsType tokenDetailsPart = constructResponseTokenDetailsPart(valid, okResult, tp, sName);
        response.setTokenDetails(tokenDetailsPart);

        ResultStructure resultPart = constructResponseResultPart(valid, okResult, errorMsg);
        response.setResult(resultPart);

        return response;
    }




    private TokenDetailsType constructResponseTokenDetailsPart(
            boolean valid, boolean okResult, TAuth tp,String sName) {

        TokenDetailsType tdt = null;


        if (valid && okResult) {

            tdt = new TokenDetailsType();       
            tdt.setSId(tp.getSId());
            tdt.setSNumber(tp.getSNumber);
            tdt.setSName(sName);                    

        }

        return tdt;

    }

    /**
     *
     * @param response
     * @param okResult
     * void
     *
     */
    private ResultStructure constructResponseResultPart(
            boolean valid, boolean okResult, String errorMessage) {

        // Determine result part of response
        String resultCode, resultMessage;
        if (okResult) {
            resultCode = (valid) ? "OK" : "INVALID";
            resultMessage = (valid) ? "Successfull query" : "User not authorised";          
        } else {
            resultCode = "ERROR";
            resultMessage = "Valid response could not be generated: " + errorMessage;
        }
        ResultStructure resp_result = new ResultStructure();
        resp_result.setResultCode(resultCode);
        resp_result.setResultMessage(resultMessage);

        return resp_result;     

    }



}

when i try to test the webservice using SoapUI why response has multiple namespace of different webservices within my project??? i am expecting just abcportaltokendetailsws and not other services like abcportalloginstatusws ,abcportallogoutws not sure why this is displayed?

  <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <ns10:abcPortalTokenDetailsResponse 
xmlns:ns10="http://www.test-software.co.uk/abcportal/schema/abcportaltokendetailsws"
xmlns:ns2="http://www.test-software.co.uk/abcportal/schema/abcportalloginstatusws" xmlns:ns4="http://www.test-software.co.uk/abcportal/schema/abcportallpaymentws" xmlns:ns5="http://www.test-software.co.uk/abcportal/schema/abcportallogoutws" xmlns:ns6="http://www.test-software.co.uk/abcportal/schema/abcportalfundservicews" xmlns:ns7="http://www.test-software.co.uk/abcportal/schema/abcportalpayservicews"  
         <ns10:tokenDetails>
            <ns10:sNumber>43454</ns10:sNumber>
            <ns10:sId/>
            <ns10:sName>Bridge Market</ns10:sName>
         </ns10:tokenDetails>
         <ns10:result>
            <ns10:resultCode>OK</ns10:resultCode>
            <ns10:resultMessage>Successfull query</ns10:resultMessage>
         </ns10:result>
      </ns10:abcPortalTokenDetailsResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T09:47:37+00:00Added an answer on May 19, 2026 at 9:47 am

    This is possible to avoid using Spring 2.5 along with spring-ws 1.5.9 abcPortalTokenDetailsEndpoint can extend MarshallingMethodEndpointAdapter. Also in the config file if we have different beanid marshallers for each end points it works fine. I also tried the same thing in Spring 3.0 and spring-ws 1.5.9 officially not supported , it does not work with multiple beanid marshaller, it needs the word marshaller in the bean id ???
    example
    the whole problem is using contextpath with “:” or “list” (this adds all the namesapce in the response)

    <oxm:jaxb2-marshaller id="marshaller" contextPath="com.abc.web.ws.login.status.schema:com.abc.web.ws.profile.schema:com.abc.web.ws.tokendetails.schema>
    

    if we change the above code to as following it works in Spring 2.5.6 not spring 3.0 why???

    <bean id="abcPortalTokenDetailsEndpoint" class="com.abc.web.ws.tokendetails.abcPortalTokenDetailsEndpoint">
    
            <property name="marshaller" ref="marshaller1"/>
            <property name="unmarshaller" ref="marshaller1"/>
        </bean>
    
     <bean id="abcPortalTrustedAccessLogInEndpoint" class="com.abc.web.ws.login.trustedaccess.abcPortalTrustedAccessLogInEndpoint">      
    
            <property name="marshaller" ref="marshaller2"/>
            <property name="unmarshaller" ref="marshaller2"/>
     </bean>
    
    <bean id="abcPortalThirdPartyLogInEndpoint" class="com.abc.web.ws.login.thirdparty.abcPortalThirdPartyLogInEndpoint">
    
            <property name="marshaller" ref="marshaller"/>
            <property name="unmarshaller" ref="marshaller"/>
        </bean>
    
        <bean id="marshaller1" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
              <property name="contextPath" value="com.abc.web.ws.tokendetails.schema"/>                     
            </bean>
    
             <bean id="marshaller2" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
              <property name="contextPath" value="com.abc.web.ws.login.trustedaccess.schema"/>                      
            </bean>
    
            <bean id="marshaller3" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">        
                <property name="contextPath" value="com.abc.web.ws.login.thirdparty.schema"/>       
            </bean>
    
    
    
    
    
    
    
    
    
    public class abcPortalTokenDetailsEndpoint extends MarshallingMethodEndpointAdapter{
    
        private IabcPortalManager abcPortalManager;
    
        private static final Logger logger = Logger.getLogger(abcPortalTokenDetailsEndpoint.class);
    
            public void setAbcPortalManager(IabcPortalManager abcPortalManager) {
            this.abcPortalManager = abcPortalManager;
        }
    
    
    
    
       public abcPortalTokenDetailsResponse handleabcPortalTokenDetailsRequest(abcPortalTokenDetailsRequest request){
    
    
    
     abcPortalTokenDetailsResponse response = new abcPortalTokenDetailsResponse();       
            // check that the token is currently valid
            String token = request.getToken().trim();       
            String resultCode = "ERROR", resultMessage = "Internal error occured - valid response could not be generated";
            boolean okResult = true, valid = false;          
            TAuth tp = null;
            Integer sId = 0;
            String sName = "";
            String errorMsg = null;
    
            try {
                //validate token             
                if (token != null) {                
                    resultCode = "OK";
                    resultMessage = "Valid session";
                } else {
                    resultCode = "INVALID";
                    resultMessage = "No record of user being logged in";
                    okResult = false;
                }
    
            } catch (DataAccessException ex) {              
                String fmtStr = "Could not determine whether end user token (%s) is valid.\n %s"; 
                String errMsg = String.format(fmtStr, token, ex.getMessage());
                okResult = false;
                logger.error(errMsg);           
                assert(false) : errMsg;
            }
    
             if(okResult){
                if(logger.isDebugEnabled()){
                    logger.debug("abcPortalTokenDetailsResponse Authenticate user" );
                }
                tp = abcPortalManager.getTpAuth(token);
    
                if(logger.isDebugEnabled()){
                    if(tp != null){
    
                        if (tp.getSId()!= null){
                        sName = "ct"; abcPortalManager.getSName(tp.getSId());
                        }               
                    } else {
                        logger.debug("abcPortalTokenDetailsResponse tparty details not found"); 
                    }
                }
                valid = true;
            }
    
    
            TokenDetailsType tokenDetailsPart = constructResponseTokenDetailsPart(valid, okResult, tp, sName);
            response.setTokenDetails(tokenDetailsPart);
    
            ResultStructure resultPart = constructResponseResultPart(valid, okResult, errorMsg);
            response.setResult(resultPart);
    
            return response;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was trying to hit a web service using the instructions here: http://help.seeclickfix.com/kb/api/creating-an-issue I
I created a web service using Apache cfx and spring, it works, but I
I am developing a soap web service client with spring. I am using webServiceTemplate
I want to generate raw xml from a REST service using Spring. Something is
I have a JAX-RPC web service that I am attempting to consume using Spring.
I'm using a web service where the WSDL describes a single string element in
I am using spring web mvc for my app's UI part.. By using following
I'm using Spring Web Flow (v. 1.0.5) and I have a JSP page that
I have this web application using Spring Web Flow framework. In my main page
I am using Spring 3.1 and want to include Spring Web Flow 2.3. One

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.