good day!..

i have this soap message that will be sent to a simple service provider simulator..
since this is only a simulation, i there will be only one service named leave (e.g. vacation leave, sick leave, etc.)

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://leaveprocessor.blueprints.jbi.sun.com/">
<soapenv:Body>
<ns1:processApplication>
<appName>applicant</appName>
<leaveType>type of leave</leaveType>
<numDays>number of days</numDays>
</ns1:processApplication>
</soapenv:Body>
</soapenv:Envelope>

im using tcp for communication between my client and service provider..
basically, i have this code line that would stream my message to the service provider..

output.println(message);

where output there is declared as:

output = new PrintStream(clientSocket.getOutputStream());

i have successfully streamed my message to the service provider when i assigned it a string value like the word "dog"
but what i want to happen is that the message will have the value of the soap message stated above..

how can i do that?
any help in solving this problem will be greatly appreciated..

thanx!..

God bless!..

same thing, it's after all just another string.

ive done this but there are too many errors:

import java.io.*;
import java.net.*;

public class createrequest
{
    public String creator()
    {
        String message="<?xml version="1.0" encoding="UTF-8"?>
                        <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://leaveprocessor.blueprints.jbi.sun.com/">
                        <soapenv:Body>
                        <ns1:processApplication>
                        <appName>name</appName>
                        <leaveType>Vacation</leaveType>
                        <numDays>4</numDays>
                        </ns1:processApplication>
                        </soapenv:Body>
                        </soapenv:Envelope>";

        return message;
    }
}

most of the errors occur on the symbols of the soap message such as ":", "<", etc.

you can't break a string over multiple lines.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.