Sending response to java Client

Hi everyone,
I am trying to make a java client that is solely used for the login verification, and if the user is granted access the server return a jnlp file as a response. For this I have use a JEditorPane that loads a existing html mask with a form. My questin is :
How could I send this response to java client so that I can process it and give it to webstart as a parameter.
How can I capture the events occuring on elements inside the HTML form.
waiting for any kind of help :)
Nikhil

this subforum is about Kerberos and GSS and not about NTLM. Why are you hasseling with NTLM? Take Kerberos.

Similar Messages

  • Not able to receive the web service response to java client - jax-rpc

    HI,
    Have a wsdl and created the java client using wscompile and got the set of files (Port, Binding, ServiceLocator, Service and all related java files).
    My java client sends the valid java request to the webserver and i could see the correct response coming back to my machine as the reply from the webserver.
    But i couldnt get the response printed using System.out.println in my java client when i invoke call.invoke() method with needed input parameters.
    Do i need to set any encoding or how do i get the response in the my java client which is returned from the webserver?

    The whole PL/SQL which fails in case it helps to solve the issue
    declare
    peticion VARCHAR2(32767);
    env VARCHAR2(32767);
    url varchar2(1000);
    http_req utl_http.req;
    http_resp utl_http.resp;
    begin
    url:='http://<HOST>:7778';
    -- soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    -- <auth:BasicChallenge
    -- xmlns:auth="http://www.soap-authentication.org/2002/01/">
    -- <Realm>Oracle Calendar Web Services</Realm>
    -- </auth:BasicChallenge>
    peticion:='
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
    <auth:BasicAuth xmlns:auth="http://soap-authentication.org/2002/01/">
    <Name>sysadmin</Name>
    <Password>sysadmin1</Password>
    </auth:BasicAuth>
    </soap:Header>
    <soap:Body>
    <cwsl:Create xmlns:cwsl="http://www.oracle.com/WebServices/Calendaring/1.0/">
    <CmdId>Testoraptor Command 31</CmdId>
    <iCalendar>
    <vcalendar prodid="-//Oracle//Calendaring//Calendarlet//EN" version="2.0">
    <vevent>
    <class>PUBLIC</class>
    <description>a long description</description>
    <dtstart>20061003T090909</dtstart>
    <duration>60M</duration >
    <location>my location</location>
    <priority>2</priority>
    <summary>a title</summary>
    <uid>4567</uid>
    <x-oracle-eventtype>APPOINTMENT</x-oracle-eventtype>
    </vevent>
    </vcalendar>
    </iCalendar>
    </cwsl:Create>
    </soap:Body>
    </soap:Envelope>';
    http_req := utl_http.begin_request(url||'/ocws-bin/ocas.fcgi', 'POST','HTTP/1.0');
    utl_http.set_header(http_req, 'Content-Type', 'text/xml');
    utl_http.set_header(http_req, 'Content-Length', length(peticion));
    utl_http.set_header(http_req, 'SOAPAction', '"http://www.oracle.com/WebServices/Calendaring/1.0/Create"');
    utl_http.write_text(http_req, peticion);
    dbms_output.put_line (length(peticion));
    http_resp := utl_http.get_response(http_req);
    utl_http.read_text(http_resp, env);
    utl_http.end_response(http_resp);
    end;
    We have tried many different XML structures but we are not able to create an appointment.

  • Trying SAML sender-vouches, standalone Java client call to service bus.

    I've built a standalone Java client using Jax-ws. It produces a wsse header containing both a SAMLAttribute and an optional SAMLAuthentication statement.
    I've tried to configure a proxy service on the servicebus (10gR3) using ws-policy (weblogic version, not ws-1.2), configured a SAMLIdentityAsserter (v2), an identity provider partner and a SAMLIdentityNameMapper.
    I get the message weblogic.xml.crypto.wss.SecurityTokenValidateResult@ca32f2[status: false][msg The SAML token is not valid.]
    when sending SAML assertions which looks valid to me.
    If you see something missing or invalid in the SAML, something missing in the configuration or something else, I would be really glad.
    All examples are using a SAMLCredentialmapper, but I'm building a standalone client, so a weblogic SAMLCredentialMapper is out of the question (?).
    request header:
    <S:Header>
    <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" S:mustUnderstand="1">
    <saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:exc14n="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:xs="http://www.w3.org/2001/XMLSchema" AssertionID="1246342701761" IssueInstant="2009-06-30T06:18:21.683Z" Issuer="http://openuri.org/service/customer/contact/contactInformationService" MajorVersion="1" MinorVersion="1">
    <saml:Conditions NotBefore="2009-06-30T06:17:21.683Z" NotOnOrAfter="2009-06-30T07:18:21.683Z"/>
    <saml:AuthenticationStatement AuthenticationInstant="2009-06-30T06:18:21.683Z" AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:unspecified">
    <saml:Subject>
    <saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName" NameQualifier="sb1sk">uid=vsb,ou=smn</saml:NameIdentifier>
    <saml:SubjectConfirmation>
    <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:sender-vouches</saml:ConfirmationMethod>
    </saml:SubjectConfirmation>
    </saml:Subject>
    </saml:AuthenticationStatement>
    </saml:Assertion>
    </wsse:Security>
    response:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header/>
    <env:Body>
    <env:Fault xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <faultcode>wsse:InvalidSecurityToken</faultcode>
    <faultstring>Security token failed to validate. weblogic.xml.crypto.wss.SecurityTokenValidateResult@1061c5e[status: false][msg The SAML token is not valid.]</faultstring>
    </env:Fault>
    </env:Body>
    </env:Envelope>
    If the client leaves out the wsse:security element in the header, the service complains
    <faultstring>No Security header in message but required by policy.</faultstring>
    The SAMLIdentity name mapper is never loaded at all (checked by logging at class loading)
    The configuration in the Identity provider partner:
    audience uri: target:*:/
    issuer uri: /service/customer/contact/contactInformationService (also tried with a unique string equal to what the client sends)
    virtual user: enabled
    confirmation method: sender-vouches
    I am not using any certificates (tryed both with and without)
    Policy in use for the proxy service:
    <?xml version="1.0"?>
    <wsp:Policy
    xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
    xmlns:wssp="http://www.bea.com/wls90/security/policy"
    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
    xmlns:wls="http://www.bea.com/wls90/security/policy/wsee#part"
    wsu:Id="samlSV"
    >
    <wssp:Identity>
    <wssp:SupportedTokens>
    <wssp:SecurityToken TokenType="http://docs.oasis-open.org/wss/2004/01/oasis-2004-01-saml-token-profile-1.0#SAMLAssertionID">
    <wssp:Claims>
    <wssp:ConfirmationMethod>sender-vouches</wssp:ConfirmationMethod>
    </wssp:Claims>
    </wssp:SecurityToken>
    </wssp:SupportedTokens>
    </wssp:Identity>
    </wsp:Policy>
    Stacktrace:
    weblogic.xml.crypto.wss.WSSecurityException: Security token failed to validate. weblogic.xml.crypto.wss.SecurityTokenVal
    idateResult@a4fc20[status: false][msg The SAML token is not valid.]
    at weblogic.xml.crypto.wss.SecurityImpl.unmarshalAndProcessSecurityToken(SecurityImpl.java:630)
    at weblogic.xml.crypto.wss.SecurityImpl.unmarshalChildren(SecurityImpl.java:556)
    at weblogic.xml.crypto.wss.SecurityImpl.unmarshalInternal(SecurityImpl.java:448)
    at weblogic.xml.crypto.wss.SecurityImpl.unmarshal(SecurityImpl.java:416)
    at weblogic.xml.crypto.wss.api.WSSecurityFactory.unmarshalAndProcessSecurity(WSSecurityFactory.java:66)
    at weblogic.wsee.security.WssServerHandler.processRequest(WssServerHandler.java:35)
    at weblogic.wsee.security.WssHandler.handleRequest(WssHandler.java:74)
    at com.bea.wli.sb.security.wss.WssInboundHandler.processRequest(WssInboundHandler.java:116)
    at com.bea.wli.sb.security.wss.WssHandlerImpl.doInboundRequest(WssHandlerImpl.java:201)
    at com.bea.wli.sb.context.BindingLayerImpl.addRequest(BindingLayerImpl.java:257)
    at com.bea.wli.sb.pipeline.MessageProcessor.processRequest(MessageProcessor.java:66)
    at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:508)
    at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:506)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    Edited by: user6080617 on Jun 29, 2009 11:39 PM

    Thank you for the tip. I've tried it, the result is below. It suspect something missing in my configuration, but I do not know what.
    <WSEE:17>Class of cred is: class weblogic.xml.saaj.SOAPElementImpl<SAMLCredentialImpl.<init>:85>
    <WSEE:17>Instantiating SAMLAssertionInfoFactory<SAMLCredentialImpl.<init>:87>
    <WSEE:17>Getting SAMLAssertionInfo from DOM Element<SAMLCredentialImpl.<init>:97>
    <WSEE:17>Got SAMLAssertionInfo<SAMLCredentialImpl.<init>:117>
    <WSEE:17>Assertion ID: 1246358297862<SAMLCredentialImpl.verbose:69>
    <WSEE:17>Assertion CM: urn:oasis:names:tc:SAML:1.0:cm:sender-vouches<SAMLCredentialImpl.verbose:70>
    <WSEE:17>Assertion Subject: uid=vsb,ou=smn<SAMLCredentialImpl.verbose:71>
    <WSEE:17>Assertion Version: 1.1<SAMLCredentialImpl.verbose:72>
    <WSEE:17>Attempting assertIdentity<CSSUtils.assertIdentity:310>
    <WSEE:17>SAML_TARGET_RESOURCE is: /service/customer/contact/contactInformationService<CSSUtils.assertIdentity:312>
    <WSEE:17>Got Principal Authenticator<CSSUtils.assertIdentity:314>
    <WSEE:17>Cred type is: SAML.Assertion.DOM, Node: [saml:Assertion: null]<CSSUtils.assertIdentity:320>
    <WSEE:17>Exception while asserting identity: javax.security.auth.login.LoginException: [Security:090377]Identity Assertion Failed, weblogic.security.spi.IdentityAssertionException: [Security:090380]Identity Assertion Failed, Unsupported Token Type: SAML.Assertion.DOM<CSSUtils.assertIdentity:325>
    <WSEE:17>javax.security.auth.login.LoginException: [Security:090377]Identity Assertion Failed, weblogic.security.spi.IdentityAssertionException: [Security:090380]Identity Assertion Failed, Unsupported Token Type: SAML.Assertion.DOM<CSSUtils.assertIdentity:326>

  • Web Service: Sender Channel with JAVA client (Apache Axis)

    Hello to all,
    I am trying to connect an Axis-based Java client to XI via the SOAP adapter.
    When connecting, the client receives the error message "Unauthorised" - it seems as if it cannot handle the basic HTTP authentication.
    Can I easily disable this authentication mode in XI (or better: in this adapter)?
    Or does anybody know how to implement the authentication in the Axis framework?
    Many thanks and best regards,
    Carsten

    Carsten,
    AFAIK, you must provide the credntials to access the service on XI. Follow the section <b>Call configuration</b> on this link
    http://ws.apache.org/axis/java/client-side-axis.html.
    you basically need to properties with the Call method as explained in the link.

  • Sending response back to client

    The result of a request is in the format of inputStream before sending back to client... I used to use getPrinter() method to write my output back to the client... so how can I write the output from the inputStream back to the client without reading the data from the inputstream then writing them to the PrintWriter object??
    Thanks...

    Actually I miss-stated one point.. the result should be in Output stream format...
    eg. the cleint makes a request to servlet A, then A asks class B to get the result and B writes the result to an output stream and return the stream back to servlet A...
    now servlet A has the result in the format of Output stream..... so how can servlet A get the data from the output stream (as output stream only has write methods) and sends them back to the client?

  • Java Client throws exception – while sending NTLMV2 Response from WIN7 to W

    We have written a Java client which connects to a webservices application using NTLM authentication against Windows 2008 R2 Server (using IIS7). This program works fine when running from Windows XP, Linux but failing when running from Windows 7.
    Error encountered is: java.io.IOException: Authentication failure.
    Here is what we have written to connect to HTTPS with credential using SSLContext as mentioned below.
    SSLContext sc = SSLContext.getInstance( "SSL" );
    sc.init( null, trustAllCerts, new java.security.SecureRandom() );
    HttpsURLConnection.setDefaultSSLSocketFactory( sc.getSocketFactory() );
    ( ( HttpsURLConnection )( m_oHttpURLConnection ) ).setHostnameVerifier( this );
    URL url = new URL("https://testsite...");
    HttpsURLConnection m_oHttpURLConnection = (HttpsURLConnection) url.openConnection();
    Following properties are set to HttpsURLConnection:
    RequestMethod : GET
    InstanceFollowRedirects : true
    AllowUserInteraction : true
    UseCaches : false
    DoOutput : true
    DoInput : true
    After setting all the above parameters the following code is used to set credentials data and connect to site
    Authenticator.setDefault(new MyAuthenticator ());
    m_oHttpURLConnection.connect();
    After connection is successful request XML is sent to server and expecting a response from the server. So when the below line is called exception is thrown.
    m_oHttpURLConnection.getResponseCode();
    Exception :
    java.io.IOException: Authentication failure
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1173)
         at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
         at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:318)
    After changing LAN Manager Authentication level setting of Windows 7 from “Send NTLMv2 response only” to “Send LM & NTLM – use NTLMv2 session security if negotiated”, application is working fine.
    Local Security Settings àSecurity SettingsàLocal Policies à Security Optionsà Network security: LAN Manager Authentication level
    By default in Windows Vista, Windows Server 2008, Windows 7, and Windows Server 2008 R2: Send NTLMv2 response only , Lowering the security level at the client end is bit risk and typically is not recommended.

    this subforum is about Kerberos and GSS and not about NTLM. Why are you hasseling with NTLM? Take Kerberos.

  • HELP plz..How to send response from server to client

    Hi..plz help me out of this problem..i am sending request from client side to servlet..lets say i am sendin "Bechkam"..now my servlet fetches this request.n finds out that BECHKAM is a football player..now i dont want to print this on the client side..i simply want to sent this response back to the client..after client receives this response the client should print bechkam is a football player..i have done coding of sending request from client(javascript code)to server but dont kno how to send response to client..do i have to use cookies or sessions..
    Any help will be greatly appreciated
    THANX

    I'm not sure how well versed you're with HTTP and servlets.
    What you term as 'printing on the client side' is in fact the response you're looking for. The response you send from a servlet is 'printed' into the response stream. The client receives this data and interprets is according to some headers. Usually, this data is HTML/ plain text which is interpreted by the browser and rendered as required. It could very well be displayed as is.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    ----------------------------------------------------------------

  • How to send  a request to servlet from a java client.

    I called a servlet from java client using URL object.
    I could establish a connection with server and display
    the content(like req.getservername etc.,)
    of servlet on client side(DOS prompt).
    My question is how do i send a request to servlet from the client.
    let me say, i have to send a value as 10 to servlet and do some processing
    ( like 10*2 = 20) display the output (20) on client side..
    It will be appreciated if u can mention the syntax...

    just add the query string to the url you use to create the URL object from.

  • Send message from java not client

    I have a java app running on my server and I'd like to send
    messages to subscribed clients. All the messaging examples I find
    have the messages originating from a flex producer. I want java to
    be the producer.

    I used this example to get it done.
    http://western-skies.blogspot.com/2006/07/flex-sending-messages-from-server-side.html

  • How to upload file from java client to php

    hi
    i am trying to upload/send a file from client using swing/applet
    and receiving it with php code.
    here is the php code which uploads the post file from the client
    $uploaddir = "/home/raghavendra/Documents/";
    $file = basename( $_FILES["uploadedfile"]["name"]);
    echo "file:\n".$file;
    $uploadfile = $uploaddir. $file;
    if (move_uploaded_file($_FILES["uploadedfile"]["tmp_name"],$uploadfile)) {
    echo "File is valid, and was successfully uploaded.\n";
    else {
    echo "File upload failure Possible file upload attack!\n";
    and corresponding different java code which post the
    1)
    public void postmethodTest(String filefrom){
    try{
    String hostname = "localhost";
    int port = 80;
    InetAddress addr = InetAddress.getByName(hostname);
    Socket socket = new Socket(addr, port);
    // Send header
    String path ="/php_prgs/var/www/nsboxng/htdocs/tryupdate.php";
    File theFile = new File(filefrom);
    System.out.println ("size: " + (int) theFile.length());
    DataInputStream fis = new DataInputStream(new BufferedInputStream(new FileInputStream(theFile)));
    byte[] theData = new byte[(int) theFile.length( )];
    fis.readFully(theData);
    fis.close();
    DataOutputStream raw = new DataOutputStream(socket.getOutputStream());
    Writer wr = new OutputStreamWriter(raw);
    String command =
    "POST "+path+" HTTP/1.0\r\n"
    + "Content-type: multipart/form-data, boundary=mango\r\n"
    + "Content-length: " + ((int) theFile.length()) + "\r\n"
    + "\r\n"
    + "--mango\r\n"
    + "content-disposition: name=\"MAX_FILE_SIZE\"\r\n"
    + "\r\n"
    + "\r\n--mango\r\n"
    + "content-disposition: attachment; name=\"datafile\"" ;
    String filename="test.doc\"\r\n"
    + "Content-Type: text/doc\r\n"
    + "Content-Transfer-Encoding: binary\r\n"
    + "\r\n";
    wr.write(command);
    wr.flush();
    raw.write(theData);
    raw.flush( );
    wr.write("\r\n--mango--\r\n");
    wr.flush( );
    BufferedReader rd = new BufferedReader(new
    InputStreamReader(socket.getInputStream()));
    String line;
    while ((line = rd.readLine()) != null) {
    System.out.println("out"+line);
    wr.close();
    raw.close();
    socket.close();
    } catch (Exception e) {System.out.println(e.toString());}
    2)
    public void postMethod(String strURL, String filefrom){
    try {
    String fname = filefrom.substring(filefrom.lastIndexOf("/")+1, filefrom.length());
    File input=new File(filefrom);
    // Prepare HTTP post
    PostMethod post = new PostMethod(strURL);
    // Request content will be retrieved directly
    // from the input stream
    // Per default, the request content needs to be buffered
    // in order to determine its length.
    // Request body buffering can be avoided when
    // content length is explicitly specified
    post.setRequestEntity(new InputStreamRequestEntity(new FileInputStream(input), input.length()));
    // Specify content type and encoding
    // If content encoding is not explicitly specified
    // ISO-8859-1 is assumed
    //post.setRequestHeader("Content-type", "text/xml; charset=ISO-8859-1");
    post.setRequestHeader("Content-Type","multipart/form-data");
    post.setRequestHeader("Content-Disposition", "form-data; name="+fname);
    // Get HTTP client
    HttpClient httpclient = new HttpClient();
    // Execute request
    try {
    int result=httpclient.executeMethod(post);
    // Display status code
    System.out.println("Response status code: " +result);
    // Display response
    System.out.println("Response body: ");
    // System.out.println(post.getResponseBodyAsString());
    BufferedReader console = new BufferedReader(new InputStreamReader(post.getResponseBodyAsStream()));
    String name = null;
    String line = null;
    try {
    while ((line = console.readLine()) != null) {
    System.out.println("output"+line);
    //name = console.readLine();
    catch (IOException e) { name = "<" + e + ">"; }
    // System.out.println("Hello " + name);
    } finally {
    // Release current connection to the connection pool
    // once you are done
    post.releaseConnection();
    catch(IOException e){
    but am getting else condition response from php code
    but if i post with html code it is working fine.
    can anybody help me please where i have to change the code
    please suggest me. am in a big trouble and i have to complete this as soon as possible

    One thread is enough.
    http://forum.java.sun.com/thread.jspa?threadID=5198449
    You could have bumped it instead. Also, you still just posted a junk of unformatted stuff. Furthermore, for HttpClient support ask at an HttpClient mailing list of rorum.

  • Calling .asmx Web Service from Java Client

    hi
    I have created one java client in WSAD 5.1 to invoke .asmx web service. I have used the following code for it.
    import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;
    import org.apache.axis.encoding.XMLType;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.NamespaceConstants;
    import javax.xml.rpc.ParameterMode;
    import java.net.URL;
    public class JavaWS3
         public static void main(String [] args)
              try
                   // Responds the same with or without the ?WSDL
                   String     strEndPoint          = "http://www.meizlik.com/Service.asmx";
                   String     strSoapAction     = "http://www.meizlik.com/BigAdd";
                   String     strSchemaURL     = "http://www.w3.org/2001/XMLSchema";
                   String     strParamName1     = "addend_1";
                   String     strParamName2     = "addend_2";
                   String     strParameterVal1= "10";
                   String     strParameterVal2= "7";
                   String     strFunctionName     = "BigAdd";
                   //Call     call   = (Call) new Service().createCall();//Works
                   //Call     call   = new Call(strSoapAction);//Works same
                   //Call     call   = new Call(strEndPoint);//Works same
                   Service  service = new Service();
                    Call call= (Call) service.createCall();
                   call.setEncodingStyle(NamespaceConstants.NSURI_SOAP_ENCODING);
                   call.setTargetEndpointAddress(new URL(strEndPoint));
                   // first parameter in QName seemingly takes ANYTHING
                   call.setOperationName(new QName("http://www.meizlik.com", strFunctionName));
                   // Set the name of the parameter and the return type
                   call.setReturnType(XMLType.XSD_STRING);
                   call.addParameter(new QName("http://www.meizlik.com",strParamName1), XMLType.XSD_STRING, ParameterMode.IN);
                   call.addParameter(new QName("http://www.meizlik.com",strParamName2), XMLType.XSD_STRING, ParameterMode.IN);
                   // Catch the result and print it
                   // Parameter count is now ONE (1).
                   // call.setUseSOAPAction(true);//Not Necessary
                   call.setSOAPActionURI(strSoapAction);//Yes Necessary
                   String     strResult = (String) call.invoke(
                        new Object[] {
                             new String(strParameterVal1),
                             new String(strParameterVal2)
                   System.out.println("Result='" + strResult + "'");
              catch (Exception e)
                   e.printStackTrace();
                   System.out.println(e.toString());
    }this code is giving me the exception as :
    java.net.ConnectException: Operation timed out: connect due to invalid addressI visited web service URL http://www.meizlik.com/Service.asmx and its working fine.
    I also tried Java Proxy method in WSAD 5.1 but it is showing me the same error.
    Where am I wrong? Can anyone plz give me solution 4 this.
    Thanks..

    Hi,
    I have even generated folowing code with SoaMoa, it is perfect. Please try SoaMoa it is a useful tool.
    The generated code of SoaMoa :
    /* Generated Testcase by SoaMoa, :ridvan at Thu Jun 04 21:53:14 CEST 2009 */
    import java.util.Map;
    import javax.xml.namespace.QName;
    import javax.xml.soap.MessageFactory;
    import javax.xml.soap.SOAPBody;
    import javax.xml.soap.SOAPConstants;
    import javax.xml.soap.SOAPElement;
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPMessage;
    import javax.xml.soap.SOAPPart;
    import javax.xml.ws.Dispatch;
    import javax.xml.ws.Service;
    import javax.xml.ws.BindingProvider;
    import javax.xml.ws.soap.SOAPBinding;
    import java.util.Iterator;
    import junit.framework.TestCase;
    public class BigAddTest extends TestCase {
    public void testBigAdd() throws Exception {
    String endpointURL = "http://www.meizlik.com/Service.asmx";
    QName serviceName = new QName("http://www.meizlik.com", "Bob_Services");
    QName portName = new QName("http://www.meizlik.com", "Bob_ServicesHttpPost");
    Service service = Service.create(serviceName);
    service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, endpointURL);
    Dispatch<SOAPMessage> dispatch = service.createDispatch(portName, SOAPMessage.class, Service.Mode.MESSAGE);
    BindingProvider bindingProvider = (BindingProvider) dispatch;
    // Optionally Configure RequestContext to send SOAPAction HTTP
    Map<String, Object> rc = bindingProvider.getRequestContext();
    rc.put(BindingProvider.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
    rc.put(BindingProvider.SOAPACTION_URI_PROPERTY, "http://www.meizlik.com/BigAdd");
    MessageFactory messagefactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
    SOAPMessage request = messagefactory.createMessage();
    SOAPPart part = request.getSOAPPart();
    SOAPEnvelope env = part.getEnvelope();
    SOAPBody body = env.getBody();
    body.addNamespaceDeclaration("www", "http://www.meizlik.com");
    SOAPElement BigAdd = body.addChildElement("BigAdd", "www");
    SOAPElement addend_1 = BigAdd.addChildElement("addend_1", "www");
    addend_1.addTextNode("11");
    SOAPElement addend_2 = BigAdd.addChildElement("addend_2", "www");
    addend_2.addTextNode("11");
    request.saveChanges();
    SOAPMessage response = dispatch.invoke(request);
    SOAPBody replyBody = response.getSOAPBody();
    SOAPElement BigAddResponse = (SOAPElement) replyBody.getChildElements(new QName("http://www.meizlik.com", "BigAddResponse")).next();
    assertNotNull( "BigAddResponse is null", BigAddResponse);
    SOAPElement BigAddResult = (SOAPElement) BigAddResponse.getChildElements(new QName("http://www.meizlik.com", "BigAddResult")).next();
    assertNotNull( "BigAddResult is null", BigAddResult);
    assertEquals("BigAddResult", "0000000000000000000000000022", BigAddResult.getTextContent());
    }

  • XI 3.0 and external Java client/web service

    Hello,
    I'm desperately tryin' to get an external system to work together with XI 3.0.
    The setup is quite simple:
    The external system is nothing but a simple Java program sending SOAP-based requests to a webservice. It is based on AXIS and is running satisfyingly when connecting directly to an appropriate Tomcat/AXIS-based web service, see the following communication.
    -- local request
    POST /axis/VAPService.jws HTTP/1.0
    Content-Type: text/xml; charset=utf-8
    Accept: application/soap+xml, application/dime, multipart/related, text/*
    User-Agent: Axis/1.1
    Host: 192.168.1.2:8080
    Cache-Control: no-cache
    Pragma: no-cache
    SOAPAction: "http://localhost/SOAPRequest"
    Content-Length: 422
    <?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:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
      <SOAPRequest soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
       <SOAPDataIn xsi:type="xsd:string">890000001</SOAPDataIn>
      </SOAPRequest>
    </soapenv:Body>
    </soapenv:Envelope>
    -- local response
    HTTP/1.1 200 OK
    Set-Cookie: JSESSIONID=DFD7A00A244C18A058FCB52A8321A167; Path=/axis
    Content-Type: text/xml;charset=utf-8
    Date: Mon, 23 Aug 2004 06:52:47 GMT
    Server: Apache-Coyote/1.1
    Connection: close
    <?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:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
      <SOAPRequestResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
       <SOAPRequestReturn xsi:type="xsd:int">1</SOAPRequestReturn>
      </SOAPRequestResponse>
    </soapenv:Body>
    </soapenv:Envelope>
    Now I have designed and configured simple business scenarios with XI 3.0 (synchronous as well as asynchronous). The only response I get from XI when the Java client connects ist the following:
    -- remote request
    POST /sap/xi/engine?type=entry HTTP/1.0
    Content-Type: text/xml; charset=utf-8
    Accept: application/soap+xml, application/dime, multipart/related, text/*
    User-Agent: Axis/1.1
    Host: <host>:<port>
    Cache-Control: no-cache
    Pragma: no-cache
    SOAPAction: "http://soap.org/soap"
    Content-Length: 424
    <?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:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
      <SOAPRequest soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
       <SOAPDataIn xsi:type="xsd:string">890000001</SOAPDataIn>
      </SOAPRequest>
    </soapenv:Body>
    </soapenv:Envelope>
    -- remote response
    HTTP/1.0 500 HTTP standard status code
    content-type: text/xml
    content-length: 1493
    content-id: <[email protected]>
    server: SAP Web Application Server (1.0;640)
    <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP:Header>
    </SOAP:Header>
    <SOAP:Body>
    <SOAP:Fault xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:wsu="http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsse="http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" SOAP:mustUnderstand="1">
       <SOAP:faultcode>Client</SOAP:faultcode>
       <SOAP:faultstring></SOAP:faultstring>
       <SOAP:faultactor>http://sap.com/xi/XI/Message/30</SOAP:faultactor>
       <SOAP:faultdetail>
          <SAP:Error xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:wsu="http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsse="http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" SOAP:mustUnderstand="1">
             <SAP:Category>XIProtocol</SAP:Category>
             <SAP:Code area="PARSER">UNEXSPECTED_VALUE</SAP:Code>
             <SAP:P1>Main/@versionMajor</SAP:P1>
             <SAP:P2>000</SAP:P2>
             <SAP:P3>003</SAP:P3>
             <SAP:P4></SAP:P4>
             <SAP:AdditionalText></SAP:AdditionalText>
             <SAP:ApplicationFaultMessage namespace=""></SAP:ApplicationFaultMessage>
             <SAP:Stack>XML tag Main/@versionMajor has the incorrect value 000. Value 003 expected
             </SAP:Stack>
          </SAP:Error>
       </SOAP:faultdetail>
    </SOAP:Fault>
    </SOAP:Body>
    </SOAP:Envelope>
    I made sure the business service in the integration directory is named SOAPRequest and is using SOAP as the communication channel. As the adapter engine I chose the integration server, since it is the only option, although the SOAP adapter framework is installed (according to the SLD) and deactivated any options like header and attachment.
    Upon facing the above response I also tried any kind of derivative with inserting the described tag/attribute/element versionMajor, but to no avail.
    My questions are:
    What do I have to do additionally to get the whole thing running, i.e. configure my external systems in the SLD, providing proxy settings?
    Do I have to create web services within the Web AS (which provide some kind of facade to the XI engine using the proxy generation) and connect to these instead of directly addressing the integration engine (I'm using the URL http://<host>:<port>/sap/xi/engine?type=entry, but I also tried http://<host>:<port>/XISOAPAdapter/MessageServlet?channel=:SOAPRequest:SOAPIn, this led to a 404 not found error)?
    What settings do I have to provide to see the messages the client is sending, when looking into the runtime workbench it seems as if there are no messages at all - at least from my client?
    Hopefully somebody might help me out or least provide some information to get me going.
    Thanks in advance.
    Best regards,
    T.Hrastnik

    Hello Oliver,
    all information I gathered so far derives from the online help for XI 3.0, to be found under http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm. There You'll find - in the last quarter of the navigation bar on the left side - sections describing the adapter engine alonside the SOAP adapter.
    Additionally I went through almost all postings in this forum.
    This alonside the mandatory trial-and-error approach (I did a lot of it up to date) led me to my current status, i.e. so far I haven't found any kind of (simple) tutorial or demo saying "If You want to establish a web service based connection via SOAP between external applications and XI first do this, then that ...", sadly enough :-(.
    Hope that helps, any questions are always welcome, I'll try my best to answer them ;-).
    Best regards,
    Tomaz

  • SOAP --XI ---RFC or Java Client  Proxy

    Hello Gurus,
    Need your adivce for a scenario in XI
    Scenario ---  To implement XI with SAP SCEM(Supply Chain Event Management).
    Client is sending data from Web Portal (JSP Page) and wants to integrate with R/3.
    (Request from client and Response from R/3 shown again at browser )
    Web Portal (JSP Page) is on server A and XI on server B
    Queries ---
    1. Can I use Java Client Proxy Approach ---  proxy --- xi -- rfc approach 
    If  Web Portal (JSP page) is working in server A and XI in server B then can I call xi server from jsp page by passing xi server credential (username,password,bus service) and using sync Interface I can show result back to browser.
    2. For SOAP Approach  -- SOAP -- XI --- RFC approach 
    Suppose I need to send two parameters from my Web Portal (JSP page) to xi to R/3 and it will return some result.
    Concept of Webservice --- any application (like BAPI ) exposed.
    a. Pls tell me all the steps required for IR and ID
    b.How can I invoke that generated webservice from my jsp page --- so that my request parameters values go to xi from my jsp page and to R/3 and then result from R/3 to xi and to my jsp page.
    Regards

    I think second approach is more appropriate ie. SOAP>XI>RFC
    Some of the blogs you can refer:
    /people/riyaz.sayyad/blog/2006/05/07/consuming-xi-web-services-using-web-dynpro-150-part-i
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/d23cbe11-0d01-0010-5287-873a22024f79
    Sender SOAP adapter config: http://help.sap.com/saphelp_nw04s/helpdata/en/fc/5ad93f130f9215e10000000a155106/content.htm
    Hope this helps,
    Rgds,
    Moorthy

  • Java client for OSB proxy with JMS Transport

    Hi,
    I am trying to call OSB proxy with JMS Transport. I am generating the client through ant task clientgen and following this article
    http://www.oracle.com/technetwork/articles/murphy-soa-jms-092653.html
    The osb proxy is req-response and is simply routing to BS which return a string value.
    When I run my client, it get stuck and does not return at all. Has any one trying java client in such scenario?
    What I may be missing?
    Below is snipped of client code:
    String url = "http://localhost:7021/sbresource?PROXY/MySample/MyJMSProxyService";
    CreditLoanApprovalServiceSoapBindingQSService service = new CreditLoanApprovalServiceSoapBindingQSService_Impl(url);
    MyPortType port = service.getCreditLoanApprovalServiceSoapBindingQSPort();
    LoanStruct in = new LoanStruct(); //populated the data structure
    String loanResult = port.processLoanApp(in); // Stuck here without any error
    System.out.println("LoanResult--> " + loanResult);
    Thx
    /Ashwani

    http://localhost:7021/sbresource?PROXY/MySample/MyJMSProxyService is the WSDL URL of the proxy.
    Transport is is picked by the client from wsdl.
    As far as the documentation of client generation is there, there is no change.
    But meanwhile I have started working on sending the message directly to queue. JMSProxy is getting called. May be I will first run the proxy this way and then try troubleshooting the java client.
    Regards
    Ashwani

  • Java client for OSB service

    Hi All,
    We have to talk to OSB11g proxy service which is created as Any Soap service (url: http://myosb.firmname.com:7001/osb-ws)
    I have java client applications which need to consume this proxy service built on top of OSB by providing the necessary inputs.
    Typically we get wsdl url's and then we use Jdeveloper to create web service client proxies to generate client side web service artifacts and call the web service.
    But I am confused here as to how can I get a handle to the OSB service from a java client. The OSB developers on the project tell me they don't have and cannot provide a WSDL based URL.
    What are the general practices for consuming OSB proxy service from java client apps. Google search result did not yield much help.
    Please let me know your thoughts.
    Regards,

    Hi Anuj,
    Thanks for reply. As u guys mentioned that about the URL I have rechecked the URL and realized the port number which I was using that was Admin Server Port while environment contains two servers Admin and Managed both. I have change the Port Number from Admin to Managed now its hitting the Service but now another problem I start facing that I need to pass a big XML as input request to that OSB Proxy Service. I have two different code where I am attaching the input request in two different ways but none of them is passing that request to URL and in both cases I am getting default response from URL.
    Here is the Code, Code1 through Core Java:
    ===============================================================================================
    package retriggerpsftorder;
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.net.URL;
    import java.net.URLConnection;
    import java.net.URLEncoder;
    public class MyTest {
    public MyTest() {
    System.out.println("Constructor executing");
    System.out.println("JAVA Version : " + System.getProperty("JAVA.VERSION"));
    public static void main(String arga[]) {
    try {
    // Construct data
    String data = URLEncoder.encode("key1", "UTF-8") + "=" + URLEncoder.encode("<migrateOrder>\n" +
    " <migrateOrderId>51c797d61dd211b2818a</migrateOrderId>\n" +
    " <createCustomer>false</createCustomer>\n" +
    " <createBillingAccount>false</createBillingAccount>\n" +
    " <Customer>\n" +
    " <ID>\n" +
    " </PIN>\n" +
    "     </customerAccountNumber\"></customerAccountNumber\">\n" +
    " </externalIdentifier>\n" +
    " </ID>\n" +
    " <creditClass>W</creditClass>\n" +
    " </Customer>\n" +
    " <Account>\n" +
    " <name>Gurwinder Singh</name>\n" +
    " <ID>\n" +
    " <PIN>1987</PIN>\n" +
    "     <billingAccountNumber>695909361</billingAccountNumber>\n" +
    " </ID>\n" +
    " </Account>\n" +
    " <CustomerOrder>\n" +
    " <customerOrderPartyReference>\n" +
    " <MSISDN>61425265789</MSISDN>\n" +
    " </customerOrderPartyReference>\n" +
    " <orderSource>\n" +
    " <templateName>AUP1057_AU10357_24_DATA_0113</templateName>\n" +
    " </orderSource>\n" +
    " <typeCode>Connect</typeCode>\n" +
    " <futureSubmitDate>2011-02-28</futureSubmitDate>\n" +
    " <cancelOpenOrdersIndicator>false</cancelOpenOrdersIndicator>\n" +
    " <lineItem actionCode=\"Add\" priorityRanking=\"1\">\n" +
    " <product ID=\"AUX221\" type=\"SAMID\" attributeCount=\"19\">\n" +
    " <attribute>\n" +
    " <name>Accept Code</name>\n" +
    " <value>Accept 5</value>\n" +
    " </attribute>\n" +
    " </product>\n" +
    " </lineItem>\n" +
    " <lineItem actionCode=\"Add\" priorityRanking=\"2\">\n" +
    " <product ID=\"OFF0018\" type=\"SAMID\" attributeCount=\"1\">\n" +
    " <attribute>\n" +
    " <name>Period Override</name>\n" +
    " <value>24</value>\n" +
    " </attribute>\n" +
    " </product>\n" +
    " </lineItem>\n" +
    " <lineItem actionCode=\"Allocate\" priorityRanking=\"3\">\n" +
    " <equipment ID=\"012645002053476\" type=\"Handset\" />\n" +
    " </lineItem>\n" +
    " <lineItem actionCode=\"Allocate\" priorityRanking=\"4\">\n" +
    " <resource ID=\"89610300000905636996\" type=\"SIM\" />\n" +
    " </lineItem>\n" +
    " <externalOrderReference>\n" +
    " <serviceID>75055433</serviceID>\n" +
    " <customerID>921092224696621123154029260421</customerID>\n" +
    " <serviceStartDate>2009-02-10</serviceStartDate>\n" +
    " <serviceRatePlan>X3Cap $29 24m($29min-35cFF)</serviceRatePlan>\n" +
    " <agreementNumber>VHU0029215</agreementNumber>\n" +
    " <accountNumber>3382437469</accountNumber>\n" +
    " <migrationType>Loyalty Handset Upgrade Acq</migrationType>\n" +
    " <receiveMarketingInfoOverrideIndicator>false</receiveMarketingInfoOverrideIndicator>\n" +
    " </externalOrderReference>\n" +
    " <orderSalesReference>\n" +
    " <dealerReferenceID>D3641</dealerReferenceID>\n" +
    " <trailingCommissionRatePlan>MUPR9</trailingCommissionRatePlan>\n" +
    " <trailingCommisionDealerReference>D3734</trailingCommisionDealerReference>\n" +
    " </orderSalesReference>\n" +
    " </CustomerOrder>\n" +
    " <ContactManagementActivity>\n" +
    " <activityCategory>Proof of Purchase - Mig from 3</activityCategory>\n" +
    " <activityType>Migration from 3</activityType>\n" +
    " <activityDescription>Proof of Purchase Information</activityDescription>\n" +
    " <activityComment>MSISDN: 0425265789354610026170561</activityComment>\n" +
    " </ContactManagementActivity>\n" +
    "</migrateOrder>\n", "UTF-8");
    //data += "&" + URLEncoder.encode("key2", "UTF-8") + "=" + URLEncoder.encode("value2", "UTF-8");
    System.out.println("Data going for Request : "+data);
    // Send data
    URL url = new URL("http://172.22.161.101:8017/app/mig3/migrate/MigrateOrder");
    URLConnection conn = url.openConnection();
    conn.setDoOutput(true);
    OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
    wr.write(data);
    wr.flush();
    // Get the response
    BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
    int i=0;
    while ((line = rd.readLine()) != null) {
    System.out.println("Values of Line : "+ i + " : "+ line);// Process line...
    i++;
    wr.close();
    rd.close();
    } catch (Exception e) {
    =========================================
    Code 1 Response
    Values of Line : 0 : <?xml version="1.0" encoding="UTF-8"?>
    Values of Line : 1 : <migrateOrderReply><statusCode>Failed</statusCode><errorReturn><errorCode>CORE_SYS_GENERIC</errorCode><errorMessage>Unexpected System exception</errorMessage></errorReturn></migrateOrderReply>
    Process exited with exit code 0.
    Note: The above response message is the default response message, even if u not pass any input parameter then also the above message will come.
    ==========================================================================================================
    Code 2 : Using Servlet
    package retriggerpsftorder;
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.Servlet;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.http.client.HttpClient;
    import org.apache.commons.httpclient.HttpConnection;
    import org.apache.commons.httpclient.HttpState;
    import org.apache.commons.httpclient.NameValuePair;
    import org.apache.commons.httpclient.URI;
    import org.apache.commons.httpclient.methods.PostMethod;
    import org.apache.commons.httpclient.methods.RequestEntity;
    import org.apache.http.client.HttpClient;
    public class GIFTProcess extends HttpServlet implements Servlet {
    private static final String CONTENT_TYPE =
    "text/html; charset=windows-1252";
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    public void doGet(HttpServletRequest req,
    HttpServletResponse resp) throws ServletException,
    IOException {
    resp.setContentType(CONTENT_TYPE);
    PrintWriter out = resp.getWriter();
    try {
    NameValuePair nvpRtn =
    new NameValuePair("body", "<migrateOrder>\n" +
    " <migrateOrderId>51c797d61dd211b2818a</migrateOrderId>\n" +
    " <createCustomer>false</createCustomer>\n" +
    " <createBillingAccount>false</createBillingAccount>\n" +
    " <Customer>\n" + " <ID>\n" +
    " </PIN>\n" +
    "     </customerAccountNumber\"></customerAccountNumber\">\n" +
    " </externalIdentifier>\n" +
    " </ID>\n" +
    " <creditClass>W</creditClass>\n" +
    " </Customer>\n" + " <Account>\n" +
    " <name>Gurwinder Singh</name>\n" +
    " <ID>\n" + " <PIN>1987</PIN>\n" +
    "     <billingAccountNumber>695909361</billingAccountNumber>\n" +
    " </ID>\n" + " </Account>\n" +
    " <CustomerOrder>\n" +
    " <customerOrderPartyReference>\n" +
    " <MSISDN>61425265789</MSISDN>\n" +
    " </customerOrderPartyReference>\n" +
    " <orderSource>\n" +
    " <templateName>AUP1057_AU10357_24_DATA_0113</templateName>\n" +
    " </orderSource>\n" +
    " <typeCode>Connect</typeCode>\n" +
    " <futureSubmitDate>2011-02-28</futureSubmitDate>\n" +
    " <cancelOpenOrdersIndicator>false</cancelOpenOrdersIndicator>\n" +
    " <lineItem actionCode=\"Add\" priorityRanking=\"1\">\n" +
    " <product ID=\"AUX221\" type=\"SAMID\" attributeCount=\"19\">\n" +
    " <attribute>\n" +
    " <name>Accept Code</name>\n" +
    " <value>Accept 5</value>\n" +
    " </attribute>\n" +
    " </product>\n" + " </lineItem>\n" +
    " <lineItem actionCode=\"Add\" priorityRanking=\"2\">\n" +
    " <product ID=\"OFF0018\" type=\"SAMID\" attributeCount=\"1\">\n" +
    " <attribute>\n" +
    " <name>Period Override</name>\n" +
    " <value>24</value>\n" +
    " </attribute>\n" +
    " </product>\n" + " </lineItem>\n" +
    " <lineItem actionCode=\"Allocate\" priorityRanking=\"3\">\n" +
    " <equipment ID=\"012645002053476\" type=\"Handset\" />\n" +
    " </lineItem>\n" +
    " <lineItem actionCode=\"Allocate\" priorityRanking=\"4\">\n" +
    " <resource ID=\"89610300000905636996\" type=\"SIM\" />\n" +
    " </lineItem>\n" +
    " <externalOrderReference>\n" +
    " <serviceID>75055433</serviceID>\n" +
    " <customerID>921092224696621123154029260421</customerID>\n" +
    " <serviceStartDate>2009-02-10</serviceStartDate>\n" +
    " <serviceRatePlan>X3Cap $29 24m($29min-35cFF)</serviceRatePlan>\n" +
    " <agreementNumber>VHU0029215</agreementNumber>\n" +
    " <accountNumber>3382437469</accountNumber>\n" +
    " <migrationType>Loyalty Handset Upgrade Acq</migrationType>\n" +
    " <receiveMarketingInfoOverrideIndicator>false</receiveMarketingInfoOverrideIndicator>\n" +
    " </externalOrderReference>\n" +
    " <orderSalesReference>\n" +
    " <dealerReferenceID>D3641</dealerReferenceID>\n" +
    " <trailingCommissionRatePlan>MUPR9</trailingCommissionRatePlan>\n" +
    " <trailingCommisionDealerReference>D3734</trailingCommisionDealerReference>\n" +
    " </orderSalesReference>\n" +
    " </CustomerOrder>\n" +
    " <ContactManagementActivity>\n" +
    " <activityCategory>Proof of Purchase - Mig from 3</activityCategory>\n" +
    " <activityType>Migration from 3</activityType>\n" +
    " <activityDescription>Proof of Purchase Information</activityDescription>\n" +
    " <activityComment>MSISDN: 0425265789354610026170561</activityComment>\n" +
    " </ContactManagementActivity>\n" +
    "</migrateOrder>\n");
    NameValuePair[] nvpout = { nvpRtn };
    HttpConnection httpConn = new HttpConnection("172.22.161.101", 8017);
    System.out.println("httpConn : " + httpConn.getHost() + " getPost: " + httpConn.getPort());
    httpConn.open();
    System.out.println("Is Connection Open? --> " + httpConn.isOpen());
    PostMethod postMethod = new PostMethod();
    postMethod.setPath("http://172.22.161.101:8017/app/mig3/migrate/MigrateOrder");
    System.out.println("postMethod.getPath() : " + postMethod.getPath());
    //postMethod.setQueryString("http://172.22.161.101:8017/app/mig3/migrate/MigrateOrder");
    //System.out.println("getQueryString : " + postMethod.getQueryString());
    //System.out.println("postMethod.getParams() : " + postMethod.getParams());
    postMethod.setRequestBody(nvpout);
    System.out.println("validate--> " + postMethod.validate());
    postMethod.execute(new HttpState(), httpConn);
    System.out.println("isRequestSent --> " + postMethod.isRequestSent());
    System.out.println("statusLine--> " + postMethod.getStatusLine());
    String serviceResponse = postMethod.getResponseBodyAsString();
    System.out.println("Response from Call : " + serviceResponse);
    } catch (Exception e) {
    out.println("Error Occured during the process.");
    e.printStackTrace();
    ==========================================================================================
    Code 2 Response -----
    C:\Oracle\Middleware\SOASuite101351\jdk\bin\javaw.exe -jar C:\jdevstudio10135\j2ee\home\admin.jar ormi://10.161.1.169:23891 oc4jadmin **** -updateConfig
    11/03/02 15:30:19 WARNING: Shared-library oracle.expression-evaluator:10.1.3.1 is closing, but is imported by adf.oracle.domain:10.1.3.1, adf.generic.domain:10.1.3.1.
    2/03/2011 15:30:19 com.oracle.corba.ee.impl.orb.ORBServerExtensionProviderImpl preInitApplicationServer
    WARNING: ORB ignoring configuration changes. Restart OC4J to apply new ORB configuration.
    Ready message received from Oc4jNotifier.
    Embedded OC4J startup time: 7765 ms.
    Target URL -- http://10.161.1.169:8988/JAVAProject-RetriggerPSFTOrder-context-root/giftprocess
    ERROR: Unable to connect to JQS service: connection refused
    11/03/02 15:30:22 httpConn : 172.22.161.101 getPost: 8017
    11/03/02 15:30:22 Is Connection Open? --> true
    11/03/02 15:30:22 postMethod.getPath() : http://172.22.161.101:8017/app/mig3/migrate/MigrateOrder
    11/03/02 15:30:22 validate--> true
    11/03/02 15:30:22 isRequestSent --> true
    11/03/02 15:30:22 statusLine--> HTTP/1.1 200 OK
    2/03/2011 15:30:22 org.apache.commons.httpclient.HttpConnection releaseConnection
    WARNING: HttpConnectionManager is null. Connection cannot be released.
    11/03/02 15:30:22 Response from Call : <?xml version="1.0" encoding="UTF-8"?>
    <migrateOrderReply><statusCode>Failed</statusCode><errorReturn><errorCode>CORE_SYS_GENERIC</errorCode><errorMessage>Unexpected System exception</errorMessage></errorReturn></migrateOrderReply>
    ==================================================================================
    If u find any thing wrong then please let me know.
    Any reply is highly appreciated.
    Thanks Manish

Maybe you are looking for