Pergunta

Let's say I want to send an email using org.apache.axis.client.Call and the body message of the mail has a format like :

bodyMsg="Name:Justin\nSurname:Biber\nPosition:artist\nField1:1234\nField2:eqweq";

but when I receive the mail there is no the new line for each field. For example, I want to receive :

    Name:Justin
    Surname:Biber
    Position:artist
    Field1:1234
    Field2:eqweq

and I am receiving this :

Name:Justin Surname:BiberPosition:artist Field1:1234 Field2:eqweq

A snippet of my code is something like that :

    org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[0]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("");
        _call.setEncodingStyle(null);
        _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
        _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new javax.xml.namespace.QName("http://example.com/", "createEmail"));

        setRequestHeaders(_call);
        setAttachments(_call);
 try {        java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Long(arg0), arg1, arg2, bodyMsg});
 } catch(Exception ex) {}

Any suggestion?

Foi útil?

Solução

I can suggest you to try the following things.

If you are reading this email on Windows probably you should send \r\n instead of \n, i.e. system property line.separator.

If you are reading this email as HTML probably you should send the HTML newline tag <br/>.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top