Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to avoid prefix like "ns1:" in request tags of JAX-WS?

HarshaSKSep 23 2015 — edited Sep 29 2015

Hi,

I am using JDev 11.1.1.7.0 and weblogic 10.3.

Below are the details with XSD, Request and Response XMLs. When i test this web service, i get a namespace prefix "ns1:" attached to all request tags.

Can we avoid this? i.e. in the example below

<ns1:FormInput>

   <ns1:Input>User</ns1:Input>

</ns1:FormInput>

Instead, Cant we have it as (without ns1 prefix)

<FormInput>

    <Input>User<Input>

<FormInput>

Details:

XSD

<?xml version="1.0" encoding="UTF-8" ?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"

            targetNamespace="http://www.example.org"

            elementFormDefault="qualified">

  <xsd:element name="FormInput">

    <xsd:annotation>

      <xsd:documentation>

        A sample element

      </xsd:documentation>

    </xsd:annotation>

    <xsd:complexType>

      <xsd:sequence>

        <xsd:element name="Input" type="xsd:string"/>

      </xsd:sequence>

    </xsd:complexType>

  </xsd:element>

  <xsd:element name="FormOutput">

    <xsd:complexType>

      <xsd:sequence>

        <xsd:element name="Output" type="xsd:string"/>

      </xsd:sequence>

    </xsd:complexType>

  </xsd:element>

</xsd:schema>

Request XML

<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://www.example.org">

   <env:Header/>

   <env:Body>

      <ns1:FormInput>

         <ns1:Input>User</ns1:Input>

      </ns1:FormInput>

   </env:Body>

</env:Envelope>


Response XML

<?xml version = '1.0' encoding = 'UTF-8'?>

<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope">

   <S:Body>

      <FormOutput xmlns="http://www.example.org">

         <Output>Hi User</Output>

      </FormOutput>

   </S:Body>

</S:Envelope>

Thanks a lot in advance.

This post has been answered by 957742 on Sep 23 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 27 2015
Added on Sep 23 2015
11 comments
2,450 views