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

  • Home
  • SEARCH
  • 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 4540736
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:07:40+00:00 2026-05-21T15:07:40+00:00

Having a toy service as below @WebService(targetNamespace=http://www.example.org/stock) @SOAPBinding(style=Style.RPC,parameterStyle=ParameterStyle.WRAPPED) public class GetStockPrice { @WebMethod(operationName=GetStockPrice,action=urn:GetStockPrice) @WebResult(partName=Price)

  • 0

Having a toy service as below

@WebService(targetNamespace="http://www.example.org/stock")
@SOAPBinding(style=Style.RPC,parameterStyle=ParameterStyle.WRAPPED)
public class GetStockPrice {
    @WebMethod(operationName="GetStockPrice",action="urn:GetStockPrice")
    @WebResult(partName="Price")
    public Double getPrice(
            @WebParam(name="StockName")
            String stock
        ) {
        return null;
    }
}

JAX-WS-generated client creates a SOAP message where StockName parameter has no namespace:

<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
  <S:Body>
    <ns2:GetStockPrice xmlns:ns2="http://www.example.org/stock">
      <StockName>IBM</StockName>
    </ns2:GetStockPrice>
  </S:Body>
</S:Envelope>

I would expect and wish StockName to be generated as

  <ns2:StockName>IBM</ns2:StockName>

i.e. in the target namespace, not in the anonymous one (ns2 is not default, as far as I can see from the message).

I wonder how to make JAX-WS to add the target namespace to the nested elements of the message?

An attempt to specify the namespace to WebParam annotation changed nothing as this param is ignored when RPC is used.

Or… Does it mean that parameters in RPC-style are always anonymous?

UPDATE

Silly me. Partially solved. What I had to do is

  • style=Document, to enable target namespaces for elements
  • param style=Wrapped, to enable top level element
  • specify target namespace for WebParam (why service one is not used? documentation says service namespace should be used)

That is:

@WebService(targetNamespace="http://www.example.org/stock")
@SOAPBinding(style=Style.DOCUMENT,parameterStyle=ParameterStyle.WRAPPED)
public class GetStockPrice {
    @WebMethod(operationName="GetStockPrice",action="urn:GetStockPrice")
    @WebResult(partName="Price")
    public Double getPrice(
            @WebParam(name="StockName",targetNamespace="http://www.example.org/stock")
            String stock
        ) {
        return null;
    }
}

Still, client still expects return value without any namespace, even if I try to declare provide one. This is confusing.

  • 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-21T15:07:41+00:00Added an answer on May 21, 2026 at 3:07 pm

    This behavior is proper per the WSI-Basic Profile. If you look at:

    http://www.ws-i.org/profiles/basicprofile-1.1.html#Part_Accessors

    section 4.7.20, assertion R2735 specifically states that for RPC/Literal, the part accessor elements must be put in elements with no namspace.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a simple toy script, but I'm having issues with it. I'm trying
This is toy-example.hs: {-# LANGUAGE ImpredicativeTypes #-} import Control.Arrow data From = From (forall
I'm having a go at writing my own toy OS and for the moment
I'm having trouble with tearing and flickering in WPF animations. I have a toy
Hey - I'm having an odd problem with a little toy program I've written,
I've been attempting to get a toy intent service running for monodroid essentially going
I have a toy program: $ cat a.hs main = putStrLn Toy example $
I'm in the process of writing a toy (physics) vector library and am having
Having a bit of a problem, Due to the source-control set-up we use, each
Having volunteered to maintain a stagnant CPAN package (GnuPG) I'd like improve the install

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.