You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Sigirisetty Surya Kiran (JIRA)" <ji...@apache.org> on 2007/05/25 03:12:16 UTC

[jira] Updated: (AXIS2-2355) Axis2 SOAP API Impl Issue

     [ https://issues.apache.org/jira/browse/AXIS2-2355?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sigirisetty Surya Kiran updated AXIS2-2355:
-------------------------------------------

    Attachment: disclaim.txt

Thanks Sumedha!



> Axis2 SOAP API Impl Issue
> -------------------------
>
>                 Key: AXIS2-2355
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2355
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.1.1
>         Environment: Axis2-1.1.1, tomcat-5.5.20
>            Reporter: Sigirisetty Surya Kiran
>         Assigned To: sumedha rubasinghe
>         Attachments: disclaim.txt
>
>
> I wrote a client code for accessing a simple web service. But SOAP request generated by axis2-saaj-1.1.1.jar seems to be having problem.
> I'm not able to add a text node to the ws operation element. 
> package com.ssk.ws.custom.wsdl.types;
> import java.net.URL;
> import javax.xml.soap.MessageFactory;
> import javax.xml.soap.Name;
> import javax.xml.soap.SOAPBody;
> import javax.xml.soap.SOAPConnection;
> import javax.xml.soap.SOAPConnectionFactory;
> import javax.xml.soap.SOAPElement;
> import javax.xml.soap.SOAPFactory;
> import javax.xml.soap.SOAPMessage;
> public class HRServiceClient {
>         public static void main(String[] args) throws Exception {
>                 SOAPConnectionFactory scf = SOAPConnectionFactory.newInstance();
>                 SOAPConnection sConn = scf.createConnection();
>                 MessageFactory mf = MessageFactory.newInstance();
>                 SOAPMessage msg = mf.createMessage();
>                 SOAPBody body = msg.getSOAPBody();
>                 SOAPFactory soapFactory = SOAPFactory.newInstance();
>                 Name bn = soapFactory.createName("getEmployee",
>                 "ns1", "http://types.wsdl.custom.ws.ssk.com/xsd");
>                 SOAPElement op = soapFactory.createElement(bn);
>                 body.addChildElement(op);
>                 Name pn = soapFactory.createName("p1",
>                                 "ns1", "http://types.wsdl.custom.ws.ssk.com/xsd");
>                 SOAPElement p1 = soapFactory.createElement(pn);
>                 //1.doesnt work
>                 //p1.addTextNode("1");
>                 //2.doesnt work
>                 //SOAPElement val = p1.addTextNode("1");
>                 //p1.addChildElement(val);
>                 //3.doesnt work
>                 //p1.setValue("1");
>                 //4.doesnt work
>                 p1.setNodeValue("1");
>                 op.addChildElement(p1);
>                 java.net.URL endpoint = new URL(
>                   "http://localhost:8080/axis2/services/HRService");
>                 msg.writeTo(System.out);
>                 System.out.println();
>                 System.out.println();
>                 SOAPMessage response = sConn.call(msg, endpoint);
>                 response.writeTo(System.out);
>         }
> }
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>         <soapenv:Header />
>         <soapenv:Body xmlns:ns1="http://types.wsdl.custom.ws.ssk.com/xsd">
>                 <ns1:getEmployee xmlns="http://types.wsdl.custom.ws.ssk.com/xsd" />
>         </soapenv:Body>
> </soapenv:Envelope>
> Regards,
> sigirisetti

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org