1

I'm new to SOAP service, this is my output and java class detail.

How to add the blank xmlns in sub level class?

Out-Put Request:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<sendEmail xmlns="http://ws.cns.channel.sendnotification.sdfsfds.com/">
    <EmailNotificationRequest>
        <requestHeader>
            <channel>fsdfs</channel>
            <subChannel>sdfds</subChannel>
            <systemName>sdfsd</systemName>
            <applicationName>dsfs</applicationName>
        </requestHeader>
    </EmailNotificationRequest>
</sendEmail>

Package Class

    @javax.xml.bind.annotation.XmlSchema(namespace = "http://ws.cns.channel.sendnotification.sdfsfds.com/",
        elementFormDefault = XmlNsForm.QUALIFIED
    )
    package com.etisalat.sendnotification.channel.cns.ws;

    import javax.xml.bind.annotation.XmlNsForm;

Request Header Class

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "requestHeader", propOrder = {
    "channel",
    "subChannel",
    "agentID",
    "systemName",
    "applicationName",
    "hostID",
    "requestDate"
})

public class RequestHeader {
    @XmlElement(required = true)
    protected String channel;
    protected String subChannel;
    protected String agentID;
    @XmlElement(required = true)
    protected String systemName;
    protected String applicationName;
}

Required Input Request

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<sendEmail xmlns="http://ws.cns.channel.sendnotification.sdfsfds.com/">
    <EmailNotificationRequest>
        <requestHeader xmlns="">
            <channel>fsdfs</channel>
            <subChannel>sdfds</subChannel>
            <systemName>sdfsd</systemName>
            <applicationName>dsfs</applicationName>
        </requestHeader>
    </EmailNotificationRequest>
</sendEmail>
HoRn
  • 1,458
  • 5
  • 20
  • 25
Nabeel Ahmed
  • 258
  • 1
  • 7
  • 23

0 Answers0